class Locomotive::Steam::Adapters::Filesystem::YAMLLoaders::Translation

Public Instance Methods

load(scope) click to toggle source
# File lib/locomotive/steam/adapters/filesystem/yaml_loaders/translation.rb, line 11
def load(scope)
  super
  load_array
end

Private Instance Methods

_load_from_env() click to toggle source
# File lib/locomotive/steam/adapters/filesystem/yaml_loaders/translation.rb, line 28
def _load_from_env
  safe_json_file_load(File.join(site_path, 'data', env.to_s, 'translations.json'))
end
load_array() click to toggle source
# File lib/locomotive/steam/adapters/filesystem/yaml_loaders/translation.rb, line 18
def load_array
  all = env == :local ? _load(path) : _load_from_env

  [].tap do |array|
    (all || {}).each do |key, values|
      array << { key: key.to_s, values: HashConverter.to_string(values) }
    end
  end
end
path() click to toggle source
# File lib/locomotive/steam/adapters/filesystem/yaml_loaders/translation.rb, line 32
def path
  File.join(site_path, 'config', 'translations.yml')
end