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

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

#preprocessing(opt = {}) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/i18n/processes/command/commands/preprocessing.rb', line 19

def preprocessing(opt = {})
  locale = opt[:locales].include?(base_locale) ? 'zh-CN' : opt[:locales].first
  dic = {}
  origin_files(locale).flatten.each do |file|
    # dic.merge!(origin_file_read(file)) { |key, v1, v2| fail "conflict: #{key}: #{v1}, #{v2} in #{file}" unless v1 == v2 }
    dic.merge!(origin_file_read(file))
  end
  path = compare_path.first
  keys_source(dic, path, locale)
  $stderr.puts Rainbow('fetch all keys and values from origin files').green if locale == base_locale
end