[cl-l10n-devel] Localization

Levente Mészáros levente.meszaros at gmail.com
Thu Apr 20 19:34:28 UTC 2006


Hi,

I am using the attached localization mechanisms in my projects. Maybe it
could be included in cl-l10n if others say it's good enough.

The intentions are the following:
 - allow to define locale specific functions
 - do not require to write the current locale at the call site
 - allow to define individual versions for different languages at different
places
 - implicitly dispatch on locale
 - allow to pass parameters and return arbitrary types
 - fast access for constant strings

Any suggestions are welcomed!

usage:
(en-GB (one "one")
            (person-name (first-name last-name)
                (strcat first-name " " last-name)))

(hu-HU (one "egy")
             (person-name (first-name last-name)
                (strcat last-name " " first-name)))

(with-locale 'en-GB (one))
(with-locale 'hu-HU (person-name "Levente" "Mészáros"))

The following changes are also necessary: (cl-l10n.asd, package.lisp)

diff -r cl-l10n/cl-l10n.asd cl-l10ncvs/cl-l10n/cl-l10n.asd
26,28c26,27
<                (:file "i18n" :depends-on ("printers"))
<                (:file "localize" :depends-on ("locale")))
<   :depends-on (:cl-ppcre :cl-fad :split-sequence))
---
>                (:file "i18n" :depends-on ("printers")))
>   :depends-on (:cl-ppcre :cl-fad))
32a32
>
diff -r cl-l10n/package.lisp cl-l10ncvs/cl-l10n/package.lisp
6c6
<   (:use #:cl #:cl-ppcre #:cl-fad #:split-sequence)
---
>   (:use #:cl #:cl-ppcre #:cl-fad)
10c10
<            #:get-locale #:*locale* #:*locale-path* #:*locales*
---
>            #:*locale* #:*locale-path* #:*locales*
16,19c16,17
<            #:secondp #:am-pm #:zone #:parser-error
<            #:with-locale #:locale-for #:define-all-locales
#:lookup-resource
<            #:lookup-resource-with-fallback #:*fallback-locales* #:localize
<            #:missing-resource))
---
>            #:secondp #:am-pm #:zone #:parser-error))
>

--
There's no perfectoin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cl-l10n-devel/attachments/20060420/4e962081/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: localize.lisp
Type: application/octet-stream
Size: 3165 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-l10n-devel/attachments/20060420/4e962081/attachment.obj>


More information about the cl-l10n-devel mailing list