On Mon, Dec 21, 2009 at 8:14 AM, Clinton Gormley <[email protected]>wrote:

>
> Ah ok.  Yeah, xgettext.pl just extracts from text in l() or loc(), not
> quoted strings in general.
>

A nice feature would be to pass in a list of names to match in case you use
something other than l() or loc().

I have not thought about this much, but would a better approach to just
extract out all quoted text?

Granted it would be ideal if all text had loc() around it at the point it is
entered in the template, but if the assumption is that all text needs to be
translated then in the template that would be all quoted text (text outside
of a template directive is another issue).


> However, you could repurpose the code in
>
> http://search.cpan.org/~drtech/Locale-Maketext-Lexicon-0.77/lib/Locale/Maketext/Extract/Plugin/TT2.pm<http://search.cpan.org/%7Edrtech/Locale-Maketext-Lexicon-0.77/lib/Locale/Maketext/Extract/Plugin/TT2.pm>to
>  do what you need, although this only catches sub calls and filters, it
> wouldn't catch simple variable assignment.  Wouldn't be too tricky to add
> that though.  probably just need to adjust text() textblock() and quoted().
>

Yes, I'm close.  I added a set() override to catch [% var = 'quoted text' %]
but I'm still not getting:

   [%  'quoted text' %]

Is there a separate method for that?




-- 
Bill Moseley
[email protected]
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to