From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup] ui: fix default language display
Date: Thu, 1 Sep 2022 09:21:27 +0200 [thread overview]
Message-ID: <20220901072127.3237686-1-d.csapak@proxmox.com> (raw)
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
next reply other threads:[~2022-09-01 7:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-01 7:21 Dominik Csapak [this message]
2022-09-12 7:48 ` [pbs-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220901072127.3237686-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox