-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
In r18n/locale.rb:
r18n-core/lib/r18n-core/locale.rb
Line 121 in f7bc300
| self.class.name.split('::').last.split(/([A-Z][a-z]+)/)[1, 2] |
This line seems to have an easy logic error, because:
$ irb
irb(main):001:1* module R18n
irb(main):002:2* class RuFooBarBaz
irb(main):003:1* end
irb(main):004:1* end
=> nil
irb(main):005:0> l = R18n::RuFooBarBaz.new
=> #<R18n::RuFooBarBaz:0x00007fffdeb58610>
irb(main):006:0> l.class.name.split('::').last.split(/([A-Z][a-z]+)/)[1, 2]
=> ["Ru", ""]
irb(main):007:0> l.class.name.split('::').last.split(/([A-Z][a-z]+)/)
=> ["", "Ru", "", "Foo", "", "Bar", "", "Baz"]Perhaps the problem has been elusive because it was introduced with the parent locale function (2c88300), and no one tried to use different locales under the same parent locale at once.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels