Class: I18n::Tasks::Translators::DeeplTranslator
- Inherits:
-
BaseTranslator
- Object
- BaseTranslator
- I18n::Tasks::Translators::DeeplTranslator
- Defined in:
- lib/i18n/tasks/translators/deepl_translator.rb
Constant Summary collapse
- BATCH_SIZE =
max allowed texts per request
50
- SPECIFIC_TARGETS =
those languages must be specified with their sub-kind e.g en-us
%w[en pt].freeze
Constants included from Logging
Logging::MUTEX, Logging::PROGRAM_NAME
Instance Method Summary collapse
-
#initialize ⇒ DeeplTranslator
constructor
A new instance of DeeplTranslator.
Methods inherited from BaseTranslator
Methods included from Logging
log_error, log_stderr, log_verbose, log_warn, program_name, warn_deprecated
Constructor Details
#initialize ⇒ DeeplTranslator
Returns a new instance of DeeplTranslator.
12 13 14 15 16 17 18 19 20 |
# File 'lib/i18n/tasks/translators/deepl_translator.rb', line 12 def initialize(*) begin require 'deepl' rescue LoadError raise ::I18n::Tasks::CommandError, "Add gem 'deepl-rb' to your Gemfile to use this command" end super configure_api_key! end |