From 6132a59f8a2371d5d85b9501b7d20e4701e2f429 Mon Sep 17 00:00:00 2001 From: jsatoh Date: Tue, 10 Jan 2012 04:46:09 +0000 Subject: [PATCH] 2012-01-10 Junichi Satoh * mobile/index.php: Fixed i18n translation does not work with mobile console. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5333 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 +++++ pandora_console/mobile/index.php | 20 +++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 585c9ce87f..17fbcf8a45 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-01-10 Junichi Satoh + + * mobile/index.php: Fixed i18n translation does not work with mobile + console. + 2012-01-09 Vanessa Gil * godmode/agentes/planned_downtime.php: allow cancelling scheduled downtime once it has started. diff --git a/pandora_console/mobile/index.php b/pandora_console/mobile/index.php index a2134b421d..f67982469d 100644 --- a/pandora_console/mobile/index.php +++ b/pandora_console/mobile/index.php @@ -12,6 +12,11 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. +//Set character encoding to UTF-8 - fixes a lot of multibyte character headaches +if (function_exists ('mb_internal_encoding')) { + mb_internal_encoding ("UTF-8"); +} + ob_start (); require_once("include/system.class.php"); @@ -33,6 +38,15 @@ if ($user == null) { $user = new User(); } $user->hackinjectConfig(); + +if ($user->isLogged()) { + $user_language = get_user_language ($system->getConfig('id_user')); + if (file_exists ('../include/languages/'.$user_language.'.mo')) { + $l10n = new gettext_reader (new CachedFileReader ('../include/languages/'.$user_language.'.mo')); + $l10n->load_tables(); + } +} + ?> @@ -64,7 +78,11 @@ $user->hackinjectConfig(); require ("../general/noaccess.php"); return; } - + $user_language = get_user_language ($system->getConfig('id_user')); + if (file_exists ('../include/languages/'.$user_language.'.mo')) { + $l10n = new gettext_reader (new CachedFileReader ('../include/languages/'.$user_language.'.mo')); + $l10n->load_tables(); + } $tactical = new Tactical(); $tactical->show(); }