Module: YamlLocalesJsonizer::Loader

Extended by:
Loader
Included in:
Loader
Defined in:
lib/yaml_locales_jsonizer/loader.rb

Instance Method Summary collapse

Instance Method Details

#localesObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/yaml_locales_jsonizer/loader.rb', line 4

def locales
  locale_files.reduce({}) do |locales, file|
    langdata = YAML.load_file file

    langdata.each_pair do |lang, translations|
      locales[lang] ||= style.empty_locale
      style.add_to_locale locales[lang], translations
    end

    locales
  end
end