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,6 +61,9 @@ const htmlStr = `
61 61
 function initHTML() {
62 62
     $(`#${sidePanelsContainerId}`)
63 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,6 +165,9 @@ export default {
162 165
             selectInput[0].dataset.i18n =
163 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 171
             APP.translation.translateElement(selectEl);
166 172
 
167 173
             APP.translation.addLanguageChangedListener(

Loading…
Cancel
Save