Changeset 1039
- Timestamp:
- 07/23/08 21:33:00 (4 months ago)
- Files:
-
- branches/1.0.x/build/manifests/testapp.mn (modified) (1 diff)
- branches/1.0.x/lib/jelix/core/jLocale.class.php (modified) (2 diffs)
- branches/1.0.x/lib/jelix/CREDITS (modified) (1 diff)
- branches/1.0.x/testapp/modules/jelix_tests/locales/test_J.properties (added)
- branches/1.0.x/testapp/modules/jelix_tests/tests/core.jlocale.html_cli.php (modified) (1 diff)
- trunk/build/manifests/testapp.mn (modified) (1 diff)
- trunk/lib/jelix/core/jLocale.class.php (modified) (2 diffs)
- trunk/lib/jelix/CREDITS (modified) (1 diff)
- trunk/testapp/modules/jelix_tests/locales/test_J.properties (added)
- trunk/testapp/modules/jelix_tests/tests/core.jlocale.html_cli.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0.x/build/manifests/testapp.mn
r1006 r1039 92 92 test_H.properties 93 93 test_I.properties 94 test_J.properties 94 95 cd testapp/modules/jelix_tests/locales/fr_FR 95 96 testunit.ISO-8859-1.properties branches/1.0.x/lib/jelix/core/jLocale.class.php
r956 r1039 5 5 * @author Laurent Jouanneau 6 6 * @author Gerald Croes 7 * @contributor Julien Issler 8 * @copyright 2001-2005 CopixTeam, 2005-200 7Laurent Jouanneau7 * @contributor Julien Issler, Yannick Le Guédart 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. 10 10 * copyrighted by CopixTeam and released under GNU Lesser General Public Licence. 11 11 * initial authors : Gerald Croes, Laurent Jouanneau. 12 12 * enhancement by Laurent Jouanneau for Jelix. 13 * @copyright 2008 Julien Issler 13 * @copyright 2008 Julien Issler, 2008 Yannick Le Guédart 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 … … 120 120 if($multiline){ 121 121 if(preg_match("/^\s*(.*)\s*(\\\\?)$/U", $line, $match)){ 122 $sp = preg_split('/(?<!\\\\)\#/', $match[1], -1 ,PREG_SPLIT_NO_EMPTY);123 122 $multiline= ($match[2] =="\\"); 124 $this->_strings[$charset][$key].=' '.trim(str_replace('\#','#',$sp[0])); 123 if (strlen ($match[1])) { 124 $sp = preg_split('/(?<!\\\\)\#/', $match[1], -1 ,PREG_SPLIT_NO_EMPTY); 125 $this->_strings[$charset][$key].=' '.trim(str_replace('\#','#',$sp[0])); 126 } else { 127 $this->_strings[$charset][$key].=' '; 128 } 125 129 }else{ 126 130 throw new Exception('Syntaxe error in file properties '.$fichier.' line '.$linenumber,210); branches/1.0.x/lib/jelix/CREDITS
r1020 r1039 103 103 - jdb driver for Intuition 104 104 - resolved memory exhausted errors in truncate modifier (#511) 105 - fixed bug on jBundle (#639) 105 106 106 107 Kévin Lepeltier (aka Lipki) branches/1.0.x/testapp/modules/jelix_tests/tests/core.jlocale.html_cli.php
r956 r1039 55 55 'test_H.properties' => '<array><string key="module.description" value="Tests unitaires # jelix" /><string key="ooo" value="bbbb" /></array>', 56 56 'test_I.properties' => '<array><string key="module.description" value="Tests unitaires # jelix" /><string key="ooo" value="bbbb" /></array>', 57 'test_J.properties' => '<array> 58 <string key="text.key" value="bug 639 there shouldn\'t have a notice during the parsing of this property " /> 59 <string key="text.key2" value="same problem but with spaces at the end of the last line " /> 60 <string key="text.key3" value="youpa" /></array>', 57 61 ); 58 62 trunk/build/manifests/testapp.mn
r1030 r1039 101 101 test_H.properties 102 102 test_I.properties 103 test_J.properties 103 104 cd testapp/modules/jelix_tests/locales/fr_FR 104 105 testunit.ISO-8859-1.properties trunk/lib/jelix/core/jLocale.class.php
r1026 r1039 5 5 * @author Laurent Jouanneau 6 6 * @author Gerald Croes 7 * @contributor Julien Issler 8 * @copyright 2001-2005 CopixTeam, 2005-200 7Laurent Jouanneau7 * @contributor Julien Issler, Yannick Le Guédart 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. 10 10 * copyrighted by CopixTeam and released under GNU Lesser General Public Licence. 11 11 * initial authors : Gerald Croes, Laurent Jouanneau. 12 12 * enhancement by Laurent Jouanneau for Jelix. 13 * @copyright 2008 Julien Issler 13 * @copyright 2008 Julien Issler, 2008 Yannick Le Guédart 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 … … 120 120 if($multiline){ 121 121 if(preg_match("/^\s*(.*)\s*(\\\\?)$/U", $line, $match)){ 122 $sp = preg_split('/(?<!\\\\)\#/', $match[1], -1 ,PREG_SPLIT_NO_EMPTY);123 122 $multiline= ($match[2] =="\\"); 124 $this->_strings[$charset][$key].=' '.trim(str_replace(array('\#','\n'),array('#',"\n"),$sp[0])); 123 if (strlen ($match[1])) { 124 $sp = preg_split('/(?<!\\\\)\#/', $match[1], -1 ,PREG_SPLIT_NO_EMPTY); 125 $this->_strings[$charset][$key].=' '.trim(str_replace(array('\#','\n'),array('#',"\n"),$sp[0])); 126 } else { 127 $this->_strings[$charset][$key].=' '; 128 } 125 129 }else{ 126 130 throw new Exception('Syntaxe error in file properties '.$fichier.' line '.$linenumber,210); trunk/lib/jelix/CREDITS
r1020 r1039 50 50 - jdb driver for Intuition 51 51 - resolved memory exhausted errors in truncate modifier (#511) 52 - fixed bug on jBundle (#639) 52 53 53 54 Kévin Lepeltier (aka Lipki) trunk/testapp/modules/jelix_tests/tests/core.jlocale.html_cli.php
r953 r1039 55 55 'test_H.properties' => '<array><string key="module.description" value="Tests unitaires # jelix" /><string key="ooo" value="bbbb" /></array>', 56 56 'test_I.properties' => '<array><string key="module.description" value="Tests unitaires # jelix" /><string key="ooo" value="bbbb" /></array>', 57 'test_J.properties' => '<array> 58 <string key="text.key" value="bug 639 there shouldn\'t have a notice during the parsing of this property " /> 59 <string key="text.key2" value="same problem but with spaces at the end of the last line " /> 60 <string key="text.key3" value="youpa" /></array>', 57 61 ); 58 62 … … 179 183 $GLOBALS['gJConfig']->charset = 'UTF-8'; 180 184 } 181 185 182 186 function testLineBreak(){ 183 187 $this->assertEqual("This sentence has a line break\n after the word \"break\"",jLocale::get('tests4.string.with.line.break',null,'en_EN','UTF-8')); 184 188 } 185 189 186 190 function testLineBreakWithMultiLineString(){ 187 191 $this->assertEqual("This multiline sentence\n has two line breaks\n after the words \"sentence\" and \"breaks\"",jLocale::get('tests4.multiline.string.with.line.break',null,'en_EN','UTF-8')); 188 192 } 189 193 190 194 } 191 195
