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

Gary Martin garycmartin at googlemail.com
Fri May 11 00:16:58 EDT 2012


Hi Rafael,

This is a fully translatable string and can just be changed in pootle – no need to change the source code :)

Regards,
--Gary

On 11 May 2012, at 04:47, Rafael Ortiz 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
> 



More information about the Sugar-devel mailing list