Sha256: 4e089161a0ce5446179f3296178b9dbc1123f1db5378ed5b887e94416d76fe3e
Contents?: true
Size: 550 Bytes
Versions: 11
Compression:
Stored size: 550 Bytes
Contents
require 'easy_translate' module I18n::Tasks::GoogleTranslation def google_translate(strings, opts) return [] if strings.empty? opts = opts.dup if (key = translation_config[:api_key]).present? opts[:key] ||= key end if opts[:key].blank? $stderr.puts(Term::ANSIColor.red Term::ANSIColor.yellow 'You may need to provide Google API key as GOOGLE_TRANSLATE_API_KEY or in config/i18n-tasks.yml. You can obtain the key at https://code.google.com/apis/console.') end EasyTranslate.translate strings, opts end end
Version data entries
11 entries across 11 versions & 1 rubygems