Project

General

Profile

Actions

Patch #38529

closed

Limit available locales to those defined by Redmine itself

Added by Holger Just 11 months ago. Updated 11 months 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 #1

Updated by Go MAEDA 11 months ago

  • Category changed from Translations to I18n
  • Target version set to 5.1.0

Setting the target version to 5.1.0.

Actions #2

Updated by Go MAEDA 11 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch in r22237. Thank you.

Actions

Also available in: Atom PDF