From 9d6bef0a396f86d1c63e2ca5e72075ee43c33c46 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 15 Apr 2021 16:09:52 +0200 Subject: [PATCH] PreferenceForm: Reload the entire layout if the locale changes --- application/forms/PreferenceForm.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/application/forms/PreferenceForm.php b/application/forms/PreferenceForm.php index 9df7d1bcb..7f4297478 100644 --- a/application/forms/PreferenceForm.php +++ b/application/forms/PreferenceForm.php @@ -94,6 +94,7 @@ class PreferenceForm extends Form $this->preferences = new Preferences($this->store ? $this->store->load() : array()); $oldTheme = $this->preferences->getValue('icingaweb', 'theme'); + $oldLocale = $this->preferences->getValue('icingaweb', 'language'); $webPreferences = $this->preferences->get('icingaweb', array()); foreach ($this->getValues() as $key => $value) { @@ -118,6 +119,12 @@ class PreferenceForm extends Form $this->getResponse()->setReloadCss(true); } + if (($locale = $this->getElement('language')) !== null + && $locale->getValue() !== $oldLocale + ) { + $this->getResponse()->setHeader('X-Icinga-Redirect-Http', 'yes'); + } + try { if ($this->store && $this->getElement('btn_submit')->isChecked()) { $this->save();