Closed lagartoflojo closed 11 years ago
Locales are case insensitive, downcasing them all is the Right Thing To Do.
Ok, but as the gem works right now, when a user requests the locale "es-CL", and I have an "es-CL.yml" file in my app, it does not pick it up, and instead falls back to default_locale.
I've pulled your fix in, that's totally correct. Thanks!
It's common to have locale names with upper case letters. For example, in Rails you might have an
en-US.yml
file. LocaleSetter downcases the requested locales and assumes that available locales are also in lower case. I've fixed this by generating a hash as a lookup table where the key is the locale name in lower case, and the value is the original locale name. I don't like it very much, because it generates the loopup table every time, but it works.Here's the commit, test included: https://github.com/familink/locale_setter/commit/23785d25b6ed2013eec74b8327a70761bb254088