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

herbgobbler gets confused in devise/registrations/edit.html.erb #22

Open
ceigel opened this issue Nov 15, 2014 · 2 comments
Open

herbgobbler gets confused in devise/registrations/edit.html.erb #22

ceigel opened this issue Nov 15, 2014 · 2 comments

Comments

@ceigel
Copy link

ceigel commented Nov 15, 2014

Herbgobbler gets confused on the following line:

Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>

This is what it generates

<%= t '.unhappy', :button_to => (button_to (t '.cancel_my_1'), registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete) %>

en.yml:
cancel_my_1: "Cancel my account"
unhappy: "Unhappy? %{button_to}"

In my opinion, this would be simpler like this:

t('.unhappy') <%= button_to t('.cancel_my'), registration_path(resource_name), data: { confirm: t('.are_you_sure')}, method: :delete %>

@douglasjsellers
Copy link
Owner

That's hard. It very situational. Distinguishing between your snippet and

Unhappy? <%= button_to "Yes" %> or <%= button_to "No" %>?

is hard to do in a generic way.

@ceigel
Copy link
Author

ceigel commented Nov 19, 2014

Well, you'd have basically 3 translations.
t('.unhappy') <%= button_to t('.yes') %> or <%= button_to t('.no') %>?
In this case, gobbler does a lot more than it should... And also, this is what rails displays:

Unhappy?

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