Skip to content

Commit

Permalink
Only uses AST-parser for .html.erb
Browse files Browse the repository at this point in the history
- Fixes #537
  • Loading branch information
davidwessman committed Dec 30, 2023
1 parent 30b7703 commit 56bd296
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Unreleased

* ErbAst-parser now only used for `*.html.erb`-files, not e.g. `*.js.erb`

## v1.0.13

* OpenAI translator.
Expand Down
4 changes: 2 additions & 2 deletions lib/i18n/tasks/used_keys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ module UsedKeys # rubocop:disable Metrics/ModuleLength
relative_roots: %w[app/controllers app/helpers app/mailers app/presenters app/views].freeze,
scanners: [
['::I18n::Tasks::Scanners::RubyAstScanner', { only: %w[*.rb] }],
['::I18n::Tasks::Scanners::ErbAstScanner', { only: %w[*.erb] }],
['::I18n::Tasks::Scanners::PatternWithScopeScanner', { exclude: %w[*.erb *.rb] }]
['::I18n::Tasks::Scanners::ErbAstScanner', { only: %w[*.html.erb] }],
['::I18n::Tasks::Scanners::PatternWithScopeScanner', { exclude: %w[*.html.erb *.rb] }]
],
ast_matchers: [],
strict: true
Expand Down
2 changes: 2 additions & 0 deletions spec/fixtures/app/views/ignore.js.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This is javascript file
<% # i18n-tasks-use t('hello.world') %>

0 comments on commit 56bd296

Please sign in to comment.