There is an opinion that causes partial in my multilingual application:
<%= render :partial => 'shared/order', :object => @order %>
the default language is Russian, and shared / _order.html.erb uses I18n.t
<%= t('.order_type') %>: <b><%= t("order_types.#{order.order_type}") %></b>
<%= t '.date_and_time' %>: <b><%= l(order.date, :format => :long) %>
And I want to do the same partial one more time, but in English, without changing the I18n.locale variable . By writing something like this:
<%= render :partial => 'shared/order', :object => @order %>
<%= render :partial => 'shared/order', :object => @order, :locale => 'en' %>
What are the best methods to achieve this behavior?
source
share