You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran a rails application in a threaded environment with calls to I18n.t where there is no translation in my locale but there is a translation in a fallback locale
What I expected to happen
I expected I18n.t to return the translation string from the fallback locale
What actually happened
Occasionally and unpredictably I received a missing translation error
Versions of i18n, rails, and anything else you think is necessary
i18n version 0.8.1. I was previously using version 0.7.0 and did not experience this issue.
This code reproduces the issue fairly reliably with i18n 0.8.1 but works properly with 0.7.0
require 'i18n'
class Backend < I18n::Backend::Simple
include I18n::Backend::Fallbacks
end
I18n.backend = Backend.new
I18n.backend.store_translations(:en, {'foo' => 'bar'})
I18n.backend.store_translations(:de , { 'baz' => 'buz'})
threads = []
100.times do
threads << Thread.new do
100.times do
I18n.t('foo', raise: true, locale: :de)
end
end
end
threads.each &:join
The text was updated successfully, but these errors were encountered:
* master: (45 commits)
Add regression test for #378
Bump to 0.8.6
Add fallback_in_progress to RESERVED_KEYS list
Bump to 0.8.5
Fixes#369 thread issue when calling translate with fallbacks
Remove gemfiles/Gemfile.*.lock from the repo
Improve error message for missing pluralization key
Bump to 0.8.4
Revert "Don't allow nil to be submitted as a key to i18n.translate()"
Bump to 0.8.3
Update Changelog
Handle false as a key correctly
Bump Gemfiles
Bump to 0.8.2
Add Gemfile.lock for each Rails version
Bump to 0.8.1
Fix transliteration to default replacement char
Docs: Add 0.8.0 to changelog
No need to skip ruby 2.4+ x rails 4 now
CI against newest stable rubies for each minor version
...
What I tried to do
I ran a rails application in a threaded environment with calls to I18n.t where there is no translation in my locale but there is a translation in a fallback locale
What I expected to happen
I expected I18n.t to return the translation string from the fallback locale
What actually happened
Occasionally and unpredictably I received a missing translation error
Versions of i18n, rails, and anything else you think is necessary
i18n version 0.8.1. I was previously using version 0.7.0 and did not experience this issue.
This code reproduces the issue fairly reliably with i18n 0.8.1 but works properly with 0.7.0
The text was updated successfully, but these errors were encountered: