Created
November 1, 2010 14:27
-
-
Save ch1ago/658245 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.translate_hash_keys(source) | |
r = {} | |
source.each { |k,v| r[I18n.t k] = v } | |
r | |
end | |
BACKGROUND_REPEAT_POLICIES = {0=>'no-repeat',1=>'repeat'}#repeat-X, repeat-Y | |
GENDERS = {'-'=>'0','model.user.gender.female'=>'1','model.user.gender.male'=>'2'} | |
BIRTH_POLICIES = {'model.user.birth_policy.dm'=>0,'model.user.birth_policy.dmy'=>1,'model.user.birth_policy.nothing'=>2} | |
LOCALES = {'locales.en' => "en",'locales.pt-BR' => "pt-BR"} | |
def self.GENDERS | |
MyFunctions.translate_hash_keys(User::GENDERS) | |
end | |
def self.BIRTH_POLICIES | |
MyFunctions.translate_hash_keys(User::BIRTH_POLICIES) | |
end | |
def self.LOCALES | |
MyFunctions.translate_hash_keys(User::LOCALES) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment