This project is archived and is in readonly mode.
ActionView::Helpers::TranslationHelper#translate call I18n with different arguments depending on render method parameter
Reported by Robert Pankowecki | November 15th, 2010 @ 02:44 PM | in 3.0.6
# app/views/service/search/results.html.erb
<%= t(".translate.me") %>
Case 1:
<%= render :partial => '/service/search/results' %>
leads to calling
I18n.t(".service/search/results.translate.me")
which I think is wrong
Case 2:
<%= render :partial => 'service/search/results' %>
leads to calling
I18n.t("service/search/results.translate.me")
which is ok.
Comments and changes to this ticket
-
Robert Pankowecki November 15th, 2010 @ 02:45 PM
- Tag changed from action_view, i18n, partial, translate, translation_helper to action_view, i18n, partial, rails3, translate, translation_helper
-
Aditya Sanghi November 16th, 2010 @ 04:30 PM
- State changed from new to open
- Milestone cleared.
- Assigned user set to José Valim
- Tag changed from action_view, i18n, partial, rails3, translate, translation_helper to action_view, i18n, partial, patch, rails3, translate, translation_helper
- Importance changed from to Low
I can see the problem. Robert please confirm but i think you meant
.service.search.results.translate.me
not
.service/search/results.translate.me
What would work is t("service.search.results.translate.me")
Adding test and patch.
-
Robert Pankowecki November 16th, 2010 @ 04:56 PM
Yes, that's what I meant. My mistake.
Thanks for the fix.
The patch and test look fine for me. -
Aditya Sanghi November 16th, 2010 @ 09:40 PM
- State changed from open to verified
-
José Valim November 17th, 2010 @ 07:27 AM
Hey, thanks for the patch! However, it is only half of the solution! If you are rendering the same files and they are having different @virtual_path, this means we have a another bigger problem to solve.
I will take a look at this later, apply your patch and fix the counter-part.
-
Santiago Pastorino February 27th, 2011 @ 03:15 AM
- Milestone changed from 3.0.5 to 3.0.6
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>