Defect #18110

Extraction of list of available locales is probe to bad gems

Added by Ebrahim Mohammadi over 3 years ago. Updated over 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:I18n
Target version:2.6.0
Resolution:Fixed Affected version:

Description

I added a plugin to my Redmine which indirectly depended on kaminari gem who contains a badly named kaminari.yml locale file: https://github.com/amatsuda/kaminari/tree/master/config/locales. Hence a second "English" named language with a key of kaminari is added to list of Redmine languages.

Associated revisions

Revision 13450
Added by Jean-Philippe Lang over 3 years ago

Ignore locales without :general_lang_name key (#18110).

History

#1 Updated by Jean-Philippe Lang over 3 years ago

  • Status changed from New to Needs feedback

Ebrahim Mohammadi wrote:

Hence a second "English" named language with a key of kaminari is added to list of Redmine languages.

Which list contains this second "English" language ? Can you provide a screenshot or something and a way to reproduce this problem, thanks.

#2 Updated by Ebrahim Mohammadi over 3 years ago

Dropdown list of Redmine languages is shown in these two locations both of which are affected:

  • My Account -> Language
  • Administration -> Settings -> Display -> Default language

Non-tested steps to reproduce:

  • Add kaminari to Gemfile of Redmine as dependency
  • bundle update
  • rails server
  • See any of two affected lists of Redmine languages

#3 Updated by Jean-Philippe Lang over 3 years ago

  • Resolution set to Cant reproduce

Ebrahim Mohammadi wrote:

Non-tested steps to reproduce:

  • Add kaminari to Gemfile of Redmine as dependency
  • bundle update
  • rails server
  • See any of two affected lists of Redmine languages

I tried this already but was not able to reproduce.

#4 Updated by Ebrahim Mohammadi over 3 years ago

I think kaminari has to be loaded in Redmine in order to add its locale path to ::I18n.load_path which is used in Redmine::I18n::Backend.available_locales in lib/redmine/i18n.rb.

#5 Updated by Jean-Philippe Lang over 3 years ago

  • Status changed from Needs feedback to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.6.0
  • Resolution changed from Cant reproduce to Fixed

I was able to reproduce and it's fixed in r13450 (make sure to clear your cache).
Locales without the :general_lang_name locale are now ignored.

Also available in: Atom PDF