Skip to content

v0.9.15

Compare
Choose a tag to compare
@glebm glebm released this 02 May 02:20
· 335 commits to main since this release

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' %>