aboutsummaryrefslogtreecommitdiff
path: root/src/i18n.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/i18n.tsx')
-rw-r--r--src/i18n.tsx7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/i18n.tsx b/src/i18n.tsx
index dcc678900..ff32e62a8 100644
--- a/src/i18n.tsx
+++ b/src/i18n.tsx
@@ -32,11 +32,18 @@ const i18nResult = [] as any;
let lang: string;
try {
lang = chrome.i18n.getUILanguage();
+ // Chrome gives e.g. "en-US", but Firefox gives us "en_US"
+ lang = lang.replace("_", "-");
} catch (e) {
lang = "en";
console.warn("i18n default language not available");
}
+if (!strings[lang]) {
+ lang = "en-US";
+ console.log(`language ${lang} not found, defaulting to english`);
+}
+
let jed = new jedLib.Jed(strings[lang]);