Module: I18n::Tasks::Ar::Generate

Defined in:
lib/i18n/tasks/ar/generate.rb

Class Method Summary collapse

Class Method Details

.attribute(lang) ⇒ Object



16
17
18
19
20
# File 'lib/i18n/tasks/ar/generate.rb', line 16

def attribute lang
  result = Attribute.final_hash(lang).to_yaml
  FileUtils.mkdir_p('config/locales') unless File.exists?('config/locales')
  File.open("config/locales/activerecord.attributes.#{lang}.yml", 'w+') {|f| f.write(result) }
end

.attributesObject



22
23
24
# File 'lib/i18n/tasks/ar/generate.rb', line 22

def attributes
  I18n::Tasks::Ar::Config.locales.each{|locale| attribute(locale)}
end

.model(lang) ⇒ Object



6
7
8
9
10
# File 'lib/i18n/tasks/ar/generate.rb', line 6

def model lang
  result = Model.final_hash(lang).to_yaml
  FileUtils.mkdir_p('config/locales') unless File.exists?('config/locales')
  File.open("config/locales/activerecord.models.#{lang}.yml", 'w+') {|f| f.write(result) }
end

.modelsObject



12
13
14
# File 'lib/i18n/tasks/ar/generate.rb', line 12

def models
  I18n::Tasks::Ar::Config.locales.each{|locale| model(locale)}
end