Class: Locomotive::Mounter::Reader::FileSystem::TranslationsReader
- Defined in:
- lib/locomotive/mounter/reader/file_system/translations_reader.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#read ⇒ Hash
Build the list of translations based on the config/translations.yml file.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Locomotive::Mounter::Reader::FileSystem::Base
Instance Method Details
#read ⇒ Hash
Build the list of translations based on the config/translations.yml file
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/locomotive/mounter/reader/file_system/translations_reader.rb', line 12 def read config_path = File.join(self.runner.path, 'config', 'translations.yml') {}.tap do |translations| if File.exists?(config_path) (self.read_yaml(config_path) || []).each do |translation| key, values = translation entry = Locomotive::Mounter::Models::Translation.new({ key: key, values: values }) translations[key] = entry end end end end |