Explorar o código

define default lang and accept lang map

jam411 %!s(int64=3) %!d(string=hai) anos
pai
achega
875292277c

+ 2 - 1
packages/app/config/next-i18next.config.ts

@@ -7,8 +7,9 @@ import I18NextLocalStorageBackend from 'i18next-localstorage-backend';
 
 const isDev = process.env.NODE_ENV === 'development';
 
+export const defalutLang = Lang.en_US;
 export const i18n = {
-  defaultLocale: Lang.en_US,
+  defaultLocale: defalutLang,
   locales: AllLang,
 };
 export const defaultNS = 'translation';

+ 5 - 0
packages/core/src/interfaces/lang.ts

@@ -5,3 +5,8 @@ export const Lang = {
 } as const;
 export const AllLang = Object.values(Lang);
 export type Lang = typeof Lang[keyof typeof Lang];
+export const acceptLangMap = {
+  en: Lang.en_US,
+  ja: Lang.ja_JP,
+  zh: Lang.zh_CN,
+};