Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Tm
- def self.hi
- puts "Hey Tm here for duty!"
- end
- def auxload(hash, lang, concat='')
- ans = {}
- hash.each do |key, val|
- if val.class == Hash
- aux = auxload(val, lang, concat+key+'.')
- aux.each do |k, v|
- ans[k]=v
- end
- else
- ans[concat+key]={lang => val}
- end
- end
- return ans
- end
- # load the translation from the yaml files
- def load_translation(hash)
- key,value = hash.first
- return auxload(value,key)
- end
- end
Add Comment
Please, Sign In to add comment