Browse Source

Fixes settings panel translation.

Strings are not translated when opening the settings side panel. It was that we were creating settings panel html after i18n library had loaded and had translated the rest of the html.
The element selecting the current language was also not translated, which end up with no selection in the UI for the current language.
master
damencho 8 years ago
parent
commit
4e9450f200
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      modules/UI/side_pannels/settings/SettingsMenu.js

+ 6
- 0
modules/UI/side_pannels/settings/SettingsMenu.js View File

61
 function initHTML() {
61
 function initHTML() {
62
     $(`#${sidePanelsContainerId}`)
62
     $(`#${sidePanelsContainerId}`)
63
         .append(htmlStr);
63
         .append(htmlStr);
64
+    // make sure we translate the panel, as adding it can be after i18n
65
+    // library had initialized and translated already present html
66
+    APP.translation.translateElement($(`#${sidePanelsContainerId}`));
64
 }
67
 }
65
 
68
 
66
 /**
69
 /**
162
             selectInput[0].dataset.i18n =
165
             selectInput[0].dataset.i18n =
163
                 `languages:${APP.translation.getCurrentLanguage()}`;
166
                 `languages:${APP.translation.getCurrentLanguage()}`;
164
 
167
 
168
+            // translate selectInput, which is the currently selected language
169
+            // otherwise there will be no selected option
170
+            APP.translation.translateElement(selectInput);
165
             APP.translation.translateElement(selectEl);
171
             APP.translation.translateElement(selectEl);
166
 
172
 
167
             APP.translation.addLanguageChangedListener(
173
             APP.translation.addLanguageChangedListener(

Loading…
Cancel
Save