You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the t helper method inside a block passed to a partial, Rails resolves relative translation keys using the partial's path instead of the caller's path. This results in translations being looked up from the partial’s scope instead of the scope of the file where the block is defined.
Steps to reproduce
# test_component.html.erb
<%= render "shared/partial" do %>
<%= t(".title") %>
<% end %>
Expected behavior
The translation key should resolve to: en.test_component.title
Actual behavior
The translation key instead resolves to: en.shared.partial.title