Class: Translation
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Translation
- Defined in:
- app/models/translation.rb
Class Method Summary collapse
-
.dump_all(to = self.locales_config_path) ⇒ Object
create one yml per locale.
Class Method Details
.dump_all(to = self.locales_config_path) ⇒ Object
create one yml per locale
11 12 13 14 15 16 17 18 19 |
# File 'app/models/translation.rb', line 11 def self.dump_all(to = self.locales_config_path) I18n.available_locales.each do |locale| File.open("#{to}/#{locale}.yml", "w+") do |file| hash = to_hash(locale) hash = { locale.to_s => {} }if hash.size == 0 YAML.dump(hash, file) end end end |