Allow only specific languages

AI-generated summary

In a Feature discussion, Don proposes a method to restrict the available interface languages in the user preferences, noting that the current allow user locale setting enables a dropdown with all installed languages. Don suggests that site administrators should be able to select a specific subset of languages (e.g., only English and Hungarian) rather than exposing every available option. Don also references the set locale from accept language header setting, which automatically assigns a user’s language based on their browser headers if enabled.

discourse replies that this feature has been implemented in recent updates. The allow user locale boolean setting has been replaced by a new allowed user locales field. The transition handles two scenarios: communities that previously had the feature enabled are seamlessly switched to “All languages,” while those that had it disabled are set to an empty list, supporting only the site’s default locale.

Administrators can now choose a specific subset of languages (such as “English, Chinese, Arabic”). If an admin removes languages that are currently active, users relying on those removed options will be automatically moved to the site’s default language. The update also includes warnings to help users align interface language settings with the opt-in content language feature, as these settings are closely related but were originally designed with separate concerns. The topic remains open for feedback, though users encountering bugs related to the new allowed locales system are encouraged to open a new topic.

Hello :wave:

I am not sure this is maybe possible now somehow. I didn’t find a solution yet. :thinking:

For now we have this setting
allow user locale

When we turn on allow user locale it activates a dropdown on the user preference interface page which contains the all languages.

I think it would make sense to add the ability to select only those specific languages which needed. I mean for example if we have an international site then we can activate all languages but if we only offer the site for two countries or languages then we prefer to only activate those two languages and then as it expands we can add more.

Other setting
set locale from accept language header
For example: My site default locale is English and I want to activate one more language, Hungarian. In this case this site setting, set locale from accept language header will set the language automatically to Hungarian if they locale Hungary otherwise the language will set to default locale.

Thanks :slightly_smiling_face:

7 Likes

We had another look at this feature recently and just landed it couple of days back.

The way it works now is that the allow user locale checkbox is now expanded to allowed user locales.

(Scenario A) If your community has it enabled previously, it will seamlessly move to “All languages”.

(Scenario B) If your community had disabled ‘allow user locale’, the new value would be empty, meaning only the site default locale is supported as intended.

If an admin chooses to only support “English, Chinese, Arabic” from “All languages”, they will be prompted that users who are using removed languages will be moved to the site’s default language.

We also understand that this (interface language) setting is closely related to content language settings (which is an opt-in feature), so there is some hint/warning added when both features are used and the languages aren’t a subset. These language features (interface + content) were originally built with separate concerns in mind, and we know it’s very intertwined from a user perspective, and are happy to get feedback on making it more obvious.

I’ll keep this feature topic open for a bit but please open a new topic if there are issues related to the allowed locales.

1 Like