[Po4a-devel] How to handle dublicate strings

Nicolas François nicolas.francois at centraliens.net
Sun Oct 22 19:31:46 UTC 2006


Hello Heiner,

On Fri, Oct 20, 2006 at 08:21:38PM +0200, Heiner wrote:
> 
> While playing with po4a I found a problem, which does not occur very often, 
> but it might. Assume the following table (in docbook) should be translated:
> 
> <informaltable>
> 	<tgroup cols='2'>
> 		<tbody>
> 			<row>
> 				<entry>right</entry>
> 				<entry>wrong</entry>
> 			</row>
> 			<row>
> 				<entry>right</entry>
> 				<entry>left</entry>
> 			</row>
> 		</tbody>
> 	</tgroup>
> </informaltable>
> 
> po4a-gettextize -f sgml makes the following .pot out of this:
> 
[...]
> 
> As you see: just 3 strings as "right" appeared twice in the source. But this 
> is the problem: in english the opposite of left and the opposite of wrong are

This issue is a common issue with the translation of extracted strings.
It is usually solved by adding more context in the string or changing the
original document.

More context can be added by using the '-o ignore=entry' option (in the
CVS version only; in the earlier version, you also have to remove the
references to the 'entry' tag in Sgml.pm).

Then you will have to translate the following strings:
        # type: <row></row>
        msgid "<entry>right</entry><entry>wrong</entry>"

        # type: <row></row>
        msgid "<entry>right</entry><entry>left</entry>"

(but this may be a problem for the other entry occurrences.

The document could also be changed by using entities, and then using
something like &right_not_wrong; and &right_not_left;

> the same word - in most other languages they aren't. gettext has one chapter 
> about this in its documentation. They recommend to prefix those strings, 
> like:
> 
> wrong_right
> left_right
> 
> and to cut off everything before the _ before displaying it. Any suggestions 
> on how to handle this in docbook/po4a?

I don't think I can generalize the use of _ in po4a. There are a lot of
case where a _ should be accepted as a normal character.

Maybe in the future, I could accept some annotation
(<-- po4a context: blah !-->) and then use the gettext contexts.

Regarding the issues you already mentioned, I intend to fix the '>>'
issue.
I don't think I can do anything about the validation of the XML tags in
po4a.  I intend to fix the '>>' issue, and then release a 0.29.1

Kind Regards,
-- 
Nekral



More information about the Po4a-devel mailing list