Feature #29946

Update i18n gem (~> 1.6.0)

Added by Go MAEDA about 1 year ago. Updated 6 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Gems support
Target version:4.1.0
Resolution:Fixed

Description

The latest version of i18n gem is 1.1.1 but Redmine still uses 0.7.0 that was released 4 years ago.

The reason why Redmine uses the old version is a test failure (see r16324). We should fix the error and should follow the recent version.

0001-Updates-i18n-gem-to-1.1.1.patch Magnifier (1.62 KB) Marius BALTEANU, 2018-11-17 13:36

0001-Update-i18n-gem-to-1.5.3.patch Magnifier (2.46 KB) Marius BALTEANU, 2019-02-11 23:44


Related issues

Blocked by Redmine - Feature #30356: Drop Ruby 2.2 support Closed
Blocked by Redmine - Patch #31384: Remove custom lazy loading of i18n files Closed

Associated revisions

Revision 17888
Added by Go MAEDA 10 months ago

Update i18n gem to 1.5.3 (#29946).

Patch by Marius BALTEANU.

Revision 17921
Added by Go MAEDA 9 months ago

Update i18n gem to 1.6 (#29946).

History

#1 Updated by Marius BALTEANU about 1 year ago

I can take a look if you want.

#2 Updated by Go MAEDA about 1 year ago

Marius BALTEANU wrote:

I can take a look if you want.

Thanks. I have not started the work yet, so I am glad if you work on it. Although the priority of this issue is low, we have to upgrade i18n someday.

#3 Updated by Marius BALTEANU about 1 year ago

The test that fails on my local environment is the below one and not the one from r16324.


root@45ec3a6558b0:/work# ruby test/unit/lib/redmine/i18n_test.rb 
DEPRECATION WARNING: `secrets.secret_token` is deprecated in favor of `secret_key_base` and will be removed in Rails 6.0. (called from <top (required)> at /work/config/environment.rb:14)
Run options: --seed 36235

# Running:

.........F
Failure:
Redmine::I18nTest#test_fallback [test/unit/lib/redmine/i18n_test.rb:234]:
--- expected
+++ actual
@@ -1 +1 @@
-"Untranslated string" 
+"translation missing: fr.untranslated" 

#4 Updated by Marius BALTEANU about 1 year ago

There are multiple changes between 0.7.0 version and 1.1.1.

One reason of the failing test is https://github.com/svenfuchs/i18n/pull/415 which doesn't consider anymore the default locale as fallback locale. Now you need to explicitly define in the config the fallback locales. For example, if we add the line config.i18n.fallbacks = [:en] to config/application.rb, the above test will pass, but I don't think that should be the solution because from what I've observed until now, we add the en version of the locale to all locale files (which is healthier from point of view).

Attached the patch that updates the gem version and fixes the failing test. The safest way is to schedule this update for 4.1.0 in order to have time to catch missing translation keys (if exists).

#5 Updated by Marius BALTEANU about 1 year ago

Marius BALTEANU wrote:

[...] but I don't think that should be the solution because from what I've observed until now, we add the en version of the locale to all locale files (which is healthier from point of view).

It seems that are some missing keys.

#6 Updated by Marius BALTEANU 10 months ago

  • Assignee set to Marius BALTEANU
  • Target version set to Candidate for next major release

i18n now is at v1.5.3 which supports only Ruby > 2.2. I'll work on this for 4.1.0

#7 Updated by Marius BALTEANU 10 months ago

I've attached a new patch with a different fix, but I would like a review on the proposed changes even if all the existing tests pass

The failing test from r16324 was generated by a change to the exists? method which returns true when a fallback exists (please see https://github.com/ruby-i18n/i18n/pull/326).

In my note 3, I wasn't able to reproduce the failing test because the fallback was not enabled.

#8 Updated by Marius BALTEANU 10 months ago

One more thing, in the future, we can change back to exists? method if the https://github.com/ruby-i18n/i18n/issues/365 will be implemented.

#9 Updated by Go MAEDA 10 months ago

#10 Updated by Go MAEDA 10 months ago

  • Subject changed from Update i18n gem to Update i18n gem (~> 1.5.3)
  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch. Thank you for writing the patch.

#11 Updated by Go MAEDA 9 months ago

  • Status changed from Closed to Reopened

i18n 1.6.0 has been released on 2019-03-03.
https://rubygems.org/gems/i18n/versions/1.6.0

I confirmed that it passes all tests. We can update i18n to ~> 1.6.0.

#12 Updated by Go MAEDA 9 months ago

  • Subject changed from Update i18n gem (~> 1.5.3) to Update i18n gem (~> 1.6.0)
  • Status changed from Reopened to Closed

Updated i18n to 1.6 in r17921.

#13 Updated by Go MAEDA 7 months ago

  • Related to Patch #31384: Remove custom lazy loading of i18n files added

#14 Updated by Go MAEDA 7 months ago

  • Related to deleted (Patch #31384: Remove custom lazy loading of i18n files)

#15 Updated by Go MAEDA 7 months ago

  • Blocked by Patch #31384: Remove custom lazy loading of i18n files added

#16 Updated by Go MAEDA 7 months ago

  • Status changed from Closed to Reopened

#31384 has been reported for this change.

#17 Updated by Jean-Philippe Lang 6 months ago

  • Status changed from Reopened to Closed

Also available in: Atom PDF