Available Locales Plugin

AI-generated summary

The Available Locales Plugin allows admins to limit the locales shown in the Interface language dropdown in User settings. The plugin has an Admin settings option, available interface locales, to list available locales for users. It’s enabled once the allow user locale setting is enabled. By default, all Discourse languages are enabled.

eatcodetravel shares the plugin’s repo and notes that it might be outdated, recommending angus’s Multilingual Plugin instead, which also restricts available locales. However, nexo prefers this plugin’s feature of displaying the locale selection within User settings.

1c7 successfully tested the plugin, and eextra inquired about its compatibility with anonymous users’ locale settings, to which eatcodetravel replied that the feature might not be supported, suggesting angus’s plugin for possible support.

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: Pavilion

4 Likes

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

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

2 Likes