On quarta-feira, 10 de julho de 2013 19.09.32, Leonardo Giordani wrote:
> Ok, I can easily get the format string from KLocale::timeFormat().
> 
> I have however to assume the user splitted the elements with, say,
> semicolons.
> If the user formats the time as "h:HH - m:MM" (ok, it is fuzzy =) ) this
> does not work.

Well, you can assume that the hour is displayed only once, so you can search 
for the hour formatters. Don't look for delimiters, just look for anything 
that isn't the hour template.

If the hour is displayed more than once, declare the behaviour undefined.

> It is a pity that the locale database does not contain this information,
> since it would be the Right Place (TM) for it. ;)

Indeed, but it can get silly pretty quickly if you start to store more 
information, like "how to display the hour in the 1950s", "how to display the 
phase of the moon". The locale database has to contain relevant information, 
since it's already quite big today.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

Attachment: signature.asc
Description: This is a digitally signed message part.

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to