diff --git a/application/itopwebpage.class.inc.php b/application/itopwebpage.class.inc.php index 51580aa74..b22d3f03b 100644 --- a/application/itopwebpage.class.inc.php +++ b/application/itopwebpage.class.inc.php @@ -219,7 +219,6 @@ EOF; ); $sTimeFormat = AttributeDateTime::GetFormat()->ToTimeFormat(); $oTimeFormat = new DateTimeFormat($sTimeFormat); - $sJSLangShort = json_encode(strtolower(substr(Dict::GetUserLanguage(), 0, 2))); // Date picker options $aPickerOptions = array( @@ -237,21 +236,23 @@ EOF; $sJSDatePickerOptions = json_encode($aPickerOptions); // Time picker additional options + $sUserLang = Dict::GetUserLanguage(); + $sTimePickerLang = json_encode(Dict::S('INTERNAL:JQuery-DatePicker:LangCode', $sUserLang)); $aPickerOptions['showOn'] = ''; $aPickerOptions['buttonImage'] = null; $aPickerOptions['timeFormat'] = $oTimeFormat->ToDatePicker(); $aPickerOptions['controlType'] = 'select'; $aPickerOptions['closeText'] = Dict::S('UI:Button:Ok'); $sJSDateTimePickerOptions = json_encode($aPickerOptions); - if ($sJSLangShort != '"en"') + if ($sTimePickerLang != '"en"') { // More options that cannot be passed via json_encode since they must be evaluated client-side $aMoreJSOptions = ", - 'timeText': $.timepicker.regional[$sJSLangShort].timeText, - 'hourText': $.timepicker.regional[$sJSLangShort].hourText, - 'minuteText': $.timepicker.regional[$sJSLangShort].minuteText, - 'secondText': $.timepicker.regional[$sJSLangShort].secondText, - 'currentText': $.timepicker.regional[$sJSLangShort].currentText + 'timeText': $.timepicker.regional[$sTimePickerLang].timeText, + 'hourText': $.timepicker.regional[$sTimePickerLang].hourText, + 'minuteText': $.timepicker.regional[$sTimePickerLang].minuteText, + 'secondText': $.timepicker.regional[$sTimePickerLang].secondText, + 'currentText': $.timepicker.regional[$sTimePickerLang].currentText }"; $sJSDateTimePickerOptions = substr($sJSDateTimePickerOptions, 0, -1).$aMoreJSOptions; } @@ -259,7 +260,7 @@ EOF; <<< EOF function GetUserLanguage() { - return $sJSLangShort; + return $sTimePickerLang; } function PrepareWidgets() { diff --git a/dictionaries/pt_br.dictionary.itop.core.php b/dictionaries/pt_br.dictionary.itop.core.php index 1dad95981..440964c95 100644 --- a/dictionaries/pt_br.dictionary.itop.core.php +++ b/dictionaries/pt_br.dictionary.itop.core.php @@ -21,6 +21,10 @@ * @copyright Copyright (C) 2010-2017 Combodo SARL * @license http://opensource.org/licenses/AGPL-3.0 */ +Dict::Add('PT BR', 'Brazilian', 'Brazilian', array( + 'INTERNAL:JQuery-DatePicker:LangCode' => 'pt-BR', +)); + Dict::Add('PT BR', 'Brazilian', 'Brazilian', array( 'Core:DeletedObjectLabel' => '%1s (excluído)', 'Core:DeletedObjectTip' => 'O objeto foi excluído em %1$s (%2$s)', diff --git a/dictionaries/zh_cn.dictionary.itop.core.php b/dictionaries/zh_cn.dictionary.itop.core.php index 9308fa990..cd8d048c0 100644 --- a/dictionaries/zh_cn.dictionary.itop.core.php +++ b/dictionaries/zh_cn.dictionary.itop.core.php @@ -21,6 +21,10 @@ * along with iTop. If not, see */ +Dict::Add('ZH CN', 'Chinese', '简体中文', array( + 'INTERNAL:JQuery-DatePicker:LangCode' => 'zh-CN', +)); + Dict::Add('ZH CN', 'Chinese', '简体中文', array( 'Core:DeletedObjectLabel' => '%1s (已删除)', 'Core:DeletedObjectTip' => 'The object has been deleted on %1$s (%2$s)',