How To Disable or Restrict Languages from User Profile in Confluence Datacenter
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Some administrators want/need to limit the language choices in the User Profile of their Confluence users.
Environment
Confluence DataCenter 8.5.X and later versions
Solution
As explained in Edit Your User Settings, Individual users can choose the language that Confluence will use to display screen text and messages. Note that the list of supported languages depends on the language packs installed on your Confluence site.
The language used for a user's session will depend on the settings below, in the following order of priority from highest to lowest:
- The language preference defined in the user profile.
The language that you choose by clicking an option at the bottom of the Confluence login screen.
The language set in your browser.
- The default language for your site, as defined by your Confluence site administrator.
Be mindful that customisations are not part of our support scope as per Atlassian Support Offerings. Any effort provided to support issues related to customisation will be on a best-effort basis by the support engineer.
If an administrator wishes to allow/restrict certain languages in the User Profile, the number of languages for selection can be customized by adding the following code into General Configuration > Look and Feel > Stylesheet:
/* Global CSS for Confluence */
select[name="preferredUserLocale"] {
font-size: 14px;
color: #333;
}
/* Hide unwanted language options */
select[name="preferredUserLocale"] option {
display: none; /* Hide all options initially */
}
/* Show only specific language options */
select[name="preferredUserLocale"] option[value="en_US"],
select[name="preferredUserLocale"] option[value="en_GB"],
select[name="preferredUserLocale"] option[value="fr_FR"] {
display: block; /* Show only the desired language options */
}
Using the example above, the individual users will see the following available languages in their User Profile:
If you want to select other languages, just add another option
entry with the language code you wish. The full list of languages available is the following:
"None" Automatically detect browser setting
"cs_CZ" čeština (Česko)
"da_DK" dansk (Danmark)
"de_DE" Deutsch (Deutschland)
"et_EE" eesti (Eesti)
"en_GB" English (UK)
"en_US" English (US)
"es_ES" español (España)
"fr_FR" français (France)
"is_IS" íslenska (Ísland)
"it_IT" italiano (Italia)
"hu_HU" magyar (Magyarország)
"nl_NL" Nederlands (Nederland)
"no_NO" norsk (Norge)
"pl_PL" polski (Polska)
"pt_BR" português (Brasil)
"ro_RO" română (România)
"sk_SK" slovenčina (Slovensko)
"fi_FI" suomi (Suomi)
"sv_SE" svenska (Sverige)
"ru_RU" русский (Россия)
"zh_CN" 中文 (中国)
"ja_JP" 日本語 (日本)
"ko_KR" 한국어 (대한민국)
Caveats
Do note that this customization will not enforce a specific language setting for those users who have already chosen a language outside of the allowed/restricted list.
As an admisnitrator, you could check which users have selected a particular language with the following database statement:
SELECT u.username, op.entity_key, op.string_val, cw.email_address
FROM os_propertyentry op
JOIN user_mapping u ON op.entity_name = CONCAT('USERPROPS-', u.user_key)
JOIN cwd_user cw ON cw.user_name = u.username
WHERE op.entity_key LIKE 'confluence.user.locale%'
ORDER BY u.username ASC;
The above query will return a list of values similar to this:
|username|entity_key |string_val|email_address |
|--------|----------------------|----------|-----------------|
|user1 |confluence.user.locale|es_ES |user1@example.com|
|user2 |confluence.user.locale|zh_CN |user2@example.com|
|user3 |confluence.user.locale|nl_NL |user3@example.com|
So, before restricting the language selection for your users, you could contact each user to explain the situation and ask them to manually change it to the desired language.
Feature Request
There is a Feature Request that was opened for adding this to Confluence
At the moment of publishing this KB article, the suggestions is open and in Gathering Interest status. We recommend that you vote for the feature request and watch it to receive email updates as soon as the ticket status is updated. Our product team will review the feature request, which will be implemented according to our Implementation of New Features Policy.