[icinga-checkins] icinga.org: icingaweb2/master: Show a warning if the chosen locale by the user is not available on the system

git at icinga.org git at icinga.org
Thu Nov 17 11:24:19 CET 2016


Module: icingaweb2
Branch: master
Commit: 1450bc4022428c311c868e5d806c210360865adf
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=1450bc4022428c311c868e5d806c210360865adf

Author: Alexander A. Klimov <alexander.klimov at netways.de>
Date:   Mon May 23 11:54:53 2016 +0200

Show a warning if the chosen locale by the user is not available on the system

refs #11820

---

 application/forms/PreferenceForm.php |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/application/forms/PreferenceForm.php b/application/forms/PreferenceForm.php
index 10270f2..d257054 100644
--- a/application/forms/PreferenceForm.php
+++ b/application/forms/PreferenceForm.php
@@ -156,6 +156,16 @@ class PreferenceForm extends Form
      */
     public function createElements(array $formData)
     {
+        if (setlocale(LC_ALL, 0) === 'C') {
+            $this->warning(
+                $this->translate(
+                    'Your language setting is not applied because your platform is missing the corresponding locale.'
+                    . ' Make sure to install the correct language pack and restart your web server afterwards.'
+                ),
+                false
+            );
+        }
+
         if (! (bool) Config::app()->get('themes', 'disabled', false)) {
             $themes = Icinga::app()->getThemes();
             if (count($themes) > 1) {



More information about the icinga-checkins mailing list