diff --git a/lang/it-IT/commands.json b/lang/it/commands.json similarity index 100% rename from lang/it-IT/commands.json rename to lang/it/commands.json diff --git a/lang/it-IT/errors.json b/lang/it/errors.json similarity index 100% rename from lang/it-IT/errors.json rename to lang/it/errors.json diff --git a/lang/pl-PL/commands.json b/lang/pl/commands.json similarity index 100% rename from lang/pl-PL/commands.json rename to lang/pl/commands.json diff --git a/lang/pl-PL/errors.json b/lang/pl/errors.json similarity index 100% rename from lang/pl-PL/errors.json rename to lang/pl/errors.json diff --git a/src/helpers/strings.ts b/src/helpers/strings.ts index 2376e1ed0..a52da3e97 100644 --- a/src/helpers/strings.ts +++ b/src/helpers/strings.ts @@ -17,15 +17,15 @@ export function strings(forceEnglish = false): AllStrings { for (const json of JSONFiles) lang = { ...lang, - ...require(`@/lang/en-US/${json}.json`), // fallback + ...require(`@/lang/en-US/${json}.json`), }; if (countryCode == "en-GB" || countryCode == "en-US" || forceEnglish) return lang; - // because the fallback is already IN ENGLISH + // not in english for (const json of JSONFiles) try { - //* We try the import before spreading the object to avoid issues, we only want to check if the file exists + // try importing before adding to prevent errors if language isn't done const lang2 = require(`@/lang/${countryCode}/${json}.json`); lang = { ...lang, ...lang2 }; } catch {} // file not found