<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.3.2">
</HEAD>
<BODY>
On Mon, 2005-05-02 at 17:26 +0200, Fredrik Corneliusson wrote:<BR>
<BR>
Hi,<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">However I saw that the translate project's po2xliff filter uses the</FONT>
<FONT COLOR="#000000">last version described, and the xliff2po takes care of recreating the</FONT>
<FONT COLOR="#000000">\n.</FONT>
</PRE>
</BLOCKQUOTE>
<PRE>
</PRE>
What does that filter do when the translator adds an extra line feed in the translated version because the text is too long?<BR>
<BR>
For example:<BR>
<BR>
<BLOCKQUOTE>
<TT>msgid "" </TT><BR>
<TT>"Line 1\n line 2\n" </TT><BR>
<TT>"Line 3.\n"</TT><BR>
<BR>
</BLOCKQUOTE>
converted as <BR>
<BR>
<BLOCKQUOTE>
<PRE>
<TT><trans-unit xml:space="preserve"></TT>
<source><TT> </TT>
<TT>Line 1 </TT>
<TT> line 2 </TT>
<TT>Line 3. </TT>
</source>
<TT></trans-unit></TT>
</PRE>
</BLOCKQUOTE>
<PRE>
</PRE>
could be translated as:<BR>
<BR>
<BLOCKQUOTE>
<TT><trans-unit xml:space="preserve"></TT>
<PRE>
<source><TT> </TT>
<TT>Line 1 </TT>
<TT> line 2 </TT>
<TT>Line 3. </TT>
</source>
<target>
<TT>L</TT>í<TT>nea 1 </TT>
<TT> l</TT>í<TT>nea 2 </TT>
<TT>L</TT>ong line here
<TT>3. </TT>
</target>
<TT></trans-unit></TT>
</PRE>
</BLOCKQUOTE>
<BR>
is this converted to <BR>
<BR>
<BLOCKQUOTE>
<TT>msgid "" </TT><BR>
<TT>"Line 1\n line 2\n" </TT><BR>
<TT>"Line 3.\n"</TT><BR>
<TT>msgstr ""</TT><BR>
<TT>"L</TT>í<TT>nea 1\n l</TT>í<TT>nea 2\n Lon</TT>g<TT> line here\n 3\n.</TT>"<BR>
<BR>
</BLOCKQUOTE>
?<BR>
<BR>
How does that filter know when to break a long line? For example, from<BR>
<BR>
<BLOCKQUOTE>
<TT>msgstr ""</TT><BR>
<TT>"L</TT>í<TT>nea 1\n l</TT>í<TT>nea 2\n Lon</TT>g<TT> line here\n 3\n.</TT>"<BR>
<BR>
</BLOCKQUOTE>
to <BR>
<BR>
<BLOCKQUOTE>
<TT>msgstr ""</TT><BR>
<TT>"Línea 1\n línea 2\n "</TT><BR>
<TT>"Long line here\n 3\n."</TT><BR>
<BR>
</BLOCKQUOTE>
or to <BR>
<BR>
<BLOCKQUOTE>
<TT>msgstr ""</TT><BR>
<TT>"Línea 1\n "</TT><BR>
<TT>"línea 2\n "</TT><BR>
<TT>"Long line "</TT><BR>
<TT>"here\n 3\n."</TT><BR>
<BR>
</BLOCKQUOTE>
?
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">This brings up a question about how much help filters can give the translator.</FONT>
<FONT COLOR="#000000">For example if a message uses c-formatting and the placeholders</FONT>
<FONT COLOR="#000000">changes sequence in the translation the XLIFF to PO filter could</FONT>
<FONT COLOR="#000000">automatically add or check the sequence representation (eg. %2$s %1$s)</FONT>
<FONT COLOR="#000000">based on the ph tag id. I think could lower the entry bar for</FONT>
<FONT COLOR="#000000">translators, make translation more efficient and at the provide</FONT>
<FONT COLOR="#000000">functionality not provided by the current PO editors.</FONT>
<FONT COLOR="#000000">What's your take on this?</FONT>
</PRE>
</BLOCKQUOTE>
<BR>
When translating XLIFF files you can reorder tags because some source formats allow this. An XLIFF editor does not care about the original format. It deals with XLIFF files only and the only important thing is to check that all tags are in place.<BR>
<BR>
It is possible to check sequences in the filters at reverse conversion time, but only for files that have c-format flags. When Python or PHP files are converted to XLIFF formatting codes are not treated as tags. If someone updates the Reference guide explaining how to handle other languages, I will happily update the Java filters accordingly. FWIW, I did not do this myself before because I know nothing about Python or PHP<BR>
<BR>
Regards,<BR>
Rodolfo<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
-- <BR>
Rodolfo M. Raya <<A HREF="mailto:rodolfo@heartsome.net">rodolfo@heartsome.net</A>><BR>
Heartsome Holdings Pte Ltd
</TD>
</TR>
</TABLE>
</BODY>
</HTML>