Hello! In one of my views i have something like this: <% ciccio = ''panza'' %> <%=h _("yeah #{ciccio}") %> but the localize script from http://manuals.rubyonrails.com/read/chapter/105 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 Santoro <Simon.Santoro-Syd3ARw+vPY@public.gmane.org> wrote:> Hello! > In one of my views i have something like this: > > <% ciccio = ''panza'' %> > <%=h _("yeah #{ciccio}") %> > > but the localize script from > http://manuals.rubyonrails.com/read/chapter/105 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 Mutoh<mutoh-+e5RZkbjevhHfZP73Gtkiw@public.gmane.org>
Masao Mutoh wrote:> Ruby-GetText-Package doesn''t support "#{...}" style. > Use: > > _("yeah %s") % ciccio >Thanks!
Simon Santoro wrote:> Masao Mutoh wrote: >> Ruby-GetText-Package doesn''t support "#{...}" style. >> Use: >> >> _("yeah %s") % ciccioMasao, 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
Hi, On Fri, 18 Nov 2005 00:16:15 +0100 Sascha Ebach <se-eFwX6J65rk9VioaHkBSlcw02NpfuEekPhC4ANOJQIlc@public.gmane.org> wrote:> Simon Santoro wrote: > > Masao Mutoh 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.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. -- .:% Masao Mutoh<mutoh-+e5RZkbjevhHfZP73Gtkiw@public.gmane.org>