Changeset 954
- Timestamp:
- 05/28/08 13:48:53 (6 months ago)
- Files:
-
- branches/1.0.x/build/manifests/testapp.mn (modified) (1 diff)
- branches/1.0.x/build/manifests/testapp.mn (modified) (1 diff)
- branches/1.0.x/build/manifests/testapp.mn (modified) (1 diff)
- branches/1.0.x/build/manifests/testapp.mn (modified) (1 diff)
- branches/1.0.x/lib/jelix/core/jLocale.class.php (modified) (4 diffs)
- branches/1.0.x/lib/jelix/core/jLocale.class.php (modified) (4 diffs)
- branches/1.0.x/lib/jelix/core/jLocale.class.php (modified) (4 diffs)
- branches/1.0.x/lib/jelix/core/jLocale.class.php (modified) (4 diffs)
- branches/1.0.x/lib/jelix/CREDITS (modified) (1 diff)
- branches/1.0.x/lib/jelix/CREDITS (modified) (1 diff)
- branches/1.0.x/lib/jelix/CREDITS (modified) (1 diff)
- branches/1.0.x/lib/jelix/CREDITS (modified) (1 diff)
- branches/1.0.x/lib/jelix/plugins/tpl/html/function.jlocale.php (modified) (2 diffs)
- branches/1.0.x/lib/jelix/plugins/tpl/html/function.jlocale.php (modified) (2 diffs)
- branches/1.0.x/lib/jelix/plugins/tpl/html/function.jlocale.php (modified) (2 diffs)
- branches/1.0.x/lib/jelix/plugins/tpl/html/function.jlocale.php (modified) (2 diffs)
- branches/1.0.x/testapp/modules/jelix_tests/locales/en_EN/tests4.UTF-8.properties (added)
- branches/1.0.x/testapp/modules/jelix_tests/locales/en_EN/tests4.UTF-8.properties (added)
- branches/1.0.x/testapp/modules/jelix_tests/locales/en_EN/tests4.UTF-8.properties (added)
- branches/1.0.x/testapp/modules/jelix_tests/locales/en_EN/tests4.UTF-8.properties (added)
- branches/1.0.x/testapp/modules/jelix_tests/tests/core.jlocale.html_cli.php (modified) (1 diff)
- branches/1.0.x/testapp/modules/jelix_tests/tests/core.jlocale.html_cli.php (modified) (1 diff)
- branches/1.0.x/testapp/modules/jelix_tests/tests/core.jlocale.html_cli.php (modified) (1 diff)
- branches/1.0.x/testapp/modules/jelix_tests/tests/core.jlocale.html_cli.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0.x/build/manifests/testapp.mn
r851 r954 103 103 tests1.UTF-8.properties 104 104 tests3.UTF-8.properties 105 tests4.UTF-8.properties 105 106 cd testapp/modules/jelix_tests/templates 106 107 menu.tpl branches/1.0.x/build/manifests/testapp.mn
r851 r954 103 103 tests1.UTF-8.properties 104 104 tests3.UTF-8.properties 105 tests4.UTF-8.properties 105 106 cd testapp/modules/jelix_tests/templates 106 107 menu.tpl branches/1.0.x/build/manifests/testapp.mn
r851 r954 103 103 tests1.UTF-8.properties 104 104 tests3.UTF-8.properties 105 tests4.UTF-8.properties 105 106 cd testapp/modules/jelix_tests/templates 106 107 menu.tpl branches/1.0.x/build/manifests/testapp.mn
r851 r954 103 103 tests1.UTF-8.properties 104 104 tests3.UTF-8.properties 105 tests4.UTF-8.properties 105 106 cd testapp/modules/jelix_tests/templates 106 107 menu.tpl branches/1.0.x/lib/jelix/core/jLocale.class.php
r803 r954 5 5 * @author Laurent Jouanneau 6 6 * @author Gerald Croes 7 * @contributor 7 * @contributor Julien Issler 8 8 * @copyright 2001-2005 CopixTeam, 2005-2007 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 13 14 * @link http://www.jelix.org 14 15 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 121 122 $sp = preg_split('/(?<!\\\\)\#/', $match[1], -1 ,PREG_SPLIT_NO_EMPTY); 122 123 $multiline= ($match[2] =="\\"); 123 $this->_strings[$charset][$key].=' '.trim(str_replace( '\#','#',$sp[0]));124 $this->_strings[$charset][$key].=' '.trim(str_replace(array('\#','\n'),array('#',"\n"),$sp[0])); 124 125 }else{ 125 126 throw new Exception('Syntaxe error in file properties '.$fichier.' line '.$linenumber,210); … … 139 140 } 140 141 141 $this->_strings[$charset][$key] = $value;142 $this->_strings[$charset][$key] = str_replace(array('\#','\n'),array('#',"\n"),$value); 142 143 143 144 }elseif(preg_match("/^\s*(\#.*)?$/",$line, $match)){ branches/1.0.x/lib/jelix/core/jLocale.class.php
r803 r954 5 5 * @author Laurent Jouanneau 6 6 * @author Gerald Croes 7 * @contributor 7 * @contributor Julien Issler 8 8 * @copyright 2001-2005 CopixTeam, 2005-2007 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 13 14 * @link http://www.jelix.org 14 15 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 121 122 $sp = preg_split('/(?<!\\\\)\#/', $match[1], -1 ,PREG_SPLIT_NO_EMPTY); 122 123 $multiline= ($match[2] =="\\"); 123 $this->_strings[$charset][$key].=' '.trim(str_replace( '\#','#',$sp[0]));124 $this->_strings[$charset][$key].=' '.trim(str_replace(array('\#','\n'),array('#',"\n"),$sp[0])); 124 125 }else{ 125 126 throw new Exception('Syntaxe error in file properties '.$fichier.' line '.$linenumber,210); … … 139 140 } 140 141 141 $this->_strings[$charset][$key] = $value;142 $this->_strings[$charset][$key] = str_replace(array('\#','\n'),array('#',"\n"),$value); 142 143 143 144 }elseif(preg_match("/^\s*(\#.*)?$/",$line, $match)){ branches/1.0.x/lib/jelix/core/jLocale.class.php
r803 r954 5 5 * @author Laurent Jouanneau 6 6 * @author Gerald Croes 7 * @contributor 7 * @contributor Julien Issler 8 8 * @copyright 2001-2005 CopixTeam, 2005-2007 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 13 14 * @link http://www.jelix.org 14 15 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 121 122 $sp = preg_split('/(?<!\\\\)\#/', $match[1], -1 ,PREG_SPLIT_NO_EMPTY); 122 123 $multiline= ($match[2] =="\\"); 123 $this->_strings[$charset][$key].=' '.trim(str_replace( '\#','#',$sp[0]));124 $this->_strings[$charset][$key].=' '.trim(str_replace(array('\#','\n'),array('#',"\n"),$sp[0])); 124 125 }else{ 125 126 throw new Exception('Syntaxe error in file properties '.$fichier.' line '.$linenumber,210); … … 139 140 } 140 141 141 $this->_strings[$charset][$key] = $value;142 $this->_strings[$charset][$key] = str_replace(array('\#','\n'),array('#',"\n"),$value); 142 143 143 144 }elseif(preg_match("/^\s*(\#.*)?$/",$line, $match)){ branches/1.0.x/lib/jelix/core/jLocale.class.php
r803 r954 5 5 * @author Laurent Jouanneau 6 6 * @author Gerald Croes 7 * @contributor 7 * @contributor Julien Issler 8 8 * @copyright 2001-2005 CopixTeam, 2005-2007 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 13 14 * @link http://www.jelix.org 14 15 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 121 122 $sp = preg_split('/(?<!\\\\)\#/', $match[1], -1 ,PREG_SPLIT_NO_EMPTY); 122 123 $multiline= ($match[2] =="\\"); 123 $this->_strings[$charset][$key].=' '.trim(str_replace( '\#','#',$sp[0]));124 $this->_strings[$charset][$key].=' '.trim(str_replace(array('\#','\n'),array('#',"\n"),$sp[0])); 124 125 }else{ 125 126 throw new Exception('Syntaxe error in file properties '.$fichier.' line '.$linenumber,210); … … 139 140 } 140 141 141 $this->_strings[$charset][$key] = $value;142 $this->_strings[$charset][$key] = str_replace(array('\#','\n'),array('#',"\n"),$value); 142 143 143 144 }elseif(preg_match("/^\s*(\#.*)?$/",$line, $match)){ branches/1.0.x/lib/jelix/CREDITS
r952 r954 76 76 - jZipCreator : empty dirs are not included in the archive (#570) 77 77 - jForms : fixed bugs in jforms.js based on Martus' report (#554) 78 - jLocale : support multiline rendering in strings (#569) 78 79 79 80 Bastien Jaillot (aka bastnic) branches/1.0.x/lib/jelix/CREDITS
r952 r954 76 76 - jZipCreator : empty dirs are not included in the archive (#570) 77 77 - jForms : fixed bugs in jforms.js based on Martus' report (#554) 78 - jLocale : support multiline rendering in strings (#569) 78 79 79 80 Bastien Jaillot (aka bastnic) branches/1.0.x/lib/jelix/CREDITS
r952 r954 76 76 - jZipCreator : empty dirs are not included in the archive (#570) 77 77 - jForms : fixed bugs in jforms.js based on Martus' report (#554) 78 - jLocale : support multiline rendering in strings (#569) 78 79 79 80 Bastien Jaillot (aka bastnic) branches/1.0.x/lib/jelix/CREDITS
r952 r954 76 76 - jZipCreator : empty dirs are not included in the archive (#570) 77 77 - jForms : fixed bugs in jforms.js based on Martus' report (#554) 78 - jLocale : support multiline rendering in strings (#569) 78 79 79 80 Bastien Jaillot (aka bastnic) branches/1.0.x/lib/jelix/plugins/tpl/html/function.jlocale.php
r506 r954 4 4 * @subpackage jtpl_plugin 5 5 * @author Jouanneau Laurent 6 * @contributor 6 * @contributor Julien Issler 7 7 * @copyright 2005-2007 Jouanneau laurent 8 * @copyright 2008 Julien Issler 8 9 * @link http://www.jelix.org 9 10 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 21 22 if(func_num_args() == 3 && is_array(func_get_arg(2))){ 22 23 $param = func_get_arg(2); 23 echo htmlspecialchars(jLocale::get($locale, $param));24 echo nl2br(htmlspecialchars(jLocale::get($locale, $param))); 24 25 }elseif(func_num_args() > 2){ 25 26 $params = func_get_args(); 26 27 unset($params[0]); 27 28 unset($params[1]); 28 echo htmlspecialchars(jLocale::get($locale, $params));29 echo nl2br(htmlspecialchars(jLocale::get($locale, $params))); 29 30 }else{ 30 echo htmlspecialchars(jLocale::get($locale));31 echo nl2br(htmlspecialchars(jLocale::get($locale))); 31 32 } 32 33 } branches/1.0.x/lib/jelix/plugins/tpl/html/function.jlocale.php
r506 r954 4 4 * @subpackage jtpl_plugin 5 5 * @author Jouanneau Laurent 6 * @contributor 6 * @contributor Julien Issler 7 7 * @copyright 2005-2007 Jouanneau laurent 8 * @copyright 2008 Julien Issler 8 9 * @link http://www.jelix.org 9 10 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 21 22 if(func_num_args() == 3 && is_array(func_get_arg(2))){ 22 23 $param = func_get_arg(2); 23 echo htmlspecialchars(jLocale::get($locale, $param));24 echo nl2br(htmlspecialchars(jLocale::get($locale, $param))); 24 25 }elseif(func_num_args() > 2){ 25 26 $params = func_get_args(); 26 27 unset($params[0]); 27 28 unset($params[1]); 28 echo htmlspecialchars(jLocale::get($locale, $params));29 echo nl2br(htmlspecialchars(jLocale::get($locale, $params))); 29 30 }else{ 30 echo htmlspecialchars(jLocale::get($locale));31 echo nl2br(htmlspecialchars(jLocale::get($locale))); 31 32 } 32 33 } branches/1.0.x/lib/jelix/plugins/tpl/html/function.jlocale.php
r506 r954 4 4 * @subpackage jtpl_plugin 5 5 * @author Jouanneau Laurent 6 * @contributor 6 * @contributor Julien Issler 7 7 * @copyright 2005-2007 Jouanneau laurent 8 * @copyright 2008 Julien Issler 8 9 * @link http://www.jelix.org 9 10 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 21 22 if(func_num_args() == 3 && is_array(func_get_arg(2))){ 22 23 $param = func_get_arg(2); 23 echo htmlspecialchars(jLocale::get($locale, $param));24 echo nl2br(htmlspecialchars(jLocale::get($locale, $param))); 24 25 }elseif(func_num_args() > 2){ 25 26 $params = func_get_args(); 26 27 unset($params[0]); 27 28 unset($params[1]); 28 echo htmlspecialchars(jLocale::get($locale, $params));29 echo nl2br(htmlspecialchars(jLocale::get($locale, $params))); 29 30 }else{ 30 echo htmlspecialchars(jLocale::get($locale));31 echo nl2br(htmlspecialchars(jLocale::get($locale))); 31 32 } 32 33 } branches/1.0.x/lib/jelix/plugins/tpl/html/function.jlocale.php
r506 r954 4 4 * @subpackage jtpl_plugin 5 5 * @author Jouanneau Laurent 6 * @contributor 6 * @contributor Julien Issler 7 7 * @copyright 2005-2007 Jouanneau laurent 8 * @copyright 2008 Julien Issler 8 9 * @link http://www.jelix.org 9 10 * @licence GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html … … 21 22 if(func_num_args() == 3 && is_array(func_get_arg(2))){ 22 23 $param = func_get_arg(2); 23 echo htmlspecialchars(jLocale::get($locale, $param));24 echo nl2br(htmlspecialchars(jLocale::get($locale, $param))); 24 25 }elseif(func_num_args() > 2){ 25 26 $params = func_get_args(); 26 27 unset($params[0]); 27 28 unset($params[1]); 28 echo htmlspecialchars(jLocale::get($locale, $params));29 echo nl2br(htmlspecialchars(jLocale::get($locale, $params))); 29 30 }else{ 30 echo htmlspecialchars(jLocale::get($locale));31 echo nl2br(htmlspecialchars(jLocale::get($locale))); 31 32 } 32 33 } branches/1.0.x/testapp/modules/jelix_tests/tests/core.jlocale.html_cli.php
r915 r954 176 176 $GLOBALS['gJConfig']->charset = 'UTF-8'; 177 177 } 178 178 179 function testLineBreak(){ 180 $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')); 181 } 182 183 function testLineBreakWithMultiLineString(){ 184 $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')); 185 } 186 179 187 } 180 188 branches/1.0.x/testapp/modules/jelix_tests/tests/core.jlocale.html_cli.php
r915 r954 176 176 $GLOBALS['gJConfig']->charset = 'UTF-8'; 177 177 } 178 178 179 function testLineBreak(){ 180 $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')); 181 } 182 183 function testLineBreakWithMultiLineString(){ 184 $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')); 185 } 186 179 187 } 180 188 branches/1.0.x/testapp/modules/jelix_tests/tests/core.jlocale.html_cli.php
r915 r954 176 176 $GLOBALS['gJConfig']->charset = 'UTF-8'; 177 177 } 178 178 179 function testLineBreak(){ 180 $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')); 181 } 182 183 function testLineBreakWithMultiLineString(){ 184 $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')); 185 } 186 179 187 } 180 188 branches/1.0.x/testapp/modules/jelix_tests/tests/core.jlocale.html_cli.php
r915 r954 176 176 $GLOBALS['gJConfig']->charset = 'UTF-8'; 177 177 } 178 178 179 function testLineBreak(){ 180 $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')); 181 } 182 183 function testLineBreakWithMultiLineString(){ 184 $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')); 185 } 186 179 187 } 180 188
