A while ago I added RTL text support to my wiki:
http://ikiwiki.info/tips/Right-to-left___40__RTL__41___page_text
But this support does not work with PO files. When I write a page in English, I need the Hebrew/Arabic translation to have additional text (in my case, using the template directive) which causes the direction of the text to be RTL.
I saw a recent patch which claims to solve the problem by exposing the language code and direction to the templates (which would help a lot), but when I go to the original website from which it came, it looks like the Arabic text is still aligned LTR just like English:
http://addons.nvda-project.org/index.ar.html
Another issue is that I use Debian stable, and I'm not sure it's safe to
use some unstable ikiwiki (currently I use the version from backports) -
advice welcome
It's still important to have the ability to change direction inside the page, but the default direction specified either in CSS on in the page.tmpl file should be dynamic. I didn't check how the PO plugin works, but it may be necessary to update there, because if all it does is copy the HTML page and switch strings with translations, it must be modified to also edit the LTR/RTL directives so that different translations of the same page can have different directions.
I hope I'll have some time to look into it myself, I'm just a bit behind now with non-recent ikiwiki version (maybe it's time for me to try sid or from source).
HTML5 says:
Could you test whether your tip works with
<div dir="rtl">
or something, please? If it does, please change the tip, if not, we'll have to look at whether the htmlscrubber is getting in the way.After that, I think the next step towards good RTL support would be to put together some test-cases for things that are meant to work, in the form of:
As far as I know, none of the IkiWiki committers can read any RTL languages, so if you use Arabic or Hebrew or whatever in those test-cases, we'll need a screenshot/image of what it's meant to look like. Using Latin text marked as RTL (so it should come out backwards if everything is working correctly) might be easier.
The obvious cases that I can think of are:
and possibly
It might be necessary to add support for a per-wiki, per-page or (for po) per-translation-language direction override that would set the
<html dir>
attribute, but we should find test-cases first, then we can work out solutions.If I'm interpreting that Arabic website correctly, it is RTL, but left-justified (which is a somewhat confusing CSS glitch, but hopefully not a barrier to understanding by people who can read Arabic). English words embedded in the Arabic are LTR, but my understanding of the bidi algorithm is that that's meant to happen.
For instance, in the English version, the last paragraph before the inline says:
and in the Arabic version, the last paragraph looks like this in my browser (where
*****
represents Arabic that I don't know how to read):So that looks right for RTL: the colon is at the end (left), and the mentions of rss feeds and atom feeds are at the beginning (right). When I "view source", it's the other way round.
Also, the page source says:
which looks right?
It looks as though you mean mhameed's change from expose html language and direction, which exposed them to the templates, but did not modify the default
page.tmpl
to make use of them. Perhaps you or mhameed could provide apage.tmpl
patch?