lib/i18n/migrations/migrator.rb in i18n-migrations-0.2.5 vs lib/i18n/migrations/migrator.rb in i18n-migrations-1.0.0
- old
+ new
@@ -113,29 +113,31 @@
end
private
def each_locale(name = 'all')
- (name == 'all' ? all_locale_names : [name]).each do |l|
- yield locale_for(l)
+ threads = (name == 'all' ? all_locale_names : [name]).map do |l|
+ locale = locale_for(l)
+ Thread.new {yield locale}
end
+ threads.each(&:join)
end
def all_locale_names
[config.main_locale] + config.other_locales
end
def get_google_spreadsheet(locale)
GoogleSpreadsheet.new(locale,
- config.google_spreadsheets[locale],
+ config.google_spreadsheet(locale),
config.google_service_account_key_path).sheet
end
def new_dictionary(locale)
GoogleTranslateDictionary.new(from_locale: config.main_locale,
to_locale: locale,
key: config.google_translate_api_key,
- do_not_translate: config.do_not_translate)
+ do_not_translate: config.main_locale == locale ? {} : config.do_not_translate(locale))
end
end
end
end