Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Human-readable text that is appropriate for a particular language. TranslatedText elements typically occur in a series, presenting a set of alternative textual renditions for different languages and types.

Include Page
TranslatedText Element
TranslatedText Element

Include Page
TranslatedText Attributes
TranslatedText Attributes

To find the text appropriate for a target language with tag LT, search for a TranslatedText element whose xml:lang attribute matches LT exactly (ignoring case). If that fails, remove the ending subtag from LT and repeat. If that fails, search for a TranslatedText without an xml:lang attribute and use that. If none is found, there is no suitable text available. E.g.

TranslatedTexts PresentRequestedProcess
<TranslatedText xml:lang="fr-CA">...
<TranslatedText xml:lang="en-GB">...
<TranslatedText>...
fr-FRLook for xml:lang="fr-FR".
This is not found, so look for xml:lang="fr".
This is not found, so look for a TranslatedText with no xml:lang. This is the text that should be used.

XHTML

For type="application/xhtml+xml" it is possible to use HTML tags for text formatting. Value of the TranslatedText element must be always wrapped in <div> tag with non-whitespace content within it. The <div> must have a proper namespace specified: <div xmlns="https://www.w3.org/1999/xhtml/>

Note that the XHTML is contained in general XML so there is no support for HTML entities like &nbsp; or &copy; etc. Unicode characters shall be used instead. Unicode &#160; substitutes for &nbsp;.

The content should be in the language of the TranslatedText element (xml:lang), but there is no reason to expect that HTML type tooling would understand the TranslatedText element language. For this reason, it is a good practice to use a lang attribute on the <div> (see the note in the HTML 5 specification about use of language ).

A minimum set of supported HTML tags

A base minimum set of HTML tags which needs to be supported for ODM conformance:  

  • Layout containers: <div> <p>
  • Headers: <h1> <h2> <h3> <h4> <h5> <h6>
  • Lists: <ul> <ol> <li>
  • Definitions: <dl> <dt> <dd>
  • Lines: <hr>
  • Block-level quotes/preformatted: <pre> <blockquote>
  • Links: <a>
  • Inline elements: <span> <br> <code> 
  • Text styling: <em> <strong> <b> <i>
  • Tables: <table> <caption> <thead> <tfoot> <tbody> <colgroup> <col> <tr> <th> <td>
  • Images: <img> <map> <area>
  • Color: <span style="color:xxx">

The following example shows a TranslatedText element with both plain text and an enhanced presentation with a limited number of HTML tags.

Example
titleMethod Description with XHTML Formatting

Include Page
TranslatedText Example
TranslatedText Example

Pagenav