i18n-0.1.3 fails with...
interning empty string
[RAILS_ROOT]/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb:196:in `to_sym'
...in i18n.rb:196 when calling
model.errors[:field] after having called
model.errors.add(:field, 'custom message with two or more
consecutive periods .. in the middle')
This is because split(/\./) with return at least
one empty string when two or more consecutive periods appear in the
middle or at the beginning of the string to be split.
keys = [locale] + Array(scope) + [key]
keys = keys.map { |k| k.to_s.split(/\./) }
keys.flatten.map { |k| k.to_sym }
should probably be changed to something like:
keys = [locale] + Array(scope) + [key]
keys = keys.map { |k| k.to_s.split(/\./) }
keys.flatten.reject(&:empty?).map { |k| k.to_sym }
...or change the regexp to /\.+/ etc.
Cheers,
V.