[Po4a-devel] Xhtml: SSI comment included in translations

poy poy at 123gen.com
Wed Apr 8 16:30:19 UTC 2009


----- Original Message ----- 
From: "poy" <poy at 123gen.com>
To: <po4a-devel at lists.alioth.debian.org>
Sent: Friday, March 20, 2009 4:00 PM
Subject: [Po4a-devel] Xhtml: SSI comment included in translations


> hi,
>
> i've been playing with the "includessi" option from the Xhtml module
> recently, and it's working very well!
>
> between <body> and </body>, i add:
> <!--#include virtual="commands_user.inc" -->
> and the contents of that file are correctly translated and included.
>
> the tag is changed into a simple comment:
> <!-- SSI included by po4a: virtual="commands_user.inc" -->
> followed by the translated contents of the included file.
>
> all good, but i have one little (non-)issue; in the translation template,
> the following translation is added:
> #. type: Content of: <html><body>
> #: help/commands_user.html:15 help/window_hub.html:45
> msgid "<!-- SSI included by po4a: virtual=\"commands_user.inc\" -->"
> msgstr ""
>
> obviously this is not to be translatable; when i add a comment between
> <body> and </body>, eg:
> <!-- blah -->
> the comment is ignored by po4a and doesn't end up in the translation file.
> so it's a little odd that the SSI comment does end up in there...
>
> could this be checked please?
>
> thanks,
>
> poy
>
>
> _______________________________________________
> Po4a-devel mailing list
> Po4a-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/po4a-devel



attached patch solves the above problem.

the previous method was using the value of f_extract to identify comments, 
by comparing it to tag_extract_comment, so it failed to identify SSI 
comments because these have a different f_extract function (the one in the 
Xhtml module). i've changed it to identify comments based on whether they 
begin with "!--" or not.

poy 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ssicomments.patch
Type: application/octet-stream
Size: 1318 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/po4a-devel/attachments/20090408/9c2d3ce1/attachment.obj>


More information about the Po4a-devel mailing list