Re: Gettext support for Common Lisp

From: Thomas Schilling (tjs_ng_at_yahoo.de)
Date: 08/31/04


Date: Tue, 31 Aug 2004 00:55:37 +0200

Bruno Haible <bruno@clisp.org> wrote:

> The only Common Lisp implementation so far that provides the run-time
> support (for loading GNU .mo files, in particular) is GNU clisp. Its
> API is described in
> http://clisp.cons.org/impnotes/i18n.html#ggettext

 From here the above site:

     or ease of reading, it is customary to define an abbreviation for
     the I18N:GETTEXT function. An underscore is customary.

     Example 29.3. prog.lisp

     (setf (textdomaindir "prog") "./")
     (defun _ (msgid) (gettext msgid "prog"))

     (setq n (parse-integer (first EXT:*ARGS*)))

     (format t "~A~%"
           (_"'Your command, please?', asked the waiter."))

How about a reader macro? Eg. #I"..." that will automagically create the
entry for the translation catalogue and will replace the call with the
appropriate gettext-like function. (Are msgids always strings, BTW?)

BTW: Is there any further internationalisations support for CL (eg. date
parsing and writing, numbers, currencies)?

-ts

-- 
      ,,
     \../   /  <<< The LISP Effect
    |_\\ _==__
__ | |bb|   | _________________________________________________


Relevant Pages