Project

General

Profile

Actions

Patch #38529

closed

Limit available locales to those defined by Redmine itself

Added by Holger Just over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
I18n
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

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

Actions

Also available in: Atom PDF