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

With the new parser, some key usage is not found #424

Closed
mvz opened this issue Mar 24, 2022 · 2 comments · Fixed by #425
Closed

With the new parser, some key usage is not found #424

mvz opened this issue Mar 24, 2022 · 2 comments · Fixed by #425

Comments

@mvz
Copy link
Contributor

mvz commented Mar 24, 2022

With the update to version 1.0.0 (and still with 1.0.1), I started to get some new reported unused keys. I have confirmed that these are in fact used, and it seems they're all used in keyword arguments for method calls that take blocks. For example, in the following code the .edit key is not found and its corresponding translation is reported as unused.

<%= link_to(edit_foo_path(foo), title: t(".edit")) do %>
  <i class="fa fa-edit icon-fa"></i>
<% end %>
@davidwessman
Copy link
Collaborator

Thanks for an example, will add it to the specs and fix it 🙂

davidwessman added a commit to davidwessman/i18n-tasks that referenced this issue Mar 24, 2022
- Fixes glebm#424 by allowing blocks to be parsed by ignoring `do`.
- Adds specs for block calls.
- Changes structure for erb tests to test relative keys as well.
- Inspired by
https://github.com/Shopify/better-html/blob/087943ffd2a5877fa977d71532010b0c91239519/lib/better_html/test_helper/ruby_node.rb#L24
glebm pushed a commit that referenced this issue Mar 24, 2022
- Fixes #424 by allowing blocks to be parsed by ignoring `do`.
- Adds specs for block calls.
- Changes structure for erb tests to test relative keys as well.
- Inspired by
https://github.com/Shopify/better-html/blob/087943ffd2a5877fa977d71532010b0c91239519/lib/better_html/test_helper/ruby_node.rb#L24
@mvz
Copy link
Contributor Author

mvz commented Mar 24, 2022

Thanks for fixing this, @davidwessman!

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 a pull request may close this issue.

2 participants