views:

10

answers:

0

I have a site which is currently implementing i18n using ruby-gettext package methods. All of the marked content within *.rb, *.erb, *.rhtml can all be translated and displayed correctly. But for lots of text stored in *.yml can't be displayed correctly although those marked strings have been inside of po files.

Original yml file example:

messages:
  login: You have logged in.
  login_successful: You have logged in as <%= @u.display_name %>
  ...

And the marked example:

messages:
  login: _("You have logged in.")
  login_successful: _("You have logged in as") <%= @u.display_name %>
  ...

Then the login message will be displayed on pages like this which is completely a disaster:

_("You have logged in.")

What did I do wrong? Or it is just impossible to translate yml content?