Closed handhikadj closed 3 years ago
I don't understand what your problem is. Is there anything wrong in OpenXLIFF that needs fixing?
not exactly. Here's the thing,
.xlf
(XLIFF 2.0) file using this library. let's call the generated .xlf
file myxlf.xlf
myxlf.xlf
filemyxlf.xlf
and merge it back using this lib, Word deems the generated docx file is corruptedmyxlf.xlf
, I notice that okapi-lib-xliff2
overrode the .xlf
to be in different format that OpenXLIFF hasSo, what I need is is there any API that can write a given <target>
text without manually traverse/parse the .xlf
file?
I hope you can understand
It seems that you have a bad XLIFF after processing. You need to fix or replace the tool that breaks the XLIFF.
OpenXLIFF already has all the code needed to read and write XLIFF files. It is the main library used by other tools like Swordfish for handling XLIFF
thank you for your ultra-fast response
yea, I know full well that the okapi-lib-xliff2 breaks your XLIFF after I examined it.
Would you tell me the tutorial how to read and write a given <target>
?
There is no special tutorial.
XLIFF is XML and OpenXLIFF has XML library for reading and processing the XML, as shown in the different tools that use it.
Have you reported the problem to Okapi developers?
I've just examined the .xlf
file using ./xliffchecker.sh
and ./xliffchecker.sh
says INFO: File is valid XLIFF 2.0
after I write-a-target-and-save it
Hence I don't know what went wrong currently
I can't comment if I don't see the file.
BTW, why did you say that okapi breaks the XLIFF file?
you can check this out: https://gist.github.com/handhikadj/efc6a425280c8a28430eb048c12b4373#file-main-java-L94-L109
That's how okapi manipulate a .xlf
file in a breeze. Notice the highlighted ones. That's how I write a given target
I can't find an API in OpenXLIFF similar to the okapi one. I hope you can provide this in the future / any time soon
Your code does not handle target tags. You can have valid XLIFF but that XLIFF would be useless. Merged Word files would be broken and Word would complain when you try to open them.
Features similar to the Okapi API already exists in the tools that use OpenXLIFF. There are methods for reading, iterating, modifying, writing and saving XML files, including XLIFF, TMX, TBX, etc.
would you point me out to that?
Sorry, but I can't help you.
I'm using okapi-lib-xliff2 to read-and-write a
.xlf
file which generated from OpenXLIFF's./convert.sh
. but after that, Word deems the file is corrupted when I merge the XLIFF file back using OpenXLIFF's./merge.sh
because the okapi-lib has different format of how they write-and-save the XLIFF file.Any API/Library to write your generated
.xlf
file after./convert.sh
?