mariko-h пре 1 недеља
родитељ
комит
82023607a1
1 измењених фајлова са 3 додато и 3 уклоњено
  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';
 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.
  * Validates that the given file path is within the base directory.
@@ -64,7 +64,7 @@ export function resolveLocalePath(
   baseDir: string,
   baseDir: string,
   templateSubPath: string,
   templateSubPath: string,
 ): 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);
   return path.join(baseDir, safeLocale, templateSubPath);
 }
 }