Skip to content

Instantly share code, notes, and snippets.

@ahawkins
Created October 27, 2011 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahawkins/1319411 to your computer and use it in GitHub Desktop.
Save ahawkins/1319411 to your computer and use it in GitHub Desktop.
(rdb:2) translations.keys
[:"en-us", :"de-ch", :en, :fi, :"en-gb"]
(rdb:2) translations[:fi]
nil
(rdb:2) translations[:en]
{:invitation_mailer=>{:rejection_notification=>{:description=>"%{name} has rejected your invitation! You can reply to this email if\nyou'd like to contact them. They can still confirm later if they want.\nThey will still rece ... you the the point }
(rdb:2)
translations.keys
(rdb:2) [:"en-us", :"de-ch", :en, :fi, :"en-gb"]
translations.delete(:"en-us")
translations.delete(:"de-ch")
translations.delete(:en)
translations.delete(:"en-gb")
(rdb:2) translations.keys
[:fi]
(rdb:2) translations[translations.keys.first]
# a ton of finnish
(rdb:2) translations.keys[:fi]
nil
(rdb:2) translations.keys
[:fi, :"en-gb", :en, :"en-us", :"de-ch"]
(rdb:2) translations.keys.first == :fi # HMMMM. Highly suspect <------------ WTF!
false
(rdb:2) translations.keys.first
:fi
(rdb:2) translations.keys[2] == :en
true
(rdb:2) translations[:en]
# a ton of english
(rdb:2) translations[:fi]
# nil
(rdb:2) translations[translations.keys.first]
# a ton of finnish
# Jesus christ!
/Users/adam/.rvm/gems/ree-1.8.7-2011.03/gems/i18n-0.6.0/lib/i18n/backend/simple.rb:33
locale = locale.to_sym
(rdb:1) locale
"fi"
(rdb:1) locale
"fi"
(rdb:1) locale == "fi"
false
(rdb:1) locale <=> "fi"
1
(rdb:1) locale.length
5
(rdb:1) "fi".length
2
(rdb:1) locale.bytes
#<Enumerable::Enumerator:0x10ba360b8>
(rdb:1) locale.bytes.map(&:to_s)
["239", "187", "191", "102", "105"]
(rdb:1) "fi".bytes.map(&:to_s)
["102", "105"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment