downcasing issue #1

Closed
craibuc opened this Issue Mar 5, 2010 · 1 comment

Projects

None yet

2 participants

@craibuc
craibuc commented Mar 5, 2010

I was attempting to use <%= I18n.t user_language.languageCode, :scope => 'languages' %> in my application to convert 'en-US' to 'U.S. English'. Doing so resulted in an error that read 'translation missing: en, languages, en-us'.

Upon further investigation, I noticed that the value stored in my database was actually 'en-us', not 'en-US'.

This led me to look at the SELECT tag in my HTML page. For U.S. English, the HTML read 'U.S. English'.

Next I looked at the 'en.rb' file. In there, the U.S. English entry reads '"en-US" => "U.S. English"'.

Changing this line:

I18n.translate(:languages).map { |key, value| [value, key.to_s.downcase] }.sort

to:

I18n.translate(:languages).map { |key, value| [value, key.to_s] }.sort

in the localized_language_select.rb seems to have addressed the issue.

@davec
Owner
davec commented Mar 8, 2010

Don't downcase the language tags. Closed by ddc2408

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment