31.4. Internationalization of CLISP

31.4.1. The Language

Glossary

Internationalization (i18n)
preparing a program so that it can use multiple national languages and national cultural conventions without requiring further source code changes.
Localization (l10n)
providing the data - mostly textual translations - necessary for an internationalized program to work in a particular language and with particular cultural conventions.

CLISP is internationalized, and is localized for the languages English, German, French, Spanish, Dutch, Russian, and Danish. CLISP also supports internationalized Lisp programs, through GNU gettext, see Section 33.3, “Internationalization of User Programs”.

31.4.1. The Language

Warning

The facilities described in this section will work only for the languages for which CLISP itself is already localized.

The language CLISP uses to communicate with the user can be one of

ENGLISH
DEUTSCH (i.e., German)
FRANÇAIS (i.e., French)
ESPAÑOL (i.e., Spanish)
NEDERLANDS (i.e., Dutch)
РУССКИЙ (i.e. Russian)
DANSK (i.e., Danish)

This is controlled by the SYMBOL-MACRO CUSTOM:*CURRENT-LANGUAGE*, which can be set at run time as well as using the -L command line option. If you wish to change the locale directory at run time too, you can do that by setting CUSTOM:*CURRENT-LANGUAGE* to a CONS cell, whose CAR is the language (a SYMBOL, one of the above), and whose CDR is the new locale directory.

More languages can be defined through the macro I18N:DEFLANGUAGE: (I18N:DEFLANGUAGE language). For such an additional language to take effect, you must install the corresponding message catalog, or translate the messages yourself, using GNU gettext and Emacs po-mode.

This works only for strings. For arbitrary language-dependent Lisp objects, you define one through the macro I18N:DEFINTERNATIONAL: (I18N:DEFINTERNATIONAL symbol &OPTIONAL (default-language T)) and add language-dependent values through the macro I18N:DEFLOCALIZED: (I18N:DEFLOCALIZED symbol language value-form) (One such form for each language. Languages without an assigned value will be treated like the default-language.) You can then access the localized value by calling I18N:LOCALIZED: (I18N:LOCALIZED symbol &OPTIONAL language)


These notes document CLISP version 2.49.93+Last modified: 2018-02-19