Re: locale support?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Ok, locale support now works on Windows and Linux. Please see my problem at the
end of this message.

include locale.e as l
include datetime.e as d
 
d:datetime now
now = d:now()
 
l:set("en_US")
printf(1, "%s, %s, %s\n", {
    l:datetime("%A, %B  %d %Y", now),
    l:money(10928.2),
    l:number(1029.35)})


Output is:

Sunday, May 4 2008, $10,928.20, 1,029.35
 
You can set any locale and the date language will change, the currency symbol,
the thousands and decimal point, etc... The best part is it uses OS dependent
locale data so we do not have to manage locale data, have to do no translations,
and Euphoria can now be set for any locale that a user happens to have installed.

========
Problem
========

Locale names are different on Linux and Windows. For instance, to get the locale
for United States English, on Windows you must:

l:set("English_United States")


however, under Linux you must:

l:set("en_US")


Creating a cross-walk may not be that easy but if we have to, it's still easier
than translating hundreds of locales to pure Euphoria.

So. Any suggestions/thoughts? 

--
Jeremy Cowgar
http://jeremy.cowgar.com

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu