Project

General

Profile

Actions

Patch #31384

closed

Remove custom lazy loading of i18n files

Added by Pavel Rosický over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
Code cleanup/refactoring
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

i18n gem was updated in #29946 (4.1.0)

this caused a regression with these translations

     numbers:
       '1': One
       '2': Two
       '3': Three

     I18n.t('1', scope: [:numbers])

     Failure/Error: _key = _key.to_sym
     NoMethodError:
       undefined method `to_sym' for 2:Integer
       Did you mean?  to_s
     # ./lib/redmine/i18n.rb:206:in `block in lookup'
     # ./lib/redmine/i18n.rb:205:in `each'
     # ./lib/redmine/i18n.rb:205:in `inject'
     # ./lib/redmine/i18n.rb:205:in `lookup'
     # /usr/local/rvm/gems/ruby-2.5.3-railsexpress/gems/i18n-1.6.0/lib/i18n/backend/base.rb:32:in `translate'

the problem is in redmine, because it uses a custom backend that overrides the original behaviour and it wasn't updated accordingly

see the original PR https://github.com/ruby-i18n/i18n/pull/422
also this change doesn't work https://github.com/ruby-i18n/i18n/pull/469

attached patch fixes the problem by removing most of the custom backend in redmine


Files

i18n.rb.patch (2.85 KB) i18n.rb.patch Pavel Rosický, 2019-05-17 16:38

Related issues

Related to Redmine - Feature #36728: Reintroduce lazy loading of i18n filesClosedMarius BĂLTEANU

Actions
Blocks Redmine - Feature #29946: Update i18n gem (~> 1.6.0)ClosedGo MAEDA

Actions
Actions

Also available in: Atom PDF