Available Locales Plugin

Repo: Majal / discourse-available-locales · GitLab

This plugin allows you to limit the locales shown in the Interface language dropdown in the User settings.

image

Admin settings

  • available interface locales: List of locales that will be available for users to select.

Notes

  • This plugin will be enabled once you enable the allow user locale setting.

image

  • By default, all languages available in Discourse today (2018-04-27) are enabled.
9 Likes

Just tried this (2018-4-29) Work for me!

Thanks for building this!
(I am just trying different plugin to get familiar with Discourse plugin ecosystem.)

0. Install

cd discourse/plugin
git clone https://gitlab.com/majalorg/discourse-available-locales

restart rails s

1. Set available language (as admin) (Chrome)

2. Use another browser to login as normal user (Firefox)

Thanks!

1 Like

@angus developed a plugin that includes this functionality. You should give it a look instead of installing this plugin Multilingual Plugin 🌐

1 Like

The difference here is that the feature is displayed within the user settings. I like that.

The multilingual plugin also lets you restrict the available locales in the user interface languages setting.

See further: Interface languages - Multilingual - Pavilion

4 Likes

Will this work after this setting up: (so no locale for china anonymous users for example?)
image

I don’t think so, that feature wasn’t available when I developed this, maybe @angus plugin has support for this.

1 Like