fix #3103. node config: allow to configure default UI language

This language is only used if none is set in the cookies.

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
This commit is contained in:
Matthias Heiserer
2022-01-24 11:09:51 +01:00
committed by Thomas Lamprecht
parent 163629e62e
commit 68811af9f9
2 changed files with 82 additions and 2 deletions

View File

@ -170,6 +170,15 @@ async fn get_index_future(
lang = language;
}
}
if lang.is_empty() {
if let Ok((config, _)) = proxmox_backup::config::node::config() {
if let Some(default) = config.default_lang {
if Path::new(&format!("/usr/share/pbs-i18n/pbs-lang-{}.js", default)).exists() {
lang = default;
}
}
}
}
let data = json!({
"NodeName": nodename,