# Subforum with different language (help wanted)

**URL:** <https://meta.discourse.org/t/subforum-with-different-language-help-wanted/45079>\
**Category:** Support\
**Created:** [6월 1, 2016, 10:33오전 UTC](https://meta.discourse.org/t/subforum-with-different-language-help-wanted/45079 "2016-06-01T10:33:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [6월 2, 2016, 12:43오전 UTC](https://meta.discourse.org/t/subforum-with-different-language-help-wanted/45079/2 "2016-06-02T00:43:42Z")

</div>

A plugin like this might work for you. It’s checking the request path to see if you are on the category page `/c/arabic` or if you are on a topic page that has the english word ‘arabic’ in the title - ‘(arabic)’ (in brackets) will work. If so, it sets the local to ‘ar’ and displays the page right-to-left.

People will have to refresh the page to get the rtl stylesheet, and refresh it again when they go back to wanting a ltr stylesheet.

```rb
# name: arabic-topics
# about: set locale for specific topics and categories

after_initialize do

  ApplicationController.class_eval do

    def set_locale
      if /^\/c\/arabic/.match(request.path) || /^\/t\/arabic/.match(request.path)
        I18n.locale = 'ar'
      else
        if !current_user
          if SiteSetting.set_locale_from_accept_language_header
            I18n.locale = locale_from_header
          else
            I18n.locale = SiteSetting.default_locale
          end
        else
          I18n.locale = current_user.effective_locale
        end
      end
      I18n.ensure_all_loaded!
    end
    
  end
end

```

I don’t know Arabic. Those are random letters 😛

 ![](https://global.discourse-cdn.com/meta/original/3X/3/d/3d622acdc97cbceb2f4a1c1d42a5d0e055e06fa1.png)

 ![](https://global.discourse-cdn.com/meta/original/3X/0/c/0c1fb472eb0f237b19e8085af88b9282b8191b1e.png)

Maybe it will be possible to append the word ‘Arabic’ to any topic created in the arabic category. I can look at this some more later if you think this approach makes sense.

Edit: it looks like there is a more straightforward way to do this. I’ll try making something for it tomorrow.

---

_[View the full topic](https://meta.discourse.org/t/subforum-with-different-language-help-wanted/45079)._
