From a2f41b078a67d5b539894c104f69933479d3712e Mon Sep 17 00:00:00 2001 From: typeling1578 Date: Sun, 22 Dec 2024 15:07:15 +0900 Subject: [PATCH] avoid global context promise (2) --- i18n/dictionaries.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/i18n/dictionaries.ts b/i18n/dictionaries.ts index 0b9fb73..ec4e695 100644 --- a/i18n/dictionaries.ts +++ b/i18n/dictionaries.ts @@ -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 ? T : never; +export type Dictionary = typeof enDict; const specialCases = (locale: string): Locale => { switch (locale) {