39.1.6 Understanding how language templates are organized

Your DITA2Go distribution includes the language configuration templates and files listed in Table 39-8. The top-level DITA2Go general configuration template, d2g_config.ini, references the editable English language configuration file: local_d2g_lang_en.ini:

[Templates]
Languages = %OMSYSHOME%\d2g\local\lang\local_d2g_lang_en.ini

If you expect to produce output in English, because the English language file is referenced from the DITA2Go general configuration chain, you do not have to include a setting for Languages in your starting project configuration file. However, to produce output with labels and headings in German (for example), in your project configuration file you would include the following setting:

[Templates]
Languages = %OMSYSHOME%\d2g\local\lang\local_d2g_lang_de.ini

You can copy any of these language templates and modify the copy to create a regional language variation. Give your new language template a name of the form d2g_lang_LLRR.ini, where: 

LL

is the language abbreviation (such as en for English)

RR

is the optional region abbreviation (such as us for United States).

To determine an appropriate abbreviation, see:

http://www.w3.org/TR/REC-html40/struct/dirlang.html

http://www.ietf.org/rfc/rfc1766.txt

For example, to provide regional differences for the English language, you could prepare the following variants:

local_d2g_lang_enus.ini

United States

local_d2g_lang_enuk.ini

United Kingdom

local_d2g_lang_enoz.ini

Australia

local_d2g_lang_ennz.ini

New Zealand

Your project configuration file could reference one of these variants; each variant should point in turn to d2g_lang_en.ini for common values.

It is a good idea to keep your language configuration files in directory %OMSYSHOME%\d2g\local\lang, and name them as indicated; if an instance of @xml:lang in your DITA document references a language other than the default, DITA2Go can find the relevant language string.

However, within a referenced language configuration template you can include another [Templates]Languages setting, to make a chain of language configuration templates to be searched; the chain can be any length. All files in the chain must have distinct names; the chain stops if DITA2Go finds a repeat. See §39.2 Referencing configuration files and templates.

DITA2Go resets the language to the default at the start of each topic and map, and also before writing Related Links. For each instance of @xml:lang in your DITA document, DITA2Go sets the designated language for that element, and then restores the previous language at the end of the element. If @xml:lang="", DITA2Go treats this as a request for the default language.

See §8.9 Localizing output headings, labels, and names.

Previous Topic:  39.1.5 Understanding how format templates are organized

Next Topic:  39.2 Referencing configuration files and templates

Parent Topic:  39.1 Working with configuration templates

Sibling Topics:

39.1.1 Understanding how templates are organized

39.1.2 Understanding how templates are named

39.1.3 Understanding how templates are chained together

39.1.4 Understanding how macro libraries are organized

39.1.5 Understanding how format templates are organized