diff --git a/src/UI/UIDesktop.js b/src/UI/UIDesktop.js index 7b74cd8ee..3576fa80f 100644 --- a/src/UI/UIDesktop.js +++ b/src/UI/UIDesktop.js @@ -34,6 +34,7 @@ import UIWindowQR from "./UIWindowQR.js" import UIWindowRefer from "./UIWindowRefer.js" import UITaskbar from "./UITaskbar.js" import new_context_menu_item from "../helpers/new_context_menu_item.js" +import ChangeLanguage from "../i18n/i18nChangeLanguage.js" async function UIDesktop(options){ let h = ''; @@ -1070,7 +1071,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: ``, icon_active: ``, onClick: async function(){ @@ -1122,7 +1123,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({ @@ -1143,6 +1144,19 @@ $(document).on('click', '.user-options-menu-btn', async function(e){ } + // ------------------------------------------- + // Load avaialble languages + // ------------------------------------------- + const supoprtedLanguagesItems = ListSupportedLanugages().map(lang => { + return { + html: lang.name, + icon: window.locale === lang.code ? '✓' : '', + onClick: async function(){ + ChangeLanguage(lang.code); + } + } + }); + UIContextMenu({ id: 'user-options-menu', parent_element: parent_element, @@ -1177,6 +1191,14 @@ $(document).on('click', '.user-options-menu-btn', async function(e){ UIWindowChangePassword(); } }, + + //-------------------------------------------------- + // Change Language + //-------------------------------------------------- + { + html: i18n('change_language'), + items: supoprtedLanguagesItems + }, //-------------------------------------------------- // Contact Us //-------------------------------------------------- diff --git a/src/UI/UIWindowLogin.js b/src/UI/UIWindowLogin.js index 145a1f846..69386350b 100644 --- a/src/UI/UIWindowLogin.js +++ b/src/UI/UIWindowLogin.js @@ -36,7 +36,7 @@ async function UIWindowLogin(options){ h += `
`; h += `