module WebTranslateIt
Public Class Methods
fetch_translations()
click to toggle source
# File lib/web_translate_it.rb, line 31 def self.fetch_translations # rubocop:todo Metrics/AbcSize config = Configuration.new locale = I18n.locale.to_s return if config.ignore_locales.include?(locale) config.logger&.debug { " Fetching #{locale} language file(s) from WebTranslateIt" } WebTranslateIt::Connection.new(config.api_key) do |http| config.files.find_all { |file| file.locale.in?([locale, I18n.locale]) }.each do |file| file.fetch(http) end end end