[Po4a-devel] XML: prevent some attributes from being translated

Nicolas François nicolas.francois at centraliens.net
Mon Mar 2 23:24:52 UTC 2009


On Mon, Mar 02, 2009 at 11:50:00PM +0100, poy at 123gen.com wrote:
>> Hello,
>>
>> I've added a foldattributes option to the Xml module.
>> (The name can change until it appear in a release ;)
>
> hi, thanks, this is great news! i've done a quick test (by passing "-o  
> foldattributes" in command-line to po4a-gettextize), and my links were  
> changed to tags like:
>    <a po4a-id=0>
>
> - i'm not sure whether "=0" without quotes around "0" is valid; but in 
> any case this is only as a help to translators, so better just leave it 
> as is.

It's probably not
(http://www.w3.org/TR/2008/REC-xml-20081126/#NT-AttValue)
but widely I think used, and quotes are too boring in PO files ;)

> - to translate back, i did not have to pass any option to po4a-translate; 
> it automatically guessed that po4a-id attributes had to be unfolded. 
> that's nifty, but if one were forced to pass "-o foldattributes" to 

I think it's a bug.
Can you check again (i.e. having the translation different from the
original string).

> po4a-translate, above tag could become:
>    <a id=0>
> which is even simpler. there would be no confusion as to whether that 
> "id" attribute comes from po4a or not: if po4a-translate was called with 
> "-o foldattributes", then the "id" attribute has to be unfolded to actual 
> attributes (which may even be real "id" attributes); otherwise, if no 
> option passed, then leave attributes untouched.

This works with the foldattributes option, but might be confusing if the
'f' modifier gets implemented. Also if the id attribute exist for a tag,
translators may think they can change it.

I also think it is too long. An option could be to use a slightly invalid
XML construct <tag 0>, or a very improbable valid XML construct <tag-0>

Best Regards,
-- 
Nekral



More information about the Po4a-devel mailing list