[Po4a-devel] Only translating specific XML tags

Nicolas François nicolas.francois at centraliens.net
Wed Nov 18 20:25:14 UTC 2009


Hi,

On Wed, Nov 18, 2009 at 03:34:26PM +0100, fgouget at free.fr wrote:
> 
> I have an XML file I'd like to translate. It has quite a few tags, but 
> only two or three of them should be translated. But it appears that I 
> will have to specify every single tag I don't want to see translated
> 
> To test this I have written a small test file, where <name> is the only 
> tag that should be translated:
> 
> <?xml version="1.0" encoding="UTF-8" ?>
> <root>
>   <global>
>     <name>To be translated</name>
>     <other>foo</other>
>     <yetother>bar</yetother>
>   </global>
> </root>
> 
> So I thought that something like this would work:
> 
>    po4a-gettextize -f xml -m test.xml -o 'translated=<name>'
> 
> But that still produces a po file that includes every string. What's the 
> point of the 'translated' option then since all tags are included by 
> default anyway?
> 
> I also tried 'tagsonly=<name>' but it's deprecated and just produced an 
> empty po file anyway.

You should use -o tagsonly -o 'translated=<name>'

I should either unmark tagsonly as deprecated or add a new letter for the
defaulttranslateoption option.

Best Regards,
-- 
Nekral



More information about the Po4a-devel mailing list