Module: LokaliseManager

Defined in:
lib/lokalise_manager.rb,
lib/lokalise_manager/error.rb,
lib/lokalise_manager/version.rb,
lib/lokalise_manager/global_config.rb,
lib/lokalise_manager/utils/hash_utils.rb,
lib/lokalise_manager/task_definitions/base.rb,
lib/lokalise_manager/task_definitions/exporter.rb,
lib/lokalise_manager/task_definitions/importer.rb

Overview

The LokaliseManager module provides functionalities to import and export translation files to and from the Lokalise TMS. It simplifies interactions with the Lokalise API by providing a straightforward interface to instantiate importers and exporters.

Example:

importer = LokaliseManager.importer(api_token: '1234abc', project_id: '123.abc')
exporter = LokaliseManager.exporter(api_token: '1234abc', project_id: '123.abc')
importer.import!
exporter.export!

Defined Under Namespace

Modules: TaskDefinitions, Utils Classes: Error, GlobalConfig

Constant Summary collapse

VERSION =
'6.0.0'

Class Method Summary collapse

Class Method Details

.exporter(custom_opts = {}, global_config = LokaliseManager::GlobalConfig) ⇒ LokaliseManager::TaskDefinitions::Exporter

Creates an exporter object for uploading translation files to Lokalise.

Parameters:

  • custom_opts (Hash) (defaults to: {})

    Custom options for the exporter (e.g., API token and project ID).

  • global_config (Object) (defaults to: LokaliseManager::GlobalConfig)

    Global configuration settings, defaults to LokaliseManager::GlobalConfig.

Returns:



37
38
39
# File 'lib/lokalise_manager.rb', line 37

def exporter(custom_opts = {}, global_config = LokaliseManager::GlobalConfig)
  LokaliseManager::TaskDefinitions::Exporter.new custom_opts, global_config
end

.importer(custom_opts = {}, global_config = LokaliseManager::GlobalConfig) ⇒ LokaliseManager::TaskDefinitions::Importer

Creates an importer object for downloading translation files from Lokalise.

Parameters:

  • custom_opts (Hash) (defaults to: {})

    Custom options for the importer (e.g., API token and project ID).

  • global_config (Object) (defaults to: LokaliseManager::GlobalConfig)

    Global configuration settings, defaults to LokaliseManager::GlobalConfig.

Returns:



27
28
29
# File 'lib/lokalise_manager.rb', line 27

def importer(custom_opts = {}, global_config = LokaliseManager::GlobalConfig)
  LokaliseManager::TaskDefinitions::Importer.new custom_opts, global_config
end