Gettext and placeholder

Hello!
In one of my views i have something like this:

<% ciccio = ‘panza’ %>
<%=h _(“yeah #{ciccio}”) %>

but the localize script from
Peak Obsession does not add the second
line to my pot and po files. Am I doing something wrong? Did someone get
this to work?

Hi,

On Wed, 16 Nov 2005 21:20:57 +0100
Simon S. [email protected] wrote:

Hello!
In one of my views i have something like this:

<% ciccio = ‘panza’ %>
<%=h _(“yeah #{ciccio}”) %>

but the localize script from
Peak Obsession does not add the second
line to my pot and po files. Am I doing something wrong? Did someone get
this to work?

Ruby-GetText-Package doesn’t support “#{…}” style.
Use:

_(“yeah %s”) % ciccio

Masao M. wrote:

Ruby-GetText-Package doesn’t support “#{…}” style.
Use:

_(“yeah %s”) % ciccio

Thanks!

Hi,

On Fri, 18 Nov 2005 00:16:15 +0100
Sascha E. [email protected] wrote:

_(“yeah :greeting”) % :greeting => ‘right’

The reason for this would be so that the translator will have it easier to
translate because more of the context of the message is known when you are
looking at the msgid.

Interesting.

If gettext overrides String#%(ary) => String#%(hash_or_ary),
It seems we can implement it with backward compatibility.
I’ll consider your suggestion.

On the other hand, it may be a good proposal to extend the
behaviour of ruby’s string literal.(ruby-1.9 or 2.0?)

“yeah :greeting :number” % {:greeting => ‘right’, :number => 10}

So I recommand you to discuss this proposal on ruby-talk
or ruby-core.

Simon S. wrote:

Masao M. wrote:

Ruby-GetText-Package doesn’t support “#{…}” style.
Use:

_(“yeah %s”) % ciccio

Masao,

what do you think about supporting something like

_(“yeah :greeting”) % :greeting => ‘right’

The reason for this would be so that the translator will have it easier
to
translate because more of the context of the message is known when you
are
looking at the msgid.

Sascha