Author: fabien
Date: 2010-05-24 08:00:11 +0200 (Mon, 24 May 2010)
New Revision: 29597

Removed:
   branches/1.3/test/unit/helper/I18NHelperTest.php
Modified:
   branches/1.3/lib/helper/I18NHelper.php
   branches/1.4/lib/helper/I18NHelper.php
   branches/1.4/test/unit/helper/I18NHelperTest.php
Log:
[1.3, 1.4] reverted r29522 (refs #8643)

Modified: branches/1.3/lib/helper/I18NHelper.php
===================================================================
--- branches/1.3/lib/helper/I18NHelper.php      2010-05-23 22:21:30 UTC (rev 
29596)
+++ branches/1.3/lib/helper/I18NHelper.php      2010-05-24 06:00:11 UTC (rev 
29597)
@@ -45,13 +45,18 @@
 
 function format_number_choice($text, $args = array(), $number, $catalogue = 
'messages')
 {
+  $translated = __($text, $args, $catalogue);
+
   $choice = new sfChoiceFormat();
-  if (false === $retval = $choice->format($text, $number))
+
+  $retval = $choice->format($translated, $number);
+
+  if ($retval === false)
   {
     throw new sfException(sprintf('Unable to parse your choice "%s".', 
$translated));
   }
 
-  return __($retval, $args, $catalogue);
+  return $retval;
 }
 
 function format_country($country_iso, $culture = null)

Deleted: branches/1.3/test/unit/helper/I18NHelperTest.php
===================================================================
--- branches/1.3/test/unit/helper/I18NHelperTest.php    2010-05-23 22:21:30 UTC 
(rev 29596)
+++ branches/1.3/test/unit/helper/I18NHelperTest.php    2010-05-24 06:00:11 UTC 
(rev 29597)
@@ -1,19 +0,0 @@
-<?php
-
-/*
- * This file is part of the symfony package.
- * (c) Fabien Potencier <[email protected]>
- * 
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-require_once(dirname(__FILE__).'/../../bootstrap/unit.php');
-require_once(dirname(__FILE__).'/../../../lib/helper/I18NHelper.php');
-
-$t = new lime_test(2);
-
-// format_number_choice()
-$t->diag('format_number_choice()');
-$t->is(format_number_choice('[1]1|(1,+Inf]%foo%', array('%foo%' => '(1)'), 1), 
'1', 'format_number_choice() format a string containing plural information');
-$t->is(format_number_choice('[1]1|(1,+Inf]%foo%', array('%foo%' => '(1)'), 2), 
'(1)', 'format_number_choice() format a string containing plural information');

Modified: branches/1.4/lib/helper/I18NHelper.php
===================================================================
--- branches/1.4/lib/helper/I18NHelper.php      2010-05-23 22:21:30 UTC (rev 
29596)
+++ branches/1.4/lib/helper/I18NHelper.php      2010-05-24 06:00:11 UTC (rev 
29597)
@@ -45,13 +45,18 @@
 
 function format_number_choice($text, $args = array(), $number, $catalogue = 
'messages')
 {
+  $translated = __($text, $args, $catalogue);
+
   $choice = new sfChoiceFormat();
-  if (false === $retval = $choice->format($text, $number))
+
+  $retval = $choice->format($translated, $number);
+
+  if ($retval === false)
   {
     throw new sfException(sprintf('Unable to parse your choice "%s".', 
$translated));
   }
 
-  return __($retval, $args, $catalogue);
+  return $retval;
 }
 
 function format_country($country_iso, $culture = null)

Modified: branches/1.4/test/unit/helper/I18NHelperTest.php
===================================================================
--- branches/1.4/test/unit/helper/I18NHelperTest.php    2010-05-23 22:21:30 UTC 
(rev 29596)
+++ branches/1.4/test/unit/helper/I18NHelperTest.php    2010-05-24 06:00:11 UTC 
(rev 29597)
@@ -1,19 +0,0 @@
-<?php
-
-/*
- * This file is part of the symfony package.
- * (c) Fabien Potencier <[email protected]>
- * 
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-require_once(dirname(__FILE__).'/../../bootstrap/unit.php');
-require_once(dirname(__FILE__).'/../../../lib/helper/I18NHelper.php');
-
-$t = new lime_test(2);
-
-// format_number_choice()
-$t->diag('format_number_choice()');
-$t->is(format_number_choice('[1]1|(1,+Inf]%foo%', array('%foo%' => '(1)'), 1), 
'1', 'format_number_choice() format a string containing plural information');
-$t->is(format_number_choice('[1]1|(1,+Inf]%foo%', array('%foo%' => '(1)'), 2), 
'(1)', 'format_number_choice() format a string containing plural information');

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to