Method: WebTranslateIt::Configuration#reload

Defined in:
lib/web_translate_it/configuration.rb

#reloadObject

Reload project data



42
43
44
45
46
47
48
49
50
# File 'lib/web_translate_it/configuration.rb', line 42

def reload # rubocop:todo Metrics/AbcSize
  project_info = JSON.parse WebTranslateIt::Project.fetch_info(api_key)
  self.ignore_locales = locales_to_ignore(configuration)
  self.needed_locales = locales_needed(configuration)
  self.files = files_from_project(project_info['project'])
  self.source_locale = source_locale_from_project(project_info['project'])
  self.target_locales = target_locales_from_project(project_info['project'])
  self.project_name = project_info['project']['name']
end