]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Merge pull request #1204 from juanjoDiaz/small_improvements
authorSamuel Mannehed <samuel@cendio.se>
Mon, 4 Mar 2019 08:32:11 +0000 (09:32 +0100)
committerGitHub <noreply@github.com>
Mon, 4 Mar 2019 08:32:11 +0000 (09:32 +0100)
Small improvements

1  2 
app/ui.js

diff --cc app/ui.js
index db3b1f373fb1fb7b42162ce55ce5bd6b566f7e36,67af7cda1ab45c5f43ee646f1d725c1fad2124fc..17ec48d4bd04dd151ccc151603ae13b6a825d9d7
+++ b/app/ui.js
@@@ -1644,20 -1640,15 +1640,15 @@@ const UI = 
  };
  
  // 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;