Translation kit doesn't work correctly with attached example

Issue #179 resolved
Former user created an issue

Original [issue 179](https://code.google.com/p/okapi/issues/detail?id=179) created by khagar... on 2011-07-26T22:53:34.000Z:

I tested the Translation kit function and did find a bug. Attached example file isn't processed correctly, when merging I get the error 'WARNING: The extra code id='1' cannot be cloned' and the merged file is incomplete. The same file is processed correctly with Translation package creation/postprocessing.

Tested with M12 and the latest snapshot, filter was default okp\_phpcontent.

Comments (4)

  1. Former user Account Deleted

    Comment [2.](https://code.google.com/p/okapi/issues/detail?id=179#c2) originally posted by @ysavourel on 2011-07-27T04:30:01.000Z:

    There is indeed a bug in the filter: Two placeholder codes are created with the same id value. When their representation is <x/> code, the merging has a (vaild) conflict.

    Until the bug is fixed on the creation side you can use the <ph> notation which will merge fine (You can select that notation in the Options of the translation Kit). that notation has no conflict because it takes the data to merge from the content of the code rather than try to retrieve them using the id.

    On a different topic: even with the bug fixed, the PHP Content Filter may not be very useful with this file. It is an HTML file with PHP tags (and a .php extension) The PHP Content Filter is meant to process the content of PHP files. For example the XLIFF generated here has translatable text for parts that should not be translated. The HTML Filter may yield better results.

  2. Former user Account Deleted

    Comment [4.](https://code.google.com/p/okapi/issues/detail?id=179#c4) originally posted by khagar... on 2011-07-27T15:06:34.000Z:

    Offtopic (@ comment 2): The file is only a minimal example, not a real file. I know it's a html file, same as the files in the set where I noticed this bug. The files in the set contain both HTML and translatable PHP code in about 75:25 ratio + a few PHP only files. I use 2 stage translation, first I use the HTML filter, translate, then I feed the translation result to the PHP filter and translate the rest. It's true that the PHP filter could use a "Don't extract text when regex matches" setting.

  3. Log in to comment