Changeset 1128
- Timestamp:
- 10/18/08 00:44:10 (3 months ago)
- Files:
-
- branches/1.0.x/lib/jelix/core/jLocale.class.php (modified) (5 diffs)
- branches/1.0.x/testapp/modules/jelix_tests/locales/fr_FR/tests1.UTF-8.properties (modified) (1 diff)
- branches/1.0.x/testapp/modules/jelix_tests/locales/fr_FR/testunit.ISO-8859-1.properties (modified) (1 diff)
- branches/1.0.x/testapp/modules/jelix_tests/tests/core.jlocale.html_cli.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0.x/lib/jelix/core/jLocale.class.php
r1039 r1128 5 5 * @author Laurent Jouanneau 6 6 * @author Gerald Croes 7 * @contributor Julien Issler, Yannick Le Guédart 7 * @contributor Julien Issler, Yannick Le Guédart, Dominique Papin 8 8 * @copyright 2001-2005 CopixTeam, 2005-2008 Laurent Jouanneau 9 9 * Some parts of this file are took from Copix Framework v2.3dev20050901, CopixI18N.class.php, http://www.copix.org. … … 11 11 * initial authors : Gerald Croes, Laurent Jouanneau. 12 12 * enhancement by Laurent Jouanneau for Jelix. 13 * @copyright 2008 Julien Issler, 2008 Yannick Le Guédart 13 * @copyright 2008 Julien Issler, 2008 Yannick Le Guédart, 2008 Dominique Papin 14 14 * @link http://www.jelix.org 15 15 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 111 111 112 112 if (($f = @fopen ($fichier, 'r')) !== false) { 113 $utf8Mod = ($charset=='UTF-8')?'u':''; 113 114 $multiline=false; 114 115 $linenumber=0; … … 119 120 $line=rtrim($line); 120 121 if($multiline){ 121 if(preg_match("/^\s*(.*)\s*(\\\\?)$/U" , $line, $match)){122 if(preg_match("/^\s*(.*)\s*(\\\\?)$/U".$utf8Mod, $line, $match)){ 122 123 $multiline= ($match[2] =="\\"); 123 124 if (strlen ($match[1])) { … … 130 131 throw new Exception('Syntaxe error in file properties '.$fichier.' line '.$linenumber,210); 131 132 } 132 }elseif(preg_match("/^\s*(.+)\s*=\s*(.*)\s*(\\\\?)$/U" ,$line, $match)){133 }elseif(preg_match("/^\s*(.+)\s*=\s*(.*)\s*(\\\\?)$/U".$utf8Mod,$line, $match)){ 133 134 // on a bien un cle=valeur 134 135 $key=$match[1]; branches/1.0.x/testapp/modules/jelix_tests/locales/fr_FR/tests1.UTF-8.properties
r1115 r1128 3 3 multiline.locale.with.accent = Chaîne à\ 4 4 tester 5 multiline.locale.with.accent2 = Chaîne à \ 6 tester à \ 7 foison branches/1.0.x/testapp/modules/jelix_tests/locales/fr_FR/testunit.ISO-8859-1.properties
r1115 r1128 1 1 moduleDescription = Tests unitaires jelix 2 2 multiline.locale.with.accent = Cha� �tester 3 multiline.locale.with.accent2 = Cha� � 4 tester � 5 foison branches/1.0.x/testapp/modules/jelix_tests/tests/core.jlocale.html_cli.php
r1115 r1128 4 4 * @subpackage jelix_tests module 5 5 * @author Jouanneau Laurent 6 * @contributor Julien Issler 6 * @contributor Julien Issler, Dominique Papin 7 7 * @copyright 2006-2007 Jouanneau laurent 8 * @copyright 2008 Julien Issler 8 * @copyright 2008 Julien Issler, 2008 Dominique Papin 9 9 * @link http://www.jelix.org 10 10 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 80 80 $this->assertEqual('ceci est une phrase fr_FR',jLocale::get('tests1.first.locale', null, 'fr_FR')); 81 81 $this->assertEqualOrDiff('Chaîne à tester',jLocale::get('tests1.multiline.locale.with.accent')); 82 $this->assertEqualOrDiff('Chaîne à tester à foison',jLocale::get('tests1.multiline.locale.with.accent2')); 82 83 $this->assertEqualOrDiff(utf8_decode('Chaîne à tester'),jLocale::get('testunit.multiline.locale.with.accent',null,null,'ISO-8859-1')); 84 $this->assertEqualOrDiff(utf8_decode('Chaîne à tester à foison'),jLocale::get('testunit.multiline.locale.with.accent2',null,null,'ISO-8859-1')); 83 85 $this->assertEqual('ceci est une phrase fr_CA',jLocale::get('tests1.first.locale', null, 'fr_CA')); 84 86 $this->assertEqual('this is an en_US sentence',jLocale::get('tests1.first.locale', null, 'en_US'));
