Quote:
Originally Posted by awakil
I translate stories from English to Arabic, but the text direction in the epub files remains from left to right, and this is an error
|
You can't just swap the text. The file (if all Arabic) or the paragraph or span (if partial text) needs both the "dir" and "Lang"
Marking a paragraph as RTL
https://www.w3schools.com/tags/att_global_dir.asp
Marking the language as Arabic (or whatever that uses Arabic script).
https://www.w3schools.com/tags/att_lang.asp
I often have Lang in a span as only part of a English text paragraph may have Irish, German or French dialogue.
I expect dir needs to be at least <p> level as few ereaders and ereader apps can render LTR and RTL on the same line (usually a table is only safe way to achieve that by two columns, unless you are using epub3.
The lang attribute is a Global Attribute, and can be used on
any HTML element. So can be set at body tag to make entire file be Arabic, and then <div lang= en><p dir=ltr>“<span lang="fr">Ceci est un plume</span>,” she said.</p></div> will work in any lanaguage ebook.
Arabic font is separate from an Arabic language.
Quote:
Languages can be written in more than one script. For example, Azeri can be written in any of the Latin, Cyrillic, or Arabic scripts. When written in Latin or Cyrillic scripts, Azeri is written left-to-right (LTR). When written in the Arabic script, it is written right-to-left.
|
https://www.w3.org/International/questions/qa-scripts
So simply translating English to Arabic (or any language not using LTR and not using Latin-Roman fonts) is only part of it. By default ebooks and webpages are LTR and English if nothing is set.
Ancient Greek before 750 BC was RTL.
I'm nearly sure Turkish used to use Arabic script and RTL, but now is Latin-Roman script and LTR.