Преглед изворни кода

Fix listing languages
Translate additional fields

Sondre Njåstad пре 1 година
родитељ
комит
2f63c4cadf
2 измењених фајлова са 4 додато и 3 уклоњено
  1. 3 2
      src/UI/UIDesktop.js
  2. 1 1
      src/i18n/i18n.js

+ 3 - 2
src/UI/UIDesktop.js

@@ -1046,7 +1046,7 @@ $(document).on('click', '.user-options-menu-btn', async function(e){
     if(window.user.is_temp){
         items.push(            
             {
-                html: `Save Session`,
+                html: i18n('save_session'),
                 icon: `<svg style="margin-bottom: -4px; width: 16px; height: 16px;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="48px" height="48px" viewBox="0 0 48 48"><g transform="translate(0, 0)"><path d="M45.521,39.04L27.527,5.134c-1.021-1.948-3.427-2.699-5.375-1.679-.717,.376-1.303,.961-1.679,1.679L2.479,39.04c-.676,1.264-.635,2.791,.108,4.017,.716,1.207,2.017,1.946,3.42,1.943H41.993c1.403,.003,2.704-.736,3.42-1.943,.743-1.226,.784-2.753,.108-4.017ZM23.032,15h1.937c.565,0,1.017,.467,1,1.031l-.438,14c-.017,.54-.459,.969-1,.969h-1.062c-.54,0-.983-.429-1-.969l-.438-14c-.018-.564,.435-1.031,1-1.031Zm.968,25c-1.657,0-3-1.343-3-3s1.343-3,3-3,3,1.343,3,3-1.343,3-3,3Z" fill="#ffbb00"></path></g></svg>`,
                 icon_active: `<svg style="margin-bottom: -4px; width: 16px; height: 16px;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="48px" height="48px" viewBox="0 0 48 48"><g transform="translate(0, 0)"><path d="M45.521,39.04L27.527,5.134c-1.021-1.948-3.427-2.699-5.375-1.679-.717,.376-1.303,.961-1.679,1.679L2.479,39.04c-.676,1.264-.635,2.791,.108,4.017,.716,1.207,2.017,1.946,3.42,1.943H41.993c1.403,.003,2.704-.736,3.42-1.943,.743-1.226,.784-2.753,.108-4.017ZM23.032,15h1.937c.565,0,1.017,.467,1,1.031l-.438,14c-.017,.54-.459,.969-1,.969h-1.062c-.54,0-.983-.429-1-.969l-.438-14c-.018-.564,.435-1.031,1-1.031Zm.968,25c-1.657,0-3-1.343-3-3s1.343-3,3-3,3,1.343,3,3-1.343,3-3,3Z" fill="#ffbb00"></path></g></svg>`,
                 onClick: async function(){
@@ -1098,7 +1098,7 @@ $(document).on('click', '.user-options-menu-btn', async function(e){
 
         items.push(            
             {
-                html: 'Add existing account',
+                html: i18n('add_existing_account'),
                 // icon: l_user.username === user.username ? '✓' : '',
                 onClick: async function(val){
                     await UIWindowLogin({
@@ -1131,6 +1131,7 @@ $(document).on('click', '.user-options-menu-btn', async function(e){
             }
         }
     });
+    console.log(supoprtedLanguagesItems)
 
     UIContextMenu({
         id: 'user-options-menu',

+ 1 - 1
src/i18n/i18n.js

@@ -2,7 +2,7 @@ import translations from './translations/translations.js';
 
 window.ListSupportedLanugages = function () {
     var result = [];
-    translations.keys.forEach(function (key) {
+    Object.keys(translations).forEach(function (key) {
         result.push(translations[key]);
     });
     return result;