Class: Fastlane::Helper::BatchTranslationProcessor
- Inherits:
-
Object
- Object
- Fastlane::Helper::BatchTranslationProcessor
- Defined in:
- lib/fastlane/plugin/translate/helper/batch_translation_processor.rb
Class Method Summary collapse
Class Method Details
.process_batch(batch, source_lang, target_lang, formality, progress) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/fastlane/plugin/translate/helper/batch_translation_processor.rb', line 11 def self.process_batch(batch, source_lang, target_lang, formality, progress) # Prepare batch for DeepL API texts_to_translate = batch.map { |_, data| data['source_text'] } # Build translation options = (formality, batch) # Call DeepL API translations = DeepL.translate(texts_to_translate, source_lang, target_lang, ) # Process and save translations save_batch_translations(batch, translations, progress) end |