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

No detecting use of locale keys on form helpers #554

Open
fguillen opened this issue Mar 29, 2024 · 3 comments
Open

No detecting use of locale keys on form helpers #554

fguillen opened this issue Mar 29, 2024 · 3 comments

Comments

@fguillen
Copy link

The use of the locale key activerecord.attributes.user.password is not detected even if it is used in a form helper like:

<%= f.label :password %>

Is this expected? is it a limitation of the library? or is a bug or something I am doing wrong?

@davidwessman
Copy link
Collaborator

There are no matchers for this case unfortunately. You can take inspiration from the different matchers we have added for model attributes and email subjects.

@fguillen
Copy link
Author

fguillen commented Apr 4, 2024

Hi @davidwessman thanks for checking it out. I assume you mean this example matcher.

I confess it looks like it would be a nightmare to try to infer what model is being used in a f.label tag. I assume we should have to parse all .erb looking for the proper model for the form. Not talking when the f.label is in a partial not including the parent form.

Do you have any idea if this can be achievable for the task i18n-tasks missing?

@davidwessman
Copy link
Collaborator

Yeah, or add some magic comment for the form-model or something like that.

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

No branches or pull requests

2 participants