taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit b60f5cf77b8a9a25aed8976aa132a7db0a3c2e86
parent 290677b98abb76fe5b1e5b11a297b209407961d9
Author: Florian Dold <florian.dold@gmail.com>
Date:   Mon, 24 Apr 2017 16:45:40 +0200

some fixes for firefox

Diffstat:
Msrc/i18n.tsx | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git 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]);