Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

ActionView::Helpers::TranslationHelper#translate call I18n with different arguments depending on render method parameter

#5976
# 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.

Reported by Robert Pankowecki · November 15th, 2010 @ 02:44 PM

State: verified
Milestone: 3.0.6
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Robert Pankowecki
    Robert Pankowecki
    • Tag changed from action_view, i18n, partial, translate, translation_helper to action_view, i18n, partial, rails3, translate, translation_helper

    November 15th, 2010 @ 02:45 PM

  2. Aditya Sanghi
    Aditya Sanghi
    • 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.

    November 16th, 2010 @ 04:30 PM

  3. Robert Pankowecki
    Robert Pankowecki

    Yes, that's what I meant. My mistake.
    Thanks for the fix.
    The patch and test look fine for me.

    November 16th, 2010 @ 04:56 PM

  4. Aditya Sanghi
    Aditya Sanghi
    • State changed from open to verified

    November 16th, 2010 @ 09:40 PM

  5. José Valim
    José Valim

    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.

    November 17th, 2010 @ 07:27 AM

  6. Santiago Pastorino
  7. Santiago Pastorino
    Santiago Pastorino
    • Milestone changed from 3.0.5 to 3.0.6

    February 27th, 2011 @ 03:15 AM