Different languages

The xml:lang attribute stores the human language of the content, and can be applied to any DITA element.

It is not unusual to have content in more than one language in the same deliverable document, or even in the same topic. For example, a topic in German documenting a software application with a user interface in English might need to explain English language error messages.

Every DITA element, including map elements, topic elements, block elements and phrase elements, has an xml:lang attribute which stores the ISO 639 code of the human language in which the content is written.

If one topic has a mix of varieties or dialects of the same language, such as some US English and some UK English, the varieties can be managed through the xml:lang attribute.

For example, if the bulk of a concept topic's content was in US English, but one phrase was in UK English, the concept element's xml:lang attribute should be set to en-US, and the phrase marked up with ph or text with the xml:lang attribute set to en-UK.

If you need to deliver entire documents in different varieties or dialects of the same language, where there are significant spelling, punctuation and grammatical differences, you should treat the varieties as separate languages and manage the task as a localisation project.