Translate Document" feature of MS Word. After the tran" /> Translate Document" feature of MS Word. After the tran" /> Translate Document" feature of MS Word. After the tran"/>

Certain Text between square brackets in document.xml file does not render properly in its corresponding docx file

41 views Asked by At

I have implemented a solution to translate a word docx file to Arabic. I have used the "Review->Translate Document" feature of MS Word. After the translation is completed, I save this translated file. There is certain text in the document that should not have translated, but it gets translated because we used the "Translate Document" feature. I have written code to get the text that should not be translated from the original document and replacing in the translated document. The text that should not be translated is within the square brackets.

My original document has the below 2 lines and the translated document.xml also has the text in square brackets similar to below. Run [SM type="Y" full="hpcon"/]. You can also run [SM type="#" name="hp_con"/].

After running my java code(using docx4j library) on the translated file - "english_translated.docx", the document.xml shows the text in the square brackets same as it is in the original document. But the rendering in the docx file is not showing properly.... The rendered lines show as تشغيل [/"SM type="Y" full="hpcon].

يمكنك أيضا تشغيل [/"SM type="#" name="hp_con].

If you see the "double quotes followed by forward slash" is showing in the beginning after the open square brackets But in the translated document.xml, it shows correctly... it just does not render properly. تشغيل [SM type="Y" full="hpcon"/] مكنك أيضا تشغيل [SM type="#" name="hp_con"/]

Please check and help me out. Is it because of the forward slash having some meaning that its not rendering properly?

I tried to left align the text since Arabic is right aligned and tried, but it did not help.

0

There are 0 answers