-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Regression with leading zero keys #456
Comments
Thanks for letting us know about it. It seems like you know the solution already. Please submit a PR to fix it. |
oleksii-leonov
added a commit
to oleksii-leonov/i18n
that referenced
this issue
Jan 6, 2019
Envek
added a commit
to Envek/i18n
that referenced
this issue
Feb 26, 2019
They should be treated consistently with other integer-like keys. See [ruby-i18n#456] and [ruby-i18n#457] for reference. [ruby-i18n#456]: ruby-i18n#456 [ruby-i18n#457]: ruby-i18n#457
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What I tried to do
With next localization keys:
I18n
version1.1.1
it works fine:I18n
version1.4.0
didn't work:What I expected to happen
Behavior should be consistent with version
1.1.1
.What actually happened
Behavior changed.
Versions of i18n, rails, and anything else you think is necessary
Changes was introduced in 38732a6
i18n/lib/i18n.rb
Line 368 in 38732a6
I believe, i18n should't try convert keys to number if key starts with
0
.So, regexp:
i18n/lib/i18n.rb
Line 367 in 38732a6
should be changed with:
\A[-+]?[1-9]\d*\z
.This way strings like
12345
would be converted to numbers, but strings like0001
stay untouched.The text was updated successfully, but these errors were encountered: