[cl-l10n-devel] i18n/normalize-locale-list question

Attila Lendvai attila.lendvai at gmail.com
Fri Aug 22 22:15:43 UTC 2008


hello,


> I'm in the arguably unfortunate situation of living in en_US.  Defining


heh :)


> resources in 'en' places them in en_GB (no complaints there).  My default
> *locale*, as loaded by get-default-locale, is the single en_US locale,
> preventing lookup-resource from finding them.
>
> Using the result of normalize-locale-list as *locale* fixes this, of course.
> Is it more appropriate to e.g.
>
>  (let ((*locale* (normalize-locale-list (ensure-list *locale*))))
>     (lookup-resource "hi-there" nil))
>
> everywhere i need to use *locale*, or would it make more sense for
> get-default-locale to be calling normalize-locale-list internally?


i've pushed a change that does your proposal and calls
normalize-locale-list from get-default-locale.

but all this is much better in the new branch in at
http://common-lisp.net/cgi-bin/darcsweb/darcsweb.cgi?r=cl-l10n-cl-l10n.cldr;a=summary

i've deleted n-l-l and lookup is smart enough to try the locales in
the appropriate order. there's en, en_GB, en_US, and both inherit from
en.

the new codebase has the potential to do much better things due to
having more info at hand from the cldr xml's and i've also cleaned up
the localization and resources part based on our past experiences.
unfortunately i've paused working on it because of other priorities
(currently our main project is hungarian only).

the major obstacle where i stopped is a compiler for the cldr
formatter syntax: it should compile things like "#,##0.00 ¤" into a
lambda that can format a number, date, etc. it's an interesting
weekend hacking... anybody? :)

also recently the new branch of local-time (
http://common-lisp.net/cgi-bin/darcsweb/darcsweb.cgi?r=local-time-local-time-1.0;a=summary
) has became much more developed. i've always wanted to integrate
cl-l10n with it and it's even more so today.

hope this gives you a better picture,

-- 
 attila


More information about the cl-l10n-devel mailing list