From: <dai...@us...> - 2011-07-02 08:02:07
|
Revision: 4612 http://web-erp.svn.sourceforge.net/web-erp/?rev=4612&view=rev Author: daintree Date: 2011-07-02 08:02:01 +0000 (Sat, 02 Jul 2011) Log Message: ----------- use mb_strlen for multibyte string length tests as now using UTF-8 throughout Modified Paths: -------------- trunk/includes/LanguageSetup.php Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-07-02 01:35:11 UTC (rev 4611) +++ trunk/includes/LanguageSetup.php 2011-07-02 08:02:01 UTC (rev 4612) @@ -2,6 +2,9 @@ /* $Id$ */ +/* Set internal character encoding to UTF-8 */ +mb_internal_encoding('UTF-8'); + /* This file is included in session.inc or PDFStarter.php or a report script that does not use PDFStarter.php to check for the existance of gettext function and setup the necessary enviroment to allow for automatic translation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dai...@us...> - 2011-07-02 08:02:07
|
Revision: 4612 http://web-erp.svn.sourceforge.net/web-erp/?rev=4612&view=rev Author: daintree Date: 2011-07-02 08:02:01 +0000 (Sat, 02 Jul 2011) Log Message: ----------- use mb_strlen for multibyte string length tests as now using UTF-8 throughout Modified Paths: -------------- trunk/includes/LanguageSetup.php Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2011-07-02 01:35:11 UTC (rev 4611) +++ trunk/includes/LanguageSetup.php 2011-07-02 08:02:01 UTC (rev 4612) @@ -2,6 +2,9 @@ /* $Id$ */ +/* Set internal character encoding to UTF-8 */ +mb_internal_encoding('UTF-8'); + /* This file is included in session.inc or PDFStarter.php or a report script that does not use PDFStarter.php to check for the existance of gettext function and setup the necessary enviroment to allow for automatic translation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ex...@us...> - 2013-07-18 10:39:27
|
Revision: 6098 http://sourceforge.net/p/web-erp/reponame/6098 Author: exsonqu Date: 2013-07-18 10:39:24 +0000 (Thu, 18 Jul 2013) Log Message: ----------- 07/18/2013: Exson add a locale style check to pass the style to MisFunctions.js to do locale number format validation. Modified Paths: -------------- trunk/includes/LanguageSetup.php Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2013-07-18 10:37:48 UTC (rev 6097) +++ trunk/includes/LanguageSetup.php 2013-07-18 10:39:24 UTC (rev 6098) @@ -23,7 +23,29 @@ } else { $Language = $_SESSION['Language']; } +//Check users' locale format via their language +//Then pass this information to the js for validation purpose +$Collect = array('US'=> array('en_US.utf8','en_GB.utf8','ja_JP.utf8','hi_IN.utf8','sw_KE.utf8','tr_TR.utf8','vi_VN.utf8','zh_CN.utf8','zh_HK.utf8','zh_TW.utf8'), + 'IN'=>array('en_IN.utf8'), + 'EE'=>array('ar_EG.utf8','cz_CZ.utf8','fr_CA.utf8','fr_FR.utf8','hr_HR.utf8','pl_PL.utf8','ru_RU.utf8','sq_AL.utf8','sv_SE.utf8'), + 'FR'=>array('ar_EG.utf8','cz_CZ.utf8','fr_CA.utf8','fr_FR.utf8','hr_HR.utf8','pl_PL.utf8','ru_RU.utf8','sq_AL.utf8','sv_SE.utf8'), + 'GM'=>array('de_DE.utf8','el_GR.utf8','es_ES.utf8','fa_IR.utf8','id_ID.utf8','it_IT.utf8','ro_RO.utf8','lv_LV.utf8','nl_NL.utf8','pt_BR.utf8','pt_PT.utf8')); + +foreach ($Collect as $Key=>$Value){ + if (in_array($Language,$Value)){ + $Lang = $Key; + $_SESSION['Lang'] = $Lang; + } + +} + +?> +<script type="text/javascript"> +Lang = <?php echo json_encode($Lang); ?>; +</script> +<?php + /*Since LanguagesArray requires the function _() to translate the language names - we must provide a substitute if it doesn't exist aready before we include includes/LanguagesArray.php * */ if (!function_exists('gettext')) { @@ -86,4 +108,4 @@ $DecimalPoint = $LanguagesArray[$_SESSION['Language']]['DecimalPoint']; $ThousandsSeparator = $LanguagesArray[$_SESSION['Language']]['ThousandsSeparator']; -?> \ No newline at end of file +?> |
From: <ex...@us...> - 2013-07-18 14:18:02
|
Revision: 6101 http://sourceforge.net/p/web-erp/reponame/6101 Author: exsonqu Date: 2013-07-18 14:18:00 +0000 (Thu, 18 Jul 2013) Log Message: ----------- 07/18/2013 Exson: fixed the LanguageSetup.php extra language mark introduced by handle locale number. Reported by Tim. Modified Paths: -------------- trunk/includes/LanguageSetup.php Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2013-07-18 14:14:58 UTC (rev 6100) +++ trunk/includes/LanguageSetup.php 2013-07-18 14:18:00 UTC (rev 6101) @@ -39,13 +39,8 @@ } } +echo '<input type="hidden" name="Lang" id="Lang" value="'.$Lang.'" />'; -?> -<script type="text/javascript"> -Lang = <?php echo json_encode($Lang); ?>; -</script> -<?php - /*Since LanguagesArray requires the function _() to translate the language names - we must provide a substitute if it doesn't exist aready before we include includes/LanguagesArray.php * */ if (!function_exists('gettext')) { |
From: <ex...@us...> - 2013-07-18 15:04:11
|
Revision: 6104 http://sourceforge.net/p/web-erp/reponame/6104 Author: exsonqu Date: 2013-07-18 15:04:09 +0000 (Thu, 18 Jul 2013) Log Message: ----------- 7/18/2013: Exson: Move the hidden input after the html document type definition. Reported by Tim. Modified Paths: -------------- trunk/includes/LanguageSetup.php Modified: trunk/includes/LanguageSetup.php =================================================================== --- trunk/includes/LanguageSetup.php 2013-07-18 15:03:27 UTC (rev 6103) +++ trunk/includes/LanguageSetup.php 2013-07-18 15:04:09 UTC (rev 6104) @@ -39,7 +39,6 @@ } } -echo '<input type="hidden" name="Lang" id="Lang" value="'.$Lang.'" />'; /*Since LanguagesArray requires the function _() to translate the language names - we must provide a substitute if it doesn't exist aready before we include includes/LanguagesArray.php * */ |