Forum: Rails I18n GetText problems with .set_error_message_title

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
neongrau _. (Guest)
on 2007-02-20 17:28
i tried to change the error message title to use with
"error_messages_for" as described at
http://www.yotabanana.com/hiki/ruby-gettext-howto-...

but i never ever get the translated strings :(
i just always get the strings within the N_('') function.
but the %{record} inside gets properly translated.

i'm currenlty runnnig my rails app
with ruby 1.8.5 on windows with rails 1.2.2 and gettext 1.9.0
even downgrading gettext to 1.7.0 didn't help (the page said it's
supposed to work since version 1.7.0).

this is what i have in my application controller:
  ActionView::Helpers::ActiveRecordHelper::L10n.set_error_message_title(
      N_("An error prevented saving this %{record}"), N_("%{num} errors
prevented saving this %{record}"))

and the excerpt from my .po file for "de_DE":

#: app/controllers/application.rb:10
msgid "An error prevented saving this %{record}"
msgstr "Ein Fehler verhinderte das Speichern dieser %{record}"

#: app/controllers/application.rb:10
msgid "%{num} errors prevented saving this %{record}"
msgstr "%{num} Fehler verhindern das Speichern dieser %{record}"

i'm totally out of ideas what to do :(
any help would be greatly appreciated!
yaroska (Guest)
on 2007-04-18 03:51
neongrau __ wrote:
> but i never ever get the translated strings :(
> i just always get the strings within the N_('') function.
> but the %{record} inside gets properly translated.

I have the same problem (only one difference Linux instead of Windows).
Can somebody explain what's going on? And how to fix it. Please.

Thanks a lot.
This topic is locked and can not be replied to.