Skip to content

Commit

Permalink
fix some translations showing up incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Oct 22, 2023
1 parent 7155752 commit bcb19c7
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/helpers/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bcb19c7

Please sign in to comment.