[limb-svn] r5848 - in 3.x/trunk/limb/i18n: i18n/locale src/datetime src/template/tags/i18n tests/cases tests/cases/datetime tests/cases/locale

svn at limb-project.com svn at limb-project.com
Wed May 9 16:32:31 MSD 2007


Author: pachanga
Date: 2007-05-09 16:32:31 +0400 (Wed, 09 May 2007)
New Revision: 5848
URL: http://fisheye.limb-project.com/changelog/limb/?cs=5848

Added:
   3.x/trunk/limb/i18n/src/template/tags/i18n/i18n.filter.php
Removed:
   3.x/trunk/limb/i18n/src/template/tags/i18n/string.filter.php
Modified:
   3.x/trunk/limb/i18n/i18n/locale/en_US.ini
   3.x/trunk/limb/i18n/i18n/locale/ru_RU.ini
   3.x/trunk/limb/i18n/src/datetime/lmbLocaleDate.class.php
   3.x/trunk/limb/i18n/tests/cases/datetime/lmbLocaleDateFormatTest.class.php
   3.x/trunk/limb/i18n/tests/cases/en.ini
   3.x/trunk/limb/i18n/tests/cases/locale/lmbLocaleTest.class.php
   3.x/trunk/limb/i18n/tests/cases/ru.ini
Log:
-- string.filter.php renamed to i18n.filter.php
-- locale files have Sunday as a first day of a week(lmbDate :: getDayOfWeek() returns zero based index, where Sunday is at zero index). 

Modified: 3.x/trunk/limb/i18n/i18n/locale/en_US.ini
===================================================================
--- 3.x/trunk/limb/i18n/i18n/locale/en_US.ini	2007-05-09 12:29:32 UTC (rev 5847)
+++ 3.x/trunk/limb/i18n/i18n/locale/en_US.ini	2007-05-09 12:32:31 UTC (rev 5848)
@@ -68,19 +68,19 @@
 11 = December
 
 [short_day_names]
-0 = Mon
-1 = Tue
-2 = Wed
-3 = Thu
-4 = Fri
-5 = Sat
-6 = Sun
+0 = Sun
+1 = Mon
+2 = Tue
+3 = Wed
+4 = Thu
+5 = Fri
+6 = Sat
 
 [long_day_names]
-0 = Monday
-1 = Tuesday
-2 = Wednesday
-3 = Thursday
-4 = Friday
-5 = Saturday
-6 = Sunday
\ No newline at end of file
+0 = Sunday
+1 = Monday
+2 = Tuesday
+3 = Wednesday
+4 = Thursday
+5 = Friday
+6 = Saturday
\ No newline at end of file

Modified: 3.x/trunk/limb/i18n/i18n/locale/ru_RU.ini
===================================================================
--- 3.x/trunk/limb/i18n/i18n/locale/ru_RU.ini	2007-05-09 12:29:32 UTC (rev 5847)
+++ 3.x/trunk/limb/i18n/i18n/locale/ru_RU.ini	2007-05-09 12:32:31 UTC (rev 5848)
@@ -68,19 +68,19 @@
 11 = Декабрь
 
 [short_day_names]
-0 = Пн
-1 = Вт
-2 = Ср
-3 = Чт
-4 = Пн
-5 = Сб
-6 = Вс
+0 = Вс
+1 = Пн
+2 = Вт
+3 = Ср
+4 = Чт
+5 = Пн
+6 = Сб
 
 [long_day_names]
-0 = Понедельник
-1 = Вторник
-2 = Среда
-3 = Четверг
-4 = Пятница
-5 = Суббота
-6 = Воскресенье
\ No newline at end of file
+0 = Воскресенье
+1 = Понедельник
+2 = Вторник
+3 = Среда
+4 = Четверг
+5 = Пятница
+6 = Суббота
\ No newline at end of file

Modified: 3.x/trunk/limb/i18n/src/datetime/lmbLocaleDate.class.php
===================================================================
--- 3.x/trunk/limb/i18n/src/datetime/lmbLocaleDate.class.php	2007-05-09 12:29:32 UTC (rev 5847)
+++ 3.x/trunk/limb/i18n/src/datetime/lmbLocaleDate.class.php	2007-05-09 12:32:31 UTC (rev 5848)
@@ -336,7 +336,7 @@
       $format = $locale->getShortDateFormat();
 
     $arr = self :: parseTimeString($locale, $string, $format);
-    return new lmbDate($arr['hour'], $arr['minute'], $arr['second'], $arr['day'], $arr['month'], $arr['year']);
+    return new lmbDate($arr['year'], $arr['month'], $arr['day'], $arr['hour'], $arr['minute'], $arr['second']);
   }
 
   static function isLocalStringValid($locale, $string, $format = null)

Copied: 3.x/trunk/limb/i18n/src/template/tags/i18n/i18n.filter.php (from rev 5845, 3.x/trunk/limb/i18n/src/template/tags/i18n/string.filter.php)
===================================================================
--- 3.x/trunk/limb/i18n/src/template/tags/i18n/i18n.filter.php	                        (rev 0)
+++ 3.x/trunk/limb/i18n/src/template/tags/i18n/i18n.filter.php	2007-05-09 12:32:31 UTC (rev 5848)
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Limb Web Application Framework
+ *
+ * @link http://limb-project.com
+ *
+ * @copyright  Copyright &copy; 2004-2007 BIT
+ * @license    LGPL http://www.gnu.org/copyleft/lesser.html
+ * @version    $Id$
+ * @package    i18n
+ */
+/**
+* @filter i18n
+* @min_attributes 1
+* @max_attributes 100
+*/
+class lmbI18NStringFilter extends WactCompilerFilter
+{
+  function getValue()
+  {
+    if(!isset($this->parameters[0]) || !$this->parameters[0]->getValue())
+      throw new WactException('MISSING_FILTER_PARAMETER');
+    else
+      $domain = $this->parameters[0]->getValue();
+
+    $value = $this->base->getValue();
+
+    if($this->isConstant())
+      return lmb_i18n($value, $this->_getAttributes(), $domain);
+    else
+      $this->raiseUnresolvedBindingError();
+  }
+
+  function _getAttributes()
+  {
+    $result = array();
+
+    for($i=1; $i < sizeof($this->parameters); $i+=2)
+    {
+      $var = $this->parameters[$i]->getValue();
+      $value = $this->parameters[$i+1]->getValue();
+      $result[$var] = $value;
+    }
+
+    return $result;
+  }
+
+  function generateExpression($code)
+  {
+    throw new lmbException('DBE mode is not supported in i18n filter');
+  }
+}
+
+?>
\ No newline at end of file

Deleted: 3.x/trunk/limb/i18n/src/template/tags/i18n/string.filter.php
===================================================================
--- 3.x/trunk/limb/i18n/src/template/tags/i18n/string.filter.php	2007-05-09 12:29:32 UTC (rev 5847)
+++ 3.x/trunk/limb/i18n/src/template/tags/i18n/string.filter.php	2007-05-09 12:32:31 UTC (rev 5848)
@@ -1,54 +0,0 @@
-<?php
-/**
- * Limb Web Application Framework
- *
- * @link http://limb-project.com
- *
- * @copyright  Copyright &copy; 2004-2007 BIT
- * @license    LGPL http://www.gnu.org/copyleft/lesser.html
- * @version    $Id$
- * @package    i18n
- */
-/**
-* @filter i18n
-* @min_attributes 1
-* @max_attributes 100
-*/
-class lmbI18NStringFilter extends WactCompilerFilter
-{
-  function getValue()
-  {
-    if(!isset($this->parameters[0]) || !$this->parameters[0]->getValue())
-      throw new WactException('MISSING_FILTER_PARAMETER');
-    else
-      $domain = $this->parameters[0]->getValue();
-
-    $value = $this->base->getValue();
-
-    if($this->isConstant())
-      return lmb_i18n($value, $this->_getAttributes(), $domain);
-    else
-      $this->raiseUnresolvedBindingError();
-  }
-
-  function _getAttributes()
-  {
-    $result = array();
-
-    for($i=1; $i < sizeof($this->parameters); $i+=2)
-    {
-      $var = $this->parameters[$i]->getValue();
-      $value = $this->parameters[$i+1]->getValue();
-      $result[$var] = $value;
-    }
-
-    return $result;
-  }
-
-  function generateExpression($code)
-  {
-    throw new lmbException('DBE mode is not supported in i18n filter');
-  }
-}
-
-?>
\ No newline at end of file

Modified: 3.x/trunk/limb/i18n/tests/cases/datetime/lmbLocaleDateFormatTest.class.php
===================================================================
--- 3.x/trunk/limb/i18n/tests/cases/datetime/lmbLocaleDateFormatTest.class.php	2007-05-09 12:29:32 UTC (rev 5847)
+++ 3.x/trunk/limb/i18n/tests/cases/datetime/lmbLocaleDateFormatTest.class.php	2007-05-09 12:32:31 UTC (rev 5848)
@@ -19,7 +19,7 @@
     $date = new lmbLocaleDate('2005-01-02 23:05:03');
     $string = $date->localeStrftime('%C %d %D %e %E %H %I %j %m %M %n %R %S %U %y %Y %t %%');
 
-    $this->assertEqual($string, "20 02 01/02/05 2 2453373 23 11 002 01 05 \n 23:05 03 53 05 2005 \t %");
+    $this->assertEqual($string, "20 02 01/02/05 2 2453373 23 11 002 01 05 \n 23:05 03 1 05 2005 \t %");
   }
 
   function testLocalizedFormat()

Modified: 3.x/trunk/limb/i18n/tests/cases/en.ini
===================================================================
--- 3.x/trunk/limb/i18n/tests/cases/en.ini	2007-05-09 12:29:32 UTC (rev 5847)
+++ 3.x/trunk/limb/i18n/tests/cases/en.ini	2007-05-09 12:32:31 UTC (rev 5848)
@@ -67,19 +67,19 @@
 11 = December
 
 [short_day_names]
-0 = Mon
-1 = Tue
-2 = Wed
-3 = Thu
-4 = Fri
-5 = Sat
-6 = Sun
+0 = Sun
+1 = Mon
+2 = Tue
+3 = Wed
+4 = Thu
+5 = Fri
+6 = Sat
 
 [long_day_names]
-0 = Monday
-1 = Tuesday
-2 = Wednesday
-3 = Thursday
-4 = Friday
-5 = Saturday
-6 = Sunday
\ No newline at end of file
+0 = Sunday
+1 = Monday
+2 = Tuesday
+3 = Wednesday
+4 = Thursday
+5 = Friday
+6 = Saturday
\ No newline at end of file

Modified: 3.x/trunk/limb/i18n/tests/cases/locale/lmbLocaleTest.class.php
===================================================================
--- 3.x/trunk/limb/i18n/tests/cases/locale/lmbLocaleTest.class.php	2007-05-09 12:29:32 UTC (rev 5847)
+++ 3.x/trunk/limb/i18n/tests/cases/locale/lmbLocaleTest.class.php	2007-05-09 12:32:31 UTC (rev 5848)
@@ -34,10 +34,10 @@
   {
     $locale = new lmbLocale('en', new lmbIni(dirname(__FILE__) . '/../en.ini'));
 
-    $this->assertEqual($locale->getDayName(0, $short = false), 'Monday');
-    $this->assertEqual($locale->getDayName(0, $short = true), 'Mon');
-    $this->assertEqual($locale->getDayName(6, $short = false), 'Sunday');
-    $this->assertEqual($locale->getDayName(6, $short = true), 'Sun');
+    $this->assertEqual($locale->getDayName(0, $short = false), 'Sunday');
+    $this->assertEqual($locale->getDayName(0, $short = true), 'Sun');
+    $this->assertEqual($locale->getDayName(6, $short = false), 'Saturday');
+    $this->assertEqual($locale->getDayName(6, $short = true), 'Sat');
   }
 
   function testGetOtherOptions()
@@ -92,21 +92,21 @@
     $this->assertFalse($locale->isMondayFirst());
     $this->assertEqual($locale->getWeekDays(), array(0, 1, 2, 3, 4, 5, 6));
     $this->assertEqual($locale->getMonths(), array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11));
-    $this->assertEqual($locale->getWeekDayNames(), array('Monday',
+    $this->assertEqual($locale->getWeekDayNames(), array('Sunday',
+                                                         'Monday',
                                                          'Tuesday',
                                                          'Wednesday',
                                                          'Thursday',
                                                          'Friday',
-                                                         'Saturday',
-                                                         'Sunday'));
+                                                         'Saturday'));
 
-    $this->assertEqual($locale->getWeekDayNames($short = true), array('Mon',
+    $this->assertEqual($locale->getWeekDayNames($short = true), array('Sun',
+                                                                      'Mon',
                                                                       'Tue',
                                                                       'Wed',
                                                                       'Thu',
                                                                       'Fri',
-                                                                      'Sat',
-                                                                      'Sun'));
+                                                                      'Sat'));
 
     $this->assertEqual($locale->getMonthNames(), array('January',
                                                        'February',

Modified: 3.x/trunk/limb/i18n/tests/cases/ru.ini
===================================================================
--- 3.x/trunk/limb/i18n/tests/cases/ru.ini	2007-05-09 12:29:32 UTC (rev 5847)
+++ 3.x/trunk/limb/i18n/tests/cases/ru.ini	2007-05-09 12:32:31 UTC (rev 5848)
@@ -68,19 +68,19 @@
 11 = Декабрь
 
 [short_day_names]
-0 = Пн
-1 = Вт
-2 = Ср
-3 = Чт
-4 = Пн
-5 = Сб
-6 = Вс
+0 = Вс
+1 = Пн
+2 = Вт
+3 = Ср
+4 = Чт
+5 = Пн
+6 = Сб
 
 [long_day_names]
-0 = Понедельник
-1 = Вторник
-2 = Среда
-3 = Четверг
-4 = Пятница
-5 = Суббота
-6 = Воскресенье
\ No newline at end of file
+0 = Воскресенье
+1 = Понедельник
+2 = Вторник
+3 = Среда
+4 = Четверг
+5 = Пятница
+6 = Суббота
\ No newline at end of file



More information about the limb-svn mailing list