Method: I18n::Processes::Command::Commands::Preprocessing#keys_source

Defined in:
lib/i18n/processes/command/commands/preprocessing.rb

#keys_source(dic, path, locale) ⇒ Object



48
49
50
51
52
53
54
55
56
# File 'lib/i18n/processes/command/commands/preprocessing.rb', line 48

def keys_source(dic, path, locale)
  filename = path + locale
  File.delete(filename) if File.exist?(filename)
  local_file = File.new(filename, 'w')
  dic.map do |key, value|
    value.include?("\n") ? local_file.write("#{key}=#{value}") : local_file.write("#{key}=#{value}\n")
  end
  local_file.close
end