This module implements the message localization mechanism defined in SRFI-29.
In fact, this module consists of two submodules,
srfi-29 extends both submodules.
It is because srfi-29’s definition of the
procedure is incompatible to Gauche’s native
(thus Common Lisp’s
format) in the handling of
So I splitted the module into two,
which contains srfi-29’s
which contains the rest ("bundle" API).
If a program wishes a complete compatibility of
srfi-29 module, which overrides
format. If a program just wants
srfi-29’s "bundle" API, but wants to keep Gauche’s
A localization feature is also provided by
(see Localized messages),
which is a preferable way of message localization in Gauche.
This module is provided mainly for porting code that uses
A bundle specifier is an arbitrary list of symbols, but typically it takes the form like:
(package language country details …)
Where package specifies the software package, language and country specifies language and country code, and details gives other informations like encoding.
The values for the default bundle specifier can be obtained by the following parameters.
keep the ISO 639-1 language code and ISO 3166-1 country code
respectively, both as symbols.
current-locale-details keeps a list of auxiliary
local informations, such as encodings.
These parameters are initialized if
variable is set in the form of
For example, if the
LANG setting is
those parameters are
C or undefined,
the default values are
[SRFI-29] Put the association list of template key (symbol) and the locale-specific message (string) into the bundle database, with bundle-specifier as the key.
Gauche currently supports only in-memory bundle database.
That is, you have to call
declare-bundle! within the application
in order to lookup the localized messages.
Since Gauche doesn’t support persistent bundle database yet,
these procedures does nothing and returns
(It is still conforming behavior of srfi-29).
[SRFI-29] Retrieves localized message, associated with a symbol message-template-name in the package package-name.
SRFI-29 extends SRFI-28’s
format procedure spec
in order to support argument repositioning.
~N@*, where N is an integer or can be omitted,
causes the next directive to retrieve a value from N-th
optional argument. The referenced value isn’t consumed,
and won’t affect the processing of subsequent directives.
Although SRFI-28 spec is compatible to
format (see Output),
this SRFI-29 extention isn’t.
~N@* directive of Gauche’s
changes the argument pointer to points N-th optional argument,
thus it affects all the subsequent arguments.
Because of this incompatibility, this function is defined in
a separate module,
srfi-29.format. If you use
format procedure will be overridden by srfi-29’s
in your module. If you want to keep Gauche’s native