@Qasem_h and I have been working getting a rtl layout working with Discourse.
This seems like a good solution:
add the r2 gem to the Gemfile r2 | RubyGems.org | your community gem host
add a conditional statement to
discourse_sass_compiler.rbto reverse css output for rtl locales - I used this
if !SiteSetting.allow_user_locale && SiteSetting.default_locale.in?(%w(he ar fa_IR))
direction: left’ on html element in
base.scss(r2 can’t reverse it unless it is explicitly written)
delete contents of
rtl.scss- they are going to get reversed and mess things up
add a couple of css rules to fix icon and triangle directions
If you change a site’s default local you have to run
./launcher rebuild app to generate new css.
I tried to get this working with the
rtlit gem that is in the Gemfile - it worked well in development mode but in production it seems to have some problems parsing the css.
There is a working example here: http://126.96.36.199/ . It will be up for a day or so.