diff --git a/src/store/modules/userSettings/defaultSettings.ts b/src/store/modules/userSettings/defaultSettings.ts index 7627e5b4..f24cc034 100644 --- a/src/store/modules/userSettings/defaultSettings.ts +++ b/src/store/modules/userSettings/defaultSettings.ts @@ -1,5 +1,19 @@ +import langData from "@i18n/index.json"; +function extractLangs(data: any): string[]{ + return Object.values(data).map((locale: any) => locale.Code); +}; +const langList = extractLangs(langData); +if(navigator.language === 'zh-CN') + { + var lan = 'zh-si' + }else{ + var lan = navigator.language + }; +if(langList.includes(lan)){}else{ + var lan = 'en' +}; export default Object.freeze({ - language: 'zh-si', + language: lan, disableFilters: false, compactModulesByArtTypeTable: true, planetsCalcSp2: false, diff --git a/tsconfig.json b/tsconfig.json index 01700633..d990eed8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "resolveJsonModule": true, "target": "esnext", "module": "esnext", "strict": true,