Skip to content
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] Cannot look up keys that end in .0 #593

Closed
movermeyer opened this issue Dec 16, 2021 · 0 comments · Fixed by #594
Closed

[BUG] Cannot look up keys that end in .0 #593

movermeyer opened this issue Dec 16, 2021 · 0 comments · Fixed by #594

Comments

@movermeyer
Copy link
Contributor

movermeyer commented Dec 16, 2021

What I tried to do

#457 introduced a bug where 0 was no longer considered an integer, and so lookups of .0 keys fail:

(byebug) I18n.normalize_keys(:se, "fields.day.relative.0", nil, nil)
[:se, :fields, :day, :relative, :"0"]
(byebug) I18n.normalize_keys(:se, "fields.day.relative.1", nil, nil)
[:se, :fields, :day, :relative, 1]

Note that 1 gets normalized as an Integer, but 0 does not.

What I expected to happen

0 would get parsed as an integer.

What actually happened

0 gets parsed as a symbol

Versions of i18n, rails, and anything else you think is necessary

Tested with v1.8.11, present since v1.5.1

Potential solution?

Could fix the regex to include 0. PR incoming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant