lib/Processors/GoogleTranslateProcessor.rb in ZReviewTender-1.1.1 vs lib/Processors/GoogleTranslateProcessor.rb in ZReviewTender-1.2.0

- old
+ new

@@ -28,10 +28,12 @@ @targetLang = Helper.unwrapRequiredParameter(config, "googleTranslateTargetLang") @territoriesExclude = [] if !config['googleTranslateTerritoriesExclude'].nil? && config['googleTranslateTerritoriesExclude'].length > 0 @territoriesExclude = config['googleTranslateTerritoriesExclude'] end + + puts "[GoogleTranslateProcessor] Init Success." end def processReviews(reviews, platform) if reviews.length < 1 return reviews @@ -39,9 +41,11 @@ reviews.each_index do |index| if territoriesExclude.include? reviews[index].territory next end + + puts "[GoogleTranslateProcessor] translate #{reviews[index].body} from #{reviews[index].territory} to #{targetLang}" if !reviews[index].title.nil? reviews[index].title = "#{client.translate reviews[index].title, to: targetLang} (#{reviews[index].title})" end body = "#{client.translate reviews[index].body, to: targetLang}" \ No newline at end of file