Forum: Rails I18n i18n controller-view

E15aaab38043259f3894b0c23e2161a9?d=identicon&s=25 Kot Matroskin (furoh)
on 2010-01-26 09:45
hello, could you tell me why this doesn't work?

controller:

 flash[:success] = t('flash.added', :item => t('dictionary.challenge'))

en.yml

  dictionary:
    challenge: Challenge

  flash:
    added: {{item}} has been successfully created.
4a551074ddba4460f95d011c47190d0e?d=identicon&s=25 Henrik --- (malesca)
on 2010-01-26 10:20
(Received via mailing list)
On Tue, Jan 26, 2010 at 09:45, Kot Matroskin <lists@ruby-forum.com>
wrote:
> hello, could you tell me why this doesn't work?

"Doesn't work" is too unspecific. State your Rails version, if you use
the built-in i18n or the gem (what version?) and how it doesn't work,
specifically. What do you see, what did you expect to see instead? Any
exception backtraces.

>  flash:
>    added: {{item}} has been successfully created.

One thought off the top of my head is that perhaps you need to quote
the added value when it includes curly braces, but that's a wild
guess.

So try

flash:
  added: "{{item}} has been successfully created."
This topic is locked and can not be replied to.