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
We do some manipulations to the loaded translations like parsing markdown and writing the results back to the translation hashes. This now throws a can't modify frozen Hash error when trying to set a key on that hash.
I wonder why this is? Can someone elaborate why the files are loaded with freeze: true? Is this for performance reasons?
And what would a good way of customize this? For now I can only think of monkey patching the load_yml and load_json method, even if it's very ugly and complicates future gem updates.
Or is there some hook or custom backend or anything like this, that would be better than monkey patching the method?
The text was updated successfully, but these errors were encountered:
I noticed when upgrading to Ruby 3.1, that this lines causes the loaded hashes to be frozen:
i18n/lib/i18n/backend/base.rb
Lines 248 to 250 in 32c957e
and
i18n/lib/i18n/backend/base.rb
Lines 264 to 266 in 32c957e
We do some manipulations to the loaded translations like parsing markdown and writing the results back to the translation hashes. This now throws a
can't modify frozen Hash
error when trying to set a key on that hash.I wonder why this is? Can someone elaborate why the files are loaded with
freeze: true
? Is this for performance reasons?And what would a good way of customize this? For now I can only think of monkey patching the
load_yml
andload_json
method, even if it's very ugly and complicates future gem updates.Or is there some hook or custom backend or anything like this, that would be better than monkey patching the method?
The text was updated successfully, but these errors were encountered: