RTL support


(Simon Cossar) #67

Try going to admin>settings>developer and make sure verbose localization is unchecked.


(Noneck) #68

/cc @simon_cossar @Qasem_h @sam

Problems with RTL support

We have a Discourse hosted instance of Discourse. On that site we will host conversation in English (LTR language) and Persian and Hebrew (RTL languages). We have configured Discourse so the end user can select the user language.

When a user selects an RTL language, the user interface language changes, but the direction of the language does not.

To properly support RTL languages, the user interface should move from the left to the right. For an English speaking user, everything is weighted to the left. For a Hebrew/Persian speaking user, everything is weighted to the right.

How can we get Discourse to display properly for those who have selected RTL AND have the same instance display properly for those who have LTR selected?

I see there is a forum comment on “rebuilding” the app. How can we have a version of Discourse without having to rebuild the app? If we have to “rebuild” the app, how frequently should we be rebuilding the app?

< RTL support >

The best example of the account behavior we seek is on “BooksWithWings.org.” BWW’s primary language is LTR (English). If the user selects a RTL language (fa_IR), the site pivots to a proper display of RTL.

< RTL support >


There are two other language behaviors we are looking to address.

RTL specific categories

On < https://talk.developersquare.net/ > we will have some categories that are RTL only. Ideally, we could promote certain categories as RTL and host a forum with in a forum.

Is it possible to flag a category to be RTL and have all topics in that category appear as RTL?

Also, is it possible to flag a topic and comments as RTL?

Language specific HTML header bar?

Under Admin, there is a feature that allows us to configure an HTML header. Has anyone made this language specific?

We would like for users who land on a language specific RTL page to have the header appear in that language. For example, if a Persian user is in a category or topic that is part of the Persian area, the header’s HTML would be specific for the Persian category, topic, or comment.

The goal is to have one discourse forum for several language landing pages.

etc…


#69

select a RTL language And rebuild your app

[quote=“noneck, post:68, topic:1784”]
How can we get Discourse to display properly for those who have selected RTL AND have the same instance display properly for those who have LTR selected?
[/quote] After rebuild enable this setting in your admin panel

   default locale

Sometimes need to rebuild your app

  1. install a plugin
  2. update your app,yml
  3. update your discourse core
    and …

(Noneck) #71

@Qasem_h Thanks but we’re running Discourse though Discourse.org. We shouldn’t have to rebuild the app. I’m looking forward to the same type of functionality as < www.BooksWithWings.org >.

When one selects the user language, the whole interface changes.


#72

I sad you must rebuild your app after select a RTL language

[quote=“noneck, post:71, topic:1784”]
When one selects the user language, the whole interface changes.
[/quote] Yes after rebuild user can select a RTL + LTR
It is only once time


(Noneck) #73

@Qasem_h Thanks. We’ll try that.


(Kane York) #74

If you’re on hosted discourse and need to do something that would require a rebuild for self-hosted, try emailing team@discourse.org.


(Simon Cossar) #75

The Books With Wings forum is using a custom version of Discourse. I think that the way it works should be the default behaviour for Discourse LTR/RTL support, but I need some help with getting it properly developed.

To get RTL language support for the main branch of Discourse currently requires that you unselect ‘allow user locale’ in admin>settings>basic setup and then select either Hebrew, Arabic, or Persian as the default language. To switch the language from a LTR to a RTL one requires rebuilding the app.


(Sam Saffron) #76

@Simon_Cossar / @noneck his is actually a bug in user locales.

If “enable user locales” is enabled we need to start compiling the CSS twice and selecting the correct CSS based on user local.

As it stands if the base locale is English then the interface will not be flipped if you select “he” in user locales.


(Simon Cossar) #77

That’s how I’ve got it set up for the Books With Wings forum. We need the ability to be able to change layouts. It’s a real hassle to be running the forum from a custom repository though.


(Sam Saffron) #78

Can you send through a PR for this?


(Simon Cossar) #79

I can, but I think someone will need to look at the code and give a few suggestions.


(Sam Saffron) #80

Sure, try a PR first, ping me on it, if I have to I will clean it up.


(Noneck) #81

@sam / @Simon_Cossar thanks for looking at this. If there is anything my team can do, please let me know.


(Sam Saffron) #82

Its now implemented via

https://github.com/discourse/discourse/commit/45bdd23689f83a90de2df5e089bab5d52af1c4d4

thanks to footwork by @Simon_Cossar

will be deployed internally some time in the next few days.

@amitfrid the male/female stuff sure is weird in the Hebrew translation. “Male give this post a like”. Assume its similarly confusing in Arabic @Simon_Cossar


(Sam Saffron) #83

@Simon_Cossar we should pull rtl.scss out of the general bundle and only include it in the rtl stylesheets


(Michael Solomon) #84

There’s news with this?


(Simon Cossar) #85

This one is tricky. The user card position is based on the position of the user’s avatar on the page. It looks like it is being set in views/user-card.js.es6. Making it work for RTL is a little beyond me at the moment. I’d sure like to see how it could be done.


(Sam Saffron) #86

Closing this, RTL is VERY supported now, no point in keeping this mega topic open, just open new ones as you need.


(Sam Saffron) #87