apple / ccs-calendarserver

The Calendar and Contacts Server.
https://www.calendarserver.org
Apache License 2.0
486 stars 136 forks source link

[PATCH] fix some gettext issues #319

Closed macosforgebot closed 12 years ago

macosforgebot commented 13 years ago

mail@… originally submitted this as ticket:411


Running gettext one got the following output:

fm@thinkpad:~/CalendarServer # pygettext.py twistedcaldav/localization.py twistedcaldav/mail.py 
*** twistedcaldav/localization.py:225: Seen unexpected token "daysFull"
*** twistedcaldav/localization.py:226: Seen unexpected token "monthsFull"
*** twistedcaldav/localization.py:250: Seen unexpected token "ampm"
*** twistedcaldav/localization.py:269: Seen unexpected token "%"

The first three are doubled as far as i can see and the last one is a real bug.

Attached patch fixes it.

macosforgebot commented 13 years ago

mail@… originally submitted this as attachment:calendarserver-localization.py.patch:⁠ticket:411


correct issue with patch

macosforgebot commented 13 years ago

mail@… originally submitted this as comment:1:⁠ticket:411


The first part of my patch was wrong as _ is not bound to gettext the first time and therefore the values are not translated twice...

macosforgebot commented 13 years ago

@wsanchez originally submitted this as comment:2:⁠ticket:411

macosforgebot commented 12 years ago

@m0rgen originally submitted this as comment:3:⁠ticket:411


Thanks for the patch -- I just applied it and added more tests. I'm not exactly sure why the daysFull token is causing a problem, but I am using xgettext now instead of pygettext.py