Translations

This commit is contained in:
Godwin
2014-05-04 15:22:22 -06:00
parent 52e5e10232
commit e5f9dc5666
2 changed files with 18 additions and 6 deletions
+10 -1
View File
@@ -7,7 +7,16 @@ namespace :translations do
translations = YAML.load(File.read('config/locales/.translations.yml')) || Hash.new
translations.each { |k,t|
if t['data']
t['data'].each { |tt| tt.save }
t['data'].each { |tt|
hash = ActiveSupport::JSON.decode(tt)
translation = Translation.find(hash['id'])
if translation
#t.assign_attributes(hash)
translation.update_attributes(hash)
else
Translation.new(hash).save
end
}
end
}
end