Re: [Tails-dev] Tails Clock v0.3 - Update

Delete this message

Reply to this message
Autor: Kevin C. Krinke
Data:  
A: tails-dev
Assumpte: Re: [Tails-dev] Tails Clock v0.3 - Update


On 2013-11-01 10:17 AM, Kevin C. Krinke wrote:
>> I saw the following problems:
>>  - Seconds are showing by default, eg "10.25.47".
>>    The checkbox "Display seconds?" is not ticked however.
>>  - The clock is not updated, it keeps displaying "10.25.47"
>>    for a whole minute. Unless I tick the box "Display seconds?"
>>  - Unticking the box again does not remove the seconds,
>>    but stops the clock updating again.


The root of the problem here is the locale-dependent strftime string.
Typically these are in the form of "%a %b %e %H:%M:%S" or something
along those lines.

In trying to determine the best path for supporting as many locales as
programmatically possible I've originally opted to retrieve the string
from python's locale module and add/remove substitution variables as
needed for the configurations to be met. This has proven impractical.

As a research test, I generated all the locales on my Debian box and
printed out what the D_T_FMT strings would result in for each locale...
and the result is that there's a wide array of variability. Some locales
don't have AM/PM at all, some default with seconds, others don't and
some have interesting long-form representations of the time (ie: not
separated by . or : but with words).

Programmatically supporting this is impractical which led me to examine
the source code for the official GNOME panel clock applet. Basically,
they support the formats via translation strings.

I will now head down the path of supporting the date/time formats via
translation strings. As a bonus, I'll follow the same design pattern as
the GNOME clock applet and we can "borrow" the translation strings from
them (both projects being GPL, I don't believe this should be an issue,
please correct me if I'm wrong).


Feedback?


Cheers!

--
Kevin C. Krinke <kevin@???>
GnuPG - 851662D2 - 0x18C67F61851662D2
http://kevin.c.krinke.ca/851662D2.asc