Re: [Evolution] Locale-dependent features



On Sat, Feb 10, 2001 at 05:37:29PM +0000, Damon Chaplin wrote:
I can't see a way of determining which format is preferred in the
current locale. In strftime() I think you have to choose explicitly
 - even with a LANG of en_US it uses 24-hour format for the preferred
time format "%X", when the preferred format is really 12-hour.
If we could figure this out then we could use it as the default setting.

Right. localeconv(1) allows you to fetch LOCALE-specific glibc settings
for your current LOCALE, including t_fmt, the time formatting string in
strftime() format. In 12-hour countries, it'll contain either "%i",
"%l" or "%r", while in 24-hour countries, it'll contain either "%H",
"%k", "%R" or "%T";

For example, /usr/share/i18n/locales/he_IL contains "%H:%M:%S" in
t_fmt (in a Unicode form), while en_US contains "%r" (which is a
12-hour time, according to strftime).

But we'd still need a preference setting as in some places it is more
of a personal choice.

True, but we could figure out the default automagically.

-- 
Best regards,
Ilya Konstantinov




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]