public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] ui: fix default language display
@ 2022-09-01  7:21 Dominik Csapak
  2022-09-12  7:48 ` [pbs-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2022-09-01  7:21 UTC (permalink / raw)
  To: pbs-devel

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@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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-12  7:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-01  7:21 [pbs-devel] [PATCH proxmox-backup] ui: fix default language display Dominik Csapak
2022-09-12  7:48 ` [pbs-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal