2013-05-04 Junichi Satoh <junichi@rworks.jp>

* mobile/index.php, mobile/include/user.class.php,
	include/functions.php: Fixed i18n failure in the mobile console.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8098 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
jsatoh 2013-05-04 00:29:16 +00:00
parent 16ca79f181
commit 7ed26566f1
4 changed files with 22 additions and 9 deletions

View File

@ -1,3 +1,8 @@
2013-05-04 Junichi Satoh <junichi@rworks.jp>
* mobile/index.php, mobile/include/user.class.php,
include/functions.php: Fixed i18n failure in the mobile console.
2013-05-03 Junichi Satoh <junichi@rworks.jp>
* include/functions_graph.php: Fixed warnings.

View File

@ -357,11 +357,11 @@ function get_system_time () {
/**
* This function provide the user language configuration if is not default, otherwise return the system language
*
* @param int $id_user
* @param string $id_user
*
* @return string user active language code
*/
function get_user_language ($id_user = false) {
function get_user_language ($id_user = null) {
global $config;
$quick_language = get_parameter('quick_language_change', 0);
@ -378,11 +378,11 @@ function get_user_language ($id_user = false) {
}
}
if($id_user === false && isset($config['id_user'])) {
if($id_user === null && isset($config['id_user'])) {
$id_user = $config['id_user'];
}
if($id_user !== false) {
if($id_user !== null) {
$userinfo = get_user_info ($id_user);
if ($userinfo['language'] != 'default'){
return $userinfo['language'];

View File

@ -111,11 +111,6 @@ class User {
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();
}
}
return $this->logged;

View File

@ -46,6 +46,14 @@ if (!$user->isLogged()) {
$action = 'login';
}
if ($action != "ajax") {
$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();
}
}
switch ($action) {
case 'ajax':
$parameter1 = $system->getRequest('parameter1', false);
@ -77,6 +85,11 @@ switch ($action) {
}
else {
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();
}
$home = new Home();
$home->show();
}