[Sugar-devel] [PATCH](Clock) Fixing an instance (australian case) of http://bugs.sugarlabs.org/ticket/2944

Rafael Ortiz rafael at activitycentral.com
Fri May 11 00:42:50 EDT 2012


On Fri, May 11, 2012 at 1:19 AM, Chris Leonard <cjlhomeaddress at gmail.com>wrote:

> I do not like the idea of special casing en_au at all, the proper way
> to fix this is to get the i18n correct in the first place and not
> thrown in special cases.
>
> a) I thought that the Aussies were using the en_GB strings, which
> should have the dd/mm/yy format they are looking for, whcih it would
> if the string were not too difficult for localizers to figure out,
> both fo these strings are wrong and the comment is inadequate.
>
> en_GB
>
> http://translate.sugarlabs.org/en_GB/honey/clock.po?item=3&view_mode=translate
>
> en_US
>
> http://translate.sugarlabs.org/en_US/honey/clock.po?item=3&view_mode=translate
>
> Besides the fact that localizers have difficulty wi h the markup, we
> shouldn't be asking localizers for time and date format at all, this
> should come directly from glibc locale LC_TIME Date format (d_fmt)
> field
>
> which is
>
> %m/%d/%Y for en_US
>
> and
>
> %d/%m/%y for en_AU
>
> cjl
> Sugar Labs Translation Team Coordinator
>
>
>
>
Hi Gary and Chris

Thanks for the comments i agree with what both are saying, I had to do this
change in order to clock get the proper ordering here,
this is somewhat failing even thought the string is translated (en_GB)
variant.
still I need to investigate cjl's resources.


> On Thu, May 10, 2012 at 11:47 PM, Rafael Ortiz
> <rafael at activitycentral.com> wrote:
> > ---
> >  clock.py |   25 ++++++++++++++++++-------
> >  1 file changed, 18 insertions(+), 7 deletions(-)
> >
> > diff --git a/clock.py b/clock.py
> > index 1219aee..d368196 100755
> > --- a/clock.py
> > +++ b/clock.py
> > @@ -97,7 +97,7 @@ from timewriter import TimeWriter
> >
> >  import dbus
> >  import os
> > -
> > +import locale
> >  # The display modes of the clock
> >  _MODE_SIMPLE_CLOCK = 0
> >  _MODE_NICE_CLOCK = 1
> > @@ -133,12 +133,23 @@ class ClockActivity(activity.Activity):
> >         # font size as for the time display.  See
> >         # http://docs.python.org/lib/module-time.html for available
> >         # strftime formats.  xgettext:no-python-format
> > -        self._DATE_SHORT_FORMAT = _("Write Date",
> > -          '<markup><span lang="en" font_desc="Sans 20">' +
> > -          '<span foreground="#B20008">%A</span>, ' +
> > -          '<span foreground="#5E008C">%m</span>/' +
> > -          '<span foreground="#B20008">%d</span>/' +
> > -          '<span foreground="#9A5200">%Y</span></span></markup>')
> > +
> > +        loc = locale.getdefaultlocale()[0] or 'en_AU'
> > +        if loc == 'en_AU':
> > +                self._DATE_SHORT_FORMAT = _("Write Date",
> > +                   '<markup><span lang="en" font_desc="Sans 20">' +
> > +                   '<span foreground="#B20008">%A</span>,' +
> > +                   '<span foreground="#5E008C">%d</span>/' +
> > +                   '<span foreground="#B20008">%m</span>/' +
> > +                   '<span
> foreground="#9A5200">%Y</span></span></markup>')
> > +        else:
> > +                self._DATE_SHORT_FORMAT = _("Write Date",
> > +                   '<markup><span lang="en" font_desc="Sans 20">' +
> > +                   '<span foreground="#B20008">%A</span>, ' +
> > +                   '<span foreground="#5E008C">%m</span>/' +
> > +                   '<span foreground="#B20008">%d</span>/' +
> > +                   '<span
> foreground="#9A5200">%Y</span></span></markup>')
> > +
> >
> >         # Should we write the time in full letters?
> >         self._write_time = False
> > --
> > 1.7.9.5
> >
> > _______________________________________________
> > Sugar-devel mailing list
> > Sugar-devel at lists.sugarlabs.org
> > http://lists.sugarlabs.org/listinfo/sugar-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120511/c54853a7/attachment.html>


More information about the Sugar-devel mailing list