[cl-l10n-devel] cldr refactoring/experiment
Attila Lendvai
attila.lendvai at gmail.com
Thu Nov 6 23:37:40 UTC 2008
> i've created a branch at
>
> darcs get http://common-lisp.net/project/cl-l10n/darcs/cl-l10n.cldr/
dear list,
i'm happy to inform you that meanwhile we've switched our codebase to
this branch and it seems to serve us well.
until now the main obstacle was the lack of support for format
patterns defined by cldr, but we've created compilers for most of them
finally.
these compilers parse things like "yyyy. MMMM d." or "#,##0.###" and
emit lambdas that do the specified formatting. this is similar to how
cl-ppcre works: splitting up computation to a compile-time and
runtime, where compile-time really means to do parts of the
computation and return some lambda's that capturing this partial
result can produce the final result. so there's no cl:compile
involved...
you can try things like:
CL-L10N> (funcall (with-locale "hu"
(compile-date-pattern/gregorian-calendar "EEEE d
'foo' MMMM 'bar' yyyy"))
*standard-output*
(local-time:parse-timestring "2000-01-22"))
szombat 22 foo január bar 2000
NIL
i'm planning to merge this back into the official branch in a few
weeks, but please take a look and speak up if there's something on
your mind! especially you Sean, as you are the owner of the project...
i don't want to sound like the maintainer.
and while there's hardly any traffic here, there may also be some
users out there... :)
please note that this change is not 100% backwards compatible and
introduces extra dependencies (like cxml and local-time). but on the
other hand i think using the cldr xml's as the base for locale info
and local-time for time/date manipulation results in more up-to-date
and extensive locale support.
--
attila
More information about the cl-l10n-devel
mailing list