};
// Set up translations
-const LINGUAS = ["cs", "de", "el", "es", "ko", "nl", "pl", "sv", "tr", "zh_CN", "zh_TW"];
+const LINGUAS = ["cs", "de", "el", "es", "ko", "nl", "pl", "ru", "sv", "tr", "zh_CN", "zh_TW"];
l10n.setup(LINGUAS);
- if (l10n.language !== "en" && l10n.dictionary === undefined) {
- WebUtil.fetchJSON('app/locale/' + l10n.language + '.json', (translations) => {
- l10n.dictionary = translations;
-
- // wait for translations to load before loading the UI
- UI.prime();
- }, (err) => {
- Log.Error("Failed to load translations: " + err);
- UI.prime();
- });
- } else {
+ if (l10n.language === "en" || l10n.dictionary !== undefined) {
UI.prime();
+ } else {
+ WebUtil.fetchJSON('app/locale/' + l10n.language + '.json')
+ .then((translations) => { l10n.dictionary = translations; })
+ .catch(err => Log.Error("Failed to load translations: " + err))
+ .then(UI.prime);
}
export default UI;