Closed movermeyer closed 2 years ago
https://github.com/ruby-i18n/i18n/pull/457 introduced a bug where 0 was no longer considered an integer, and so lookups of .0 keys fail:
0
.0
(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.
1
0 would get parsed as an integer.
0 gets parsed as a symbol
Tested with v1.8.11, present since v1.5.1
v1.8.11
v1.5.1
Could fix the regex to include 0. PR incoming.
What I tried to do
https://github.com/ruby-i18n/i18n/pull/457 introduced a bug where
0
was no longer considered an integer, and so lookups of.0
keys fail:Note that
1
gets normalized as an Integer, but0
does not.What I expected to happen
0
would get parsed as an integer.What actually happened
0
gets parsed as a symbolVersions of i18n, rails, and anything else you think is necessary
Tested with
v1.8.11
, present sincev1.5.1
Potential solution?
Could fix the regex to include
0
. PR incoming.