KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Could you tell me whats the best practice for storing constants with internationalization in rails3? f.e. i want to have a constant-hash for haircolours for my user model: # btw: how can I store such hashes in the locales.yml-files? # en.yml HAIR_COLOURS = { "brown" => 0, "white" => 1, "red" => 2, "dark-brown" => 3...} # de.yml HAIR_COLOURS = { "braun" => 0, "weiss" => 1, "rot" => 2, "dunkel-braun" => 3...} # i18n.default_locale = :de User.find(1).haircolour => 0 User.find(1).haircolour_str => "brown" # i18n.default_locale = :de User.find(1).haircolour => 0 User.find(1).haircolour_str => "braun"
Tags (comma-separated)
Save Edits
Cancel