Patch #38529
closedLimit available locales to those defined by Redmine itself
Description
Currently, Redmine configures the i18n gem to use locale definitions from Redmine itself (i.e. the contents of config/locales
), plus definitions from any loaded plugin and any loaded gem.
By loading languages from plugins and gems, we might run into the case where they define a language which is not present in Redmine itself. This can result in invalid languages being offered in the language drop downs for users. A specific example if this issue is the doorkeeper
gem (as introduced in #24808) which defines the additional languages nb
, zh-CN
, and zh-HK
. This can also happend with other gems or plugins which may define partial locales.
The attached patch ensures that these additional and only partially defined languages are not offered by Redmine by ensuring that we only offer languages (and locale languages) for which we define the base translations in config/locales
ourselves. Extensions for these languages (such as additional or overwritten translation keys) are still loaded from the same places as before.
Files