Sha256: 002ceec3aff3b1d36c86d69ad2d57a2b44148d0ddc5a2b1cd10db8d163f2773e
Contents?: true
Size: 643 Bytes
Versions: 12
Compression:
Stored size: 643 Bytes
Contents
module Locomotive::Wagon class PullTranslationsCommand < PullBaseCommand def _pull translations = api_client.translations.all.inject({}) do |hash, translation| translation.values.delete_if { |locale, _| !locales.include?(locale) } hash[translation.key] = translation.values hash end unless translations.empty? write_translations(translations) end end private def write_translations(translations) write_to_file(translations_filepath, dump(translations)) end def translations_filepath File.join('config', 'translations.yml') end end end
Version data entries
12 entries across 12 versions & 1 rubygems