On Mon, 02 Aug 2010 07:08:04 +0200, Julien Sobrier <jul...@sobrier.net> wrote:

Also, writing [% c.loc(foo) %] does not create an entry in messages.po
when running xgettext.pl, like [% c.loc('foo') %] does.

To make that work, I think you'd have to actually *run*
your templates for all possible cases, and then collect all
the strings that were passed as arguments to c.loc().

In other words, I'm not saying it's impossible, but
xgettext.pl will probably never be able to do that.

A slightly different approach, that works for me,
is to create your .PO files in different stages.

First step parses the templates with xgettext.pl and generates
the .PO files.

A second step can, for example, parse the actual source
code, for stuff like '$c->loc("foo")'.
xgettext.pl can do that with a bit of trickery.

The new messages will be merged together in the same .PO files.

In your case, you could pull the messages you want to be translated
directly from the database, and write some on-the-fly
fake templates (or text files for that matter),
and feed them to xgettext.pl.

--
Cosimo

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to