DITA-OT supports more than 40 languages. The full list of supported languages (and their codes) is available here: https://www.dita-ot.org/dev/topics/globalization-languages.
@xml:lang attribute on the DITA maps and/or
topics root element with one of the supported values (e.g. de,
fr-FR, ru, zh-CN).default.language parameter in the
transformation dialog box to the desired language code.You can create language-dependent CSS rules in your customization CSS by adding rules using the
:lang pseudo-class (see https://developer.mozilla.org/en-US/docs/Web/CSS/:lang).
*[class ~= "toc/title"][empty]:before {
content: "Agenda";
}/* Title of the TOC page */
*[class ~= "toc/title"][empty]:lang(es):before {
content: "Contenidos";
}p-i18n-xx.css stylesheet, follow these instructions::lang pseudo-class since it is the default language).:lang(xx) pseudo-class with your expected
language code, then replace each property value with the expected label.To modify the generated text, you need to create a DITA-OT extension plugin that uses the dita.xsl.strings extension point. The following example uses English, but you can adapt it for any language:
<plugin id="com.oxygenxml.pdf.css.localization">
<require plugin="com.oxygenxml.pdf.css"/>
<feature extension="dita.xsl.strings" file="pdf-extension-strings.xml"/>
</plugin><langlist>
<lang xml:lang="en" filename="strings-en-us.xml"/>
<lang xml:lang="en-us" filename="strings-en-us.xml"/>
</langlist>
@id
attribute unchanged because this is the key used to look up the string. Then replace their
values:
<variables>
<variable id="Figure">Fig</variable>
<variable id="Table">Array</variable>
</variables>
Some strings are not translated in all languages. In this case, they will appear in English. To add a new language for a given string, you need to create a DITA-OT extension plugin that uses the dita.xsl.strings extension point. The following example uses Polish, but you can adapt it for any language:
<plugin id="com.oxygenxml.pdf.css.localization">
<require plugin="com.oxygenxml.pdf.css"/>
<feature extension="dita.xsl.strings" file="pdf-extension-strings.xml"/>
</plugin><langlist>
<lang xml:lang="pl" filename="strings-pl-pl.xml"/>
<lang xml:lang="pl-pl" filename="strings-pl-pl.xml"/>
</langlist>
<variable> element (make sure to leave the @id
attribute unchanged).
<variables>
<variable id="Figure">Polish word for 'Figure'</variable>
<variable id="Table">Polish word for 'Table'</variable>
...
<variable id="Table of Contents">Polish word for 'Table of Contents'</variable>
...
<variable id="Continued">(ciąg dalszy)</variable>
</variables>