Class: LokaliseManager::TaskDefinitions::Importer

Inherits:
Base
  • Object
show all
Defined in:
lib/lokalise_manager/task_definitions/importer.rb

Overview

The Importer class handles downloading translation files from Lokalise and importing them into the specified project directory.

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#api_client, #initialize, #reset_api_client!

Constructor Details

This class inherits a constructor from LokaliseManager::TaskDefinitions::Base

Instance Method Details

#import!Boolean

Initiates the import process by checking configuration, ensuring safe mode conditions, downloading files, and processing them. Outputs task completion status.

Returns:

  • (Boolean)

    Returns true if the import completes successfully, false if cancelled.



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/lokalise_manager/task_definitions/importer.rb', line 16

def import!
  check_options_errors!

  unless proceed_when_safe_mode?
    $stdout.print('Task cancelled!') unless config.silent_mode
    return false
  end

  open_and_process_zip download_files.bundle_url

  $stdout.print('Task complete!') unless config.silent_mode
  true
end