lib/lokalise_manager.rb in lokalise_manager-5.1.0 vs lib/lokalise_manager.rb in lokalise_manager-5.1.2
- old
+ new
@@ -4,37 +4,37 @@
require 'yaml'
loader = Zeitwerk::Loader.for_gem
loader.setup
-# LokaliseManager main module that exposes helper methods:
+# 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.
#
-# importer = LokaliseManager.importer api_token: '1234abc', project_id: '123.abc'
-# exporter = LokaliseManager.exporter api_token: '1234abc', project_id: '123.abc'
-#
-# Use the instantiated objects to import or export your translation files:
-#
+# 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!
#
module LokaliseManager
class << self
- # Initializes a new importer client which is used to download
- # translation files from Lokalise to the current project
+ # Creates an importer object for downloading translation files from Lokalise.
#
- # @return [LokaliseManager::TaskDefinitions::Importer]
- # @param custom_opts [Hash]
- # @param global_config [Object]
+ # @param custom_opts [Hash] Custom options for the importer (e.g., API token and project ID).
+ # @param global_config [Object] Global configuration settings, defaults to LokaliseManager::GlobalConfig.
+ # @return [LokaliseManager::TaskDefinitions::Importer] An instance of the importer.
+ #
def importer(custom_opts = {}, global_config = LokaliseManager::GlobalConfig)
LokaliseManager::TaskDefinitions::Importer.new custom_opts, global_config
end
- # Initializes a new exporter client which is used to upload
- # translation files from the current project to Lokalise
+ # Creates an exporter object for uploading translation files to Lokalise.
#
- # @return [LokaliseManager::TaskDefinitions::Exporter]
- # @param custom_opts [Hash]
- # @param global_config [Object]
+ # @param custom_opts [Hash] Custom options for the exporter (e.g., API token and project ID).
+ # @param global_config [Object] Global configuration settings, defaults to LokaliseManager::GlobalConfig.
+ # @return [LokaliseManager::TaskDefinitions::Exporter] An instance of the exporter.
+ #
def exporter(custom_opts = {}, global_config = LokaliseManager::GlobalConfig)
LokaliseManager::TaskDefinitions::Exporter.new custom_opts, global_config
end
end
end