Browse Source

170342-178601 use allLang

mariko-h 1 month ago
parent
commit
82023607a1
1 changed files with 3 additions and 3 deletions
  1. 3 3
      apps/app/src/server/util/safe-path-utils.ts

+ 3 - 3
apps/app/src/server/util/safe-path-utils.ts

@@ -1,6 +1,6 @@
+import { AllLang } from '@growi/core';
 import path from 'pathe';
-
-export const SUPPORTED_LOCALES = ['en_US', 'ja_JP', 'zh_CN'];
+export { AllLang as SUPPORTED_LOCALES };
 
 /**
  * Validates that the given file path is within the base directory.
@@ -64,7 +64,7 @@ export function resolveLocalePath(
   baseDir: string,
   templateSubPath: string,
 ): string {
-  const safeLocale = SUPPORTED_LOCALES.includes(locale) ? locale : 'en_US';
+  const safeLocale = (AllLang as string[]).includes(locale) ? locale : 'en_US';
   return path.join(baseDir, safeLocale, templateSubPath);
 }