maeshinshin пре 1 година
родитељ
комит
4455bcfcf2

+ 1 - 1
apps/app/src/pages/_app.page.tsx

@@ -78,7 +78,7 @@ function GrowiApp({ Component, pageProps, userLocale }: GrowiAppProps): JSX.Elem
 
 GrowiApp.getInitialProps = async(appContext: AppContext) => {
   const appProps = App.getInitialProps(appContext);
-  const userLocale = getLocaleAtServerSide(appContext.ctx.req as unknown as CrowiRequest) as Locale;
+  const userLocale = getLocaleAtServerSide(appContext.ctx.req as unknown as CrowiRequest);
 
   return { ...appProps, userLocale };
 };

+ 5 - 5
apps/app/src/pages/utils/commons.ts

@@ -110,11 +110,11 @@ export type LangMap = {
 };
 
 export const langMap: LangMap = {
-  [Lang.ja_JP]: 'ja-JP' as Locale,
-  [Lang.en_US]: 'en-US' as Locale,
-  [Lang.zh_CN]: 'zh-CN' as Locale,
-  [Lang.fr_FR]: 'fr-FR' as Locale,
-};
+  [Lang.ja_JP]: 'ja-JP',
+  [Lang.en_US]: 'en-US',
+  [Lang.zh_CN]: 'zh-CN',
+  [Lang.fr_FR]: 'fr-FR',
+} as const;
 
 // use this function to translate content
 export const getLangAtServerSide = (req: CrowiRequest): Lang => {

+ 1 - 2
packages/core/src/interfaces/locale.ts

@@ -1,2 +1 @@
-export const AllLocale = ['en-US', 'ja-JP', 'zh-CN', 'fr-FR'];
-export type Locale = 'ja-JP' | 'en-US' | 'zh-CN' | 'fr-FR';
+export type Locale = 'en-US' | 'ja-JP' | 'zh-CN' | 'fr-FR';