[pbs-devel] [PATCH proxmox-backup] ui: fix default language display

Dominik Csapak d.csapak at proxmox.com
Thu Sep 1 09:21:27 CEST 2022


when we set a default language server side, we want to display that on
the login page. For that we have to use the 'language' variable in the
index template.

Also set the fallback to '__default__' instead of 'en' so that we show
'Default (English)'.

Was reported in the forum:

https://forum.proxmox.com/threads/set-default-language-on-server-login-screen-to-german.114431/

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/LoginView.js | 2 +-
 www/index.hbs    | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/LoginView.js b/www/LoginView.js
index a9538ded..33734f6c 100644
--- a/www/LoginView.js
+++ b/www/LoginView.js
@@ -298,7 +298,7 @@ Ext.define('PBS.LoginView', {
 			{
 			    xtype: 'proxmoxLanguageSelector',
 			    fieldLabel: gettext('Language'),
-			    value: Ext.util.Cookies.get('PBSLangCookie') || Proxmox.defaultLang || 'en',
+			    value: Ext.util.Cookies.get('PBSLangCookie') || Proxmox.defaultLang || '__default__',
 			    name: 'lang',
 			    reference: 'langField',
 			    submitValue: false,
diff --git a/www/index.hbs b/www/index.hbs
index 665bef23..1b8ea710 100644
--- a/www/index.hbs
+++ b/www/index.hbs
@@ -29,6 +29,7 @@
 	Setup: { auth_cookie_name: 'PBSAuthCookie' },
 	NodeName: "{{ NodeName }}",
 	UserName: "{{ UserName }}",
+	defaultLang: "{{ language }}",
 	CSRFPreventionToken: "{{ CSRFPreventionToken }}",
     };
     </script>
-- 
2.30.2






More information about the pbs-devel mailing list