Skip to content

Commit

Permalink
avoid global context promise (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
typeling1578 committed Dec 22, 2024
1 parent c5054a2 commit a2f41b0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions i18n/dictionaries.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import "server-only";
import {Locale, locales, supportedFiles} from "./i18n.config";
import enDict from "@/dictionaries/i18n/en/dictionary.json" with { type: "json" };

const enDict = import("@/dictionaries/i18n/en/dictionary.json").then(
(module) => module.default,
);
export type Dictionary = typeof enDict extends Promise<infer T> ? T : never;
export type Dictionary = typeof enDict;

const specialCases = (locale: string): Locale => {
switch (locale) {
Expand Down

0 comments on commit a2f41b0

Please sign in to comment.