On 8 nov, 09:01, Save The Vinyls <[email protected]> wrote:
> I got this missing_translations.rake script athttp://pastie.org/310046.
> I got two questions.
>
> 1 -- Why does it go rake aborted! interpolation argument person
> missing in "{{person}} updated" because of controllers/admin/
> people_controller.rb's flash[:success] = t(:person_updated, :person =>
> @person.aka)?http://pastie.org/310051
You basically try to grab a call to I18n.translate and reduce it to
the symbol that determines the entry in the backend. Your last gsub
(gsub(/(,.*)/, "") removes any comma and anything after that, which
includes the parameters you passed in for interpolation. So instead of
calling t(:person_updated, :person => @person.aka) you just call I18n.t
(:person_updated). The string in your backend belonging to the
symbol :person_updated obviously contains some interpolation like "foo
{{person}} bar", so the resulting call raises an
I18n::MissingInterpolationArgument exception, as described in
http://rails-i18n.org/wiki/pages/i18n-rails-guide, section
"Interpolation".
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"rails-i18n" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rails-i18n?hl=en
-~----------~----~----~----~------~----~------~--~---