[CalendarServer-changes] [3232] CalendarServer/branches/users/sagen/localization-3218

source_changes at macosforge.org source_changes at macosforge.org
Fri Oct 24 16:42:29 PDT 2008


Revision: 3232
          http://trac.macosforge.org/projects/calendarserver/changeset/3232
Author:   sagen at apple.com
Date:     2008-10-24 16:42:29 -0700 (Fri, 24 Oct 2008)
Log Message:
-----------
Get localized strings as unicode

Modified Paths:
--------------
    CalendarServer/branches/users/sagen/localization-3218/locales/fr/LC_MESSAGES/calendarserver.mo
    CalendarServer/branches/users/sagen/localization-3218/locales/fr/LC_MESSAGES/calendarserver.po
    CalendarServer/branches/users/sagen/localization-3218/twistedcaldav/localization.py

Modified: CalendarServer/branches/users/sagen/localization-3218/locales/fr/LC_MESSAGES/calendarserver.mo
===================================================================
(Binary files differ)

Modified: CalendarServer/branches/users/sagen/localization-3218/locales/fr/LC_MESSAGES/calendarserver.po
===================================================================
--- CalendarServer/branches/users/sagen/localization-3218/locales/fr/LC_MESSAGES/calendarserver.po	2008-10-24 23:10:36 UTC (rev 3231)
+++ CalendarServer/branches/users/sagen/localization-3218/locales/fr/LC_MESSAGES/calendarserver.po	2008-10-24 23:42:29 UTC (rev 3232)
@@ -17,11 +17,11 @@
 
 #: localization.py:171
 msgid "All day"
-msgstr "toute la journée"
+msgstr "Toute la journée"
 
 #: localization.py:177
 msgid "%(startTime)s to %(endTime)s"
-msgstr "jusqu'à ce que"
+msgstr "%(startTime)s jusqu'à ce que %(endTime)s"
 
 #: localization.py:191
 msgid "%(dayName)s, %(monthName)s %(dayNumber)d, %(yearNumber)d"
@@ -33,7 +33,7 @@
 
 #: mail.py:726 mail.py:755 mail.py:792
 msgid "Event cancelled"
-msgstr "Événement annulé"
+msgstr "Événement annulé"
 
 #: mail.py:727
 msgid "Event invitation: %(summary)s"

Modified: CalendarServer/branches/users/sagen/localization-3218/twistedcaldav/localization.py
===================================================================
--- CalendarServer/branches/users/sagen/localization-3218/twistedcaldav/localization.py	2008-10-24 23:10:36 UTC (rev 3231)
+++ CalendarServer/branches/users/sagen/localization-3218/twistedcaldav/localization.py	2008-10-24 23:42:29 UTC (rev 3232)
@@ -114,7 +114,7 @@
             self.prev = caller_globals['_']
 
         # Rebind '_' to our translator
-        caller_globals['_'] = self.translation.gettext
+        caller_globals['_'] = self.translation.ugettext
 
         # What we return here is accessible to the caller via the 'as' clause
         return self
@@ -141,11 +141,16 @@
         3:30 PM PDT to 7:30 PM EDT
         """
 
+        # Bind to '_' so pygettext.py will pick this up for translation
+        _ = self.translation.ugettext
+
+        tzStart = tzEnd = None
         dtStart = component.propertyNativeValue("DTSTART")
         if isinstance(dtStart, datetime.datetime):
             tzStart = dtStart.tzname()
         else:
-            tzStart = None
+            return _("All day")
+
         # tzStart = component.getProperty("DTSTART").params().get("TZID", "UTC")
 
         dtEnd = component.propertyNativeValue("DTEND")
@@ -168,9 +173,6 @@
                     dtEnd.hour = dtEnd.minute = dtEnd.second = 0
                     duration = dtEnd - dtStart
 
-        if dtEnd is None:
-            return _("All day")
-
         if dtStart == dtEnd:
             return self.dtTime(dtStart)
 
@@ -186,7 +188,7 @@
 
     def dtDate(self, val):
         # Bind to '_' so pygettext.py will pick this up for translation
-        _ = self.translation.gettext
+        _ = self.translation.ugettext
 
         return (
             _("%(dayName)s, %(monthName)s %(dayNumber)d, %(yearNumber)d")
@@ -203,7 +205,7 @@
             return None
 
         # Bind to '_' so pygettext.py will pick this up for translation
-        _ = self.translation.gettext
+        _ = self.translation.ugettext
 
         ampm = _("AM") if val.hour < 12 else _("PM")
         hour12 = val.hour % 12
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20081024/87ff2ffb/attachment.html>


More information about the calendarserver-changes mailing list