diff options
Diffstat (limited to 'ui/jsLoader.php')
-rw-r--r-- | ui/jsLoader.php | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/ui/jsLoader.php b/ui/jsLoader.php index 96fbd9ed5b4..cc2b3a9d12e 100644 --- a/ui/jsLoader.php +++ b/ui/jsLoader.php @@ -20,31 +20,12 @@ // get language translations -require_once dirname(__FILE__).'/include/gettextwrapper.inc.php'; -require_once dirname(__FILE__).'/include/js.inc.php'; require_once dirname(__FILE__).'/include/locales.inc.php'; -require_once dirname(__FILE__).'/include/translateDefines.inc.php'; +require_once dirname(__FILE__).'/include/gettextwrapper.inc.php'; -// if we must provide language constants on language different from English -if (isset($_GET['lang'])) { - if (function_exists('bindtextdomain')) { - // initializing gettext translations depending on language selected by user - $locales = zbx_locale_variants($_GET['lang']); - foreach ($locales as $locale) { - putenv('LC_ALL='.$locale); - putenv('LANG='.$locale); - putenv('LANGUAGE='.$locale); - if (setlocale(LC_ALL, $locale)) { - break; - } - } - bindtextdomain('frontend', 'locale'); - bind_textdomain_codeset('frontend', 'UTF-8'); - textdomain('frontend'); - } - // numeric Locale to default - setlocale(LC_NUMERIC, ['C', 'POSIX', 'en', 'en_US', 'en_US.UTF-8', 'English_United States.1252']); -} +setupLocale(array_key_exists('lang', $_GET) ? (string) $_GET['lang'] : 'en_GB'); + +require_once dirname(__FILE__).'/include/js.inc.php'; // available scripts 'scriptFileName' => 'path relative to js/' $availableJScripts = [ @@ -128,7 +109,6 @@ $availableJScripts = [ 'report2.js' => 'pages/', 'report4.js' => 'pages/', 'setup.js' => 'pages/', - 'monitoring.overview.js' => 'pages/', 'popup.condition.common.js' => 'pages/', 'popup.operation.common.js' => 'pages/' ]; |