cl-l10n is a portable library for handling program localization. The project home
is at common-lisp.net
It currently supports locale specific printing of numbers, monetary values and dates/times, as well as provides support for string localization through a gettext-like mechanism.
It currently runs on SBCL, ECL, ACL, CMUCL, CLISP, and Lispworks although porting to new implementations should simply be a matter of defining a new getenv function.
Depends on: uiop, alexandria, iterate, cl-ppcre, bind, cl-fad, flexi-streams, cxml, local-time, closer-mop
License: BSD 3-Clause
Possibly evil features.
Beware of the misguiding documentation - in current (i.e. 0.4) version - i18n API as described in documentation doesn't match the source code at all.
FORMAT and FORMATTER are unexported symbols in the cl-l10n package.
SHADOWING-IMPORTing them it will give you 3 new format directives.
- ~N: For printing numbers.
- ~M: For formatting monetary values.
- ~U: For dates and times (universal time).
(format nil "~v,,vU" "en_ZA" 0 3321593252)
=> "Mon 04 Apr 2005 08:47:32 +0000" (format nil "~vN" "en_ZA" 19932.399)
=> "19,932.399" (format nil "~vM" "sv_SE" 19932.399)
=> "19 932,40 kr"
(I've found these to be a lot easier to use than ~/cl-l10n:format-?/ calls)
NB: All output from these directives are dependent on the current
locale (but not on the phase of the moon).
Number and date/time parsing is also supported now (1 April 2005).