# Why is RTL class user dependent instead of locale?

**URL:** <https://meta.discourse.org/t/why-is-rtl-class-user-dependent-instead-of-locale/54077>\
**Category:** Development\
**Created:** [11 Diciembre, 2016 03:04 UTC](https://meta.discourse.org/t/why-is-rtl-class-user-dependent-instead-of-locale/54077 "2016-12-11T03:04:10Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)\
**Post date:** [12 Diciembre, 2016 00:01 UTC](https://meta.discourse.org/t/why-is-rtl-class-user-dependent-instead-of-locale/54077/11 "2016-12-12T00:01:01Z")

</div>

For some reason I like the idea of having it in the yml file.

I have no basis for the feeling other than it just seems like the logical best place for it.

I tried hacking the rtl.rb file to

```plaintext
  def enabled?
# site_locale_rtl? || current_user_rtl?
    user.effective_locale.in?(rtl_locales)
  end

# def current_user_rtl?
# SiteSetting.allow_user_locale && user.try(:locale).in?(rtl_locales)
# end

# def site_locale_rtl?
# !SiteSetting.allow_user_locale && SiteSetting.default_locale.in?(rtl_locales)
# end

```

I don’t know Farsi so I could very well not be seeing a glaring issue.  
But the hack did not crash Discourse and I saw no error messages anywhere.  
I did notice that the title was not translated for some pages, but that was true for both hacked and not-hacked.  
And I did not try the `set locale from accept language header` setting nor test emails or many pages at all.

I did test as a site setting desktop and mobile view, and allow user preference desktop and mobile view.

**site default setting desktop**

 ![](https://global.discourse-cdn.com/meta/original/3X/9/a/9aeeb3dfdcd829c43313c1558d33c60bf49fbfd3.png)  
**site default setting mobile**  
 ![](https://global.discourse-cdn.com/meta/original/3X/a/4/a411b8ff6a5c2155e8b922651bd31592d08dd62e.png)  
**user preference desktop**  
 ![](https://global.discourse-cdn.com/meta/original/3X/9/1/9182f5bd943f68fb581ca2cdaba860840a50107b.png)  
**user preference mobile**  
 ![](https://global.discourse-cdn.com/meta/original/3X/6/1/612c6a85734b6325f62a132e47817ab239604a99.png)

---

_[View the full topic](https://meta.discourse.org/t/why-is-rtl-class-user-dependent-instead-of-locale/54077)._
