Best Practices for bi-directional text
You are using bi-directional text for example if your topic in Farsi (right-to-left) contains an excerpt in English (left-to-right). You should use the DITA dir attribute to tag the exceptional content to indicate the correct text direction.
About this task
Dynamic Documentation is designed to handle languages that are read both from left to right and from right to left. The dir attribute is a DITA attribute for influencing the direction in which your text is rendered.
You can ensure that the text in both directions are rendered properly by indicating the text direction for the exceptional content with the DITA attribute dir. For example if your topic is written in Farsi with an excerpt in English, you tag the English language content with the dir="ltr" so that Dynamic Documentation can render the excerpt correctly from left to right as an exception towards the rest of the content.
Procedure
- Check out the topic from Content Manager with an XML editor.
- Check which direction your topic language is read, either from right to left or from left to right and tag the direction of the exceptional content. Dynamic Documentation renders the topic as determined by the language setting for the topic.
- If the main topic is written in a right to left language, such as Farsi (fa), then the exceptional content in a left to right language, such as English, should be tagged with the
dir="ltr"attribute. - If the main topic is written in a left to right language, such as English, then the exceptional content in a right to left language, such as Hebrew (iw), should be tagged with the
dir="rtl"attribute.
- If the main topic is written in a right to left language, such as Farsi (fa), then the exceptional content in a left to right language, such as English, should be tagged with the
- Check in the topic to save your changes.
- Re-publish your publication to verify your changes in Dynamic Documentation.
Results
dir attribute ensures that your excerpts are aligned and rendered in the direction that you assigned to the DITA dir attribute.