Class: LokaliseManager::TaskDefinitions::Exporter
- Defined in:
- lib/lokalise_manager/task_definitions/exporter.rb
Overview
Handles exporting translation files from a local project to Lokalise.
Defined Under Namespace
Classes: ProcessResult
Constant Summary collapse
- MAX_THREADS =
Number of files uploaded concurrently in each batch.
6
Constants inherited from Base
Base::BACKOFF_BASE_SECONDS, Base::BACKOFF_CAP_SECONDS, Base::BACKOFF_JITTER_RANGE, Base::CONFIG_KEYS, Base::EXCEPTIONS
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#export! ⇒ Array
Exports translation files to Lokalise in batches to optimize performance.
Methods inherited from Base
#api_client, #initialize, #reset_api_client!
Constructor Details
This class inherits a constructor from LokaliseManager::TaskDefinitions::Base
Instance Method Details
#export! ⇒ Array
Exports translation files to Lokalise in batches to optimize performance.
- Validates configuration.
- Gathers translation files from the project directory.
- Uploads files to Lokalise in parallel and retries rate-limited requests.
- Handles errors and ensures failed uploads are reported.
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/lokalise_manager/task_definitions/exporter.rb', line 22 def export! queued_processes = all_files.each_slice(MAX_THREADS).flat_map do |files_group| parallel_upload(files_group).tap do |results| results.each { |result| raise_on_fail(result) if config.raise_on_export_fail } end end unless config.silent_mode queued_processes end |