Next: Example Usage, Up: Localization [Contents][Index]
Enable recording of translatable strings.
Disablle recording of translatable strings.
&optional
locale ¶Sets the locale to the locale specified by locale. If
locale is not give or is nil
, the locale is determined by
look at the environment variables LANGUAGE
, LC_ALL
,
LC_MESSAGES
, or LANG
. If none of these are set, the
locale is unchanged.
The default locale is “C”.
Set the default domain to the domain specified by domain.
Typically, this only needs to be done at the top of each source
file. This is used to gettext
and ngettext
to set the
domain for the message string.
Look up the specified string, string, in the current message domain and return its translation.
Look up the specified string, string, in the message domain, domain. The translation is returned.
When compiled, this also function also records the string so that an
appropriate message template file can be created. (See
intl::dump-pot-files
.)
Look up the singular or plural form of a message in the default domain. The singular form is singular; the plural is plural. The number of items is specified by n in case the correct translation depends on the actual number of items.
Look up the singular or plural form of a message in the specified domain, domain. The singular form is singular; the plural is plural. The number of items is specified by n in case the correct translation depends on the actual number of items.
When compiled, this also function also records the singular and
plural forms so that an appropriate message template file can be
created. (See intl::dump-pot-files
.)
:copyright
:output-directory
¶Dumps the translatable strings recorded by dgettext
and
dngettext
. The message template file (pot file) is written
to a file in the directory specified by output-directory, and
the name of the file is the domain of the string.
If copyright is specified, this is placed in the output file as the copyright message.
This is a list of directory pathnames where the translations can be found.
&optional
(rt *readtable*) ¶Installs reader macros and comment reader into the specified readtable as explained below. The readtable defaults to *readtable*.
Two reader macros are also provided: _''
and _N''
. The
first is equivalent to wrapping dgettext
around the string.
The second returns the string, but also records the string. This is
needed when we want to record a docstring for translation or any other
string in a place where a macro or function call would be incorrect.
Also, the standard comment reader is extended to allow translator comments to be saved and written to the messages template file so that the translator may not need to look at the original source to understand the string. Any comment line that begins with exactly "TRANSLATORS: " is saved. This means each translator comment must be preceded by this string to be saved; the translator comment ends at the end of each line.
Next: Example Usage, Up: Localization [Contents][Index]