DITA and Docbook stylesheets come with localizations so that you can change the language of the element content. For example, you can change the label on the
<figure> element from the English "Figure" into the Spanish "Figura".
Figure 1.
Spanish localization of the Figure element label.
The language of the element content is controlled by the value of the
xml:lang attribute. Possible values include:
-
When no
xml:lang value is supplied, the default value of English is assumed.
-
af - Afrikaans
-
bg - Bulgarian
-
ca - Catalan
-
cs - Czech
-
da - Danish
-
de - German
-
el - Greek
-
en - English
-
es - Slovenian
-
et - Estonian
-
eu - Basque
-
fi - Finnish
-
fr - French
-
he - Hebrew
-
hu - Hungarian
-
id - Indonesian
-
it - Italian
-
ja - Japanese
-
ko - Korean
-
lt - Lithuanian
-
nl - Dutch
-
nn - Nynorsk
-
no - Norwegian
-
pl - Polish
-
pt - Portuguese
-
pt_br - Portuguese (Brazil)
-
ro - Romanian
-
ru - Russian
-
sk - Slovak
-
sl - Slovenian
-
sr - Serbian
-
sv - Swedish
-
th - Thai
-
tr - Turkish
-
uk - Ukrainian
-
vi - Vietnamese
-
xh - Xhosa
-
zh_cn - Chinese (Continental)
-
zh_tw - Chinese (Traditional)
The allowed
xml:lang values are based on ISO-3166 Country Codes and RFC 3066 Language Codes (see
W3C: Language tagging in HTML and XML).
You can change the language either of an element or of all elements in a document:
-
To change the language of an element in the document, add the
xml:lang attribute with a desired value to this element.
-
To change the language of all elements in the document, add the
xml:lang attribute with a desired value to the root element.