Ruby on Rails Friday, October 1, 2010

Hi, to avoid putting the whole locale scope on every I18n.t call I'm
trying to use a scope, as stated in the doc
(http://guides.rubyonrails.org/active_support_core_extensions.html#with_options)

I tried with

<%= I18n.with_options :locale => :en, :scope => 'portal.visitor_menu' do
|i18n|%>
Try <%= i18n.t :fav_songs %>
<% end %>

But it produce
Try favorite song
Try favorite song

I mean, the bloc is executed TWICE. The same code exercised under the
rails console is executed only ONCE.

Anybody have an idea of this strange phenomenom ?

Thanks
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment