cl-l10n
cl-l10n is a localization library.

Homepage: http://common-lisp.net/project/cl-l10n

License: MIT

cl-l10n 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.

For a brief example look at this.

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.

Possibly evil features.

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).
Examples.
(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 dependant on the current locale, (but not on the phase of the moon).

Number and date/time parsing is also supported now (1 April 2005).

The current version is 0.3.
ASDF-install package (obsolete) http://common-lisp.net/project/cl-l10n/files/cl-l10n-latest.tgz


Topics: internationalization