[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
18.1 @documentlanguage ll[_cc]
: Set the Document Language
The @documentlanguage
command declares the current document
locale. Write it on a line by itself, near the beginning of the
file, but after @setfilename
(see section @setfilename
):
@documentlanguage ll[_cc] |
Include a two-letter ISO 639-2 language code (ll) following
the command name, optionally followed by an underscore and two-letter
ISO 3166 two-letter country code (cc). If you have a
multilingual document, the intent is to be able to use this command
multiple times, to declare each language change. If the command is
not used at all, the default is en_US
for US English.
As with GNU Gettext (see (gettext)Top section `Top' in Gettext), if the country
code is omitted, the main dialect is assumed where possible. For
example, de
is equivalent to de_DE
(German as spoken in
Germany).
For Info and other online output, this command changes the translation of various document strings such as “see” in cross-references (see section Cross References), “Function' in defuns (see section Definition Commands), and so on. Some strings, such as “Node:”, “Next:”, “Menu:”, etc., are keywords in Info output, so are not translated there; they are translated in other output formats.
For TeX, this command causes a file ‘txi-locale.tex’ to
be read (if it exists). If @setdocumentlanguage
argument
contains the optional ‘_cc’ suffix, this is tried first.
For example, with @setdocumentlanguage de_DE
, TeX first
looks for ‘txi-de_DE.tex’, then ‘txi-de.tex’.
Such a ‘txi-*’ file is intended to redefine the various English words used in TeX output, such as `Chapter', `See', and so on. We are aware that individual words like these cannot always be translated in isolation, and that a very different strategy would be required for ideographic (among other) scripts. Help in improving Texinfo's language support is welcome.
It would also be desirable for this command to also change TeX's
ideas of the current hyphenation patterns (via the TeX primitive
\language
), but this is unfortunately not currently
implemented.
In September 2006, the W3C Internationalization Activity released a new recommendation for specifying languages: http://www.rfc-editor.org/rfc/bcp/bcp47.txt. When Gettext supports this new scheme, Texinfo will too.
Since the lists of language codes and country codes are updated relatively frequently, we don't attempt to list them here. The valid language codes are on the official home page for ISO 639, http://www.loc.gov/standards/iso639-2/. The country codes and the official web site for ISO 3166 can be found via http://en.wikipedia.org/wiki/ISO_3166.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |