-
-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Breaking change in v1.13.0, strings are now being returned frozen #658
Comments
If you use Easiest way to fix this for v1.13.0 might be to add a interpolated ? interpolated_string : string.dup |
Thanks, I tried this fix and it solves a problem with gitlab which stops working on some pages if i18n 1.13.0 is installed. |
alternatively, can you just always return Can you provide a test to reproduce? (I'm not a committer, so feel free to ignore my suggestions) |
With version v1.13.0 code was changed that returns a frozen string. This breaks e.g. gitlab-ce on some pages. Geoffrey Mainland ([email protected]) pointed to the issue logged upstream: ruby-i18n/i18n#658 PR: 271420 PR: 271356 Approved by: sunpoet (maintainer)
What I tried to do
Invoked
I18n.t
What I expected to happen
An unfrozen string to be returned (like in v1.12.0)
What actually happened
A frozen string was returned
Versions of i18n, rails, and anything else you think is necessary
i18n: v1.13.0
Rails: 6.0.6.1
Translations: In a yml file
The issue is the conditional return statement introduced in this commit: be2f3a0
The prior version would always return the result of
gsub
, which has the effect of "unfreezing" a frozen string. By adding a code path where the original string can be returned, the frozen string loaded from the yaml can now be returned.Workaround: For now, we will version pin to the prior version, v1.12.0
The text was updated successfully, but these errors were encountered: