Manage translation and localization with static analysis, for Ruby i18n
Adds the DeepL Machine Translation service. #294 -- Thanks @neumayr!
You can use it by passing --backend=deepl
to translate-missing
:
i18n-tasks translate-missing --backend deepl
Like Google Translate, DeepL also requires an API key. It can be set either via the DEEPL_AUTH_KEY
environment variable, or by setting translation.deepl_api_key
in i18n-tasks.yml
.
Relaxes the rainbow
dependency version restriction.
data.external
, for locale data from external dependencies (e.g. gems).
This locale data is never considered unused, and is never modified by i18n-tasks. #264
t @instance_variable, scope: :static_scope
in the non-AST scanner.
#1d2c6d0c
remove-unused
not removing entire files. #260
normalize
not removing emptied files. #263
Fixes support for calls such as t dynamic_key, scope: :static_scope
in non-AST mode. #255
Adds a new task, check-normalized
, and the corresponding specs, to verify that all the locale files are normalized. #249
Fixes an issue with normalization not happening in certain cases. #91b593d7
There is now a minitest template file available. #250
Internally, Erubi is now used instead of Erubis for parsing the config file. #247
Improves handling of interpolations in translate-missing
when multiple interpolations are present.
Adds new configuration options to the built-in scanners to enable support for non-standard messages and receivers.
For example, to support the it
gem:
# lib/i18n_tasks_it.rb
# The "it" gem support for i18n-tasks
I18n::Tasks.add_scanner(
'::I18n::Tasks::Scanners::RubyAstScanner',
receiver_messages: [nil, AST::Node.new(:const, [nil, :It])].product(%i[it]),
only: %w[*.rb]
)
I18n::Tasks.add_scanner(
'::I18n::Tasks::Scanners::PatternWithScopeScanner',
translate_call: /(?<=^|[^\w'\-.]|[^\w'\-]It\.|It\.)it/,
exclude: %w[*.rb]
)
# config/i18n-tasks.yml.erb
<% require './lib/i18n_tasks_it' %>
This release replaces a GPL-licensed dependency, Term::ANSIColor
, with the MIT-licensed Rainbow gem.
Thanks to @ypresto for discovering and fixing the issue.