[Catalyst] $c->loc problem with [_1]
Chisel Wright
chisel at herlpacker.co.uk
Wed Oct 31 22:22:32 GMT 2007
On Wed, Oct 31, 2007 at 07:10:25PM -0300, Brian Cassidy wrote:
> Mario Minati wrote:
> >All the strings without [_1] are being translated as expected.
>
> Although you didn't actually say what you're getting as output, I
> suspect you'll want to use %1 format instead of [_1] in the .po file.
Looking at my .po file, I'm using C::P::I18N out of the tin, and using
the %1 there.
For some reason it took me quite a while to figure out that I was
supposed to use [_1] in my code/templates and %1 in the .po file(s).
I know I'm not using it "properly", but my working example looks like
this:
Foo.pm:
$c->localize(
q{EMAIL IN USE ([_1])},
q{/some/url}
);
.po:
msgid "EMAIL IN USE (%1)"
msgstr "The email address you have chosen is already in use.<br />Please try a different one, or use the <a href=\"%1\"> Forgotten Password</a> page."
Chisel
--
Chisel Wright
e: chisel at herlpacker.co.uk
w: http://www.herlpacker.co.uk/
I even make myself laugh sometimes...
More information about the Catalyst
mailing list