Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable use of rails model matcher in i18n-tasks.yml ast_matchers #512

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

brad-ellert
Copy link
Contributor

@brad-ellert brad-ellert commented Jul 11, 2023

# i18n-tasks.yml
  ast_matchers:
    - 'I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher'

As of now, the above does not work, because the proper file is not being included.

# i18n-tasks.yml
  ast_matchers:
    - 'I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher'
@brad-ellert
Copy link
Contributor Author

Or is this something that should go in each project's local i18n-tasks.yml? It also seems to work if I add

<% require 'i18n/tasks/scanners/ast_matchers/rails_model_matcher' %>

à la

<% I18n::Tasks.add_ast_matcher('I18n::Tasks::Scanners::AstMatchers::RailsModelMatcher') %>

from the template. If this is the solution, then it should also be in the template. It seems odd to use ERB syntax in here as is suggested in the template rather than the YAML syntax I showed above.

@davidwessman
Copy link
Collaborator

I think @glebm will have to decide if it should work without the ERB-syntax 🙂

@glebm
Copy link
Owner

glebm commented Jul 12, 2023

Since it's a tiny file that does not actually depend on Rails, I think it's fine to require it by default to simplify the configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants