-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
translating xml - spaces deleted at end of text string before <b> bold #35
Comments
Hi @vf211, thanks for creating this issue. Can you please provide a short example? I'm assuming you're using |
Dear Daniel, thank you so much for your quick reply. Here is an example of text from the XML file where I have a problem: 1. Tap Set Up (1). when it translates it replaces this with translated version but takes out the gap after "Tap", like this: 1. TapSet Up (1). Here is the code I use. The issue is when we have bold text within the text element. import lxml.etree as ET file='New_project_en-US_to_it-IT.xml' #starting file that needs a translate tree = ET.parse(file) translator = deepl.Translator("53f18f3b-ba9c-...") #API key from DEEPL API for elem in root.iter(): tree.write(file2) |
Hi @vf211, thanks for the reply. Please avoid exposing your authentication key in public; I've edited your post above. You should now regenerate your authentication key on your account page. Your code looks okay. I tried translating |
Dear Daniel, thank you again for your reply. Questo messaggio viene visualizzato quando un pacchetto raggiunge ilRaggi X rivelatore ma ilcodice a barre non viene letto. Controllare quanto segue: )and this was the English that went into the code: This message is displayed when a pack reaches the X-ray detector but the barcode is not read. Check the following: The alignment of the barcode scanner. |
hi Daniel, I added the xml tagging into the code as you suggested in your first email and that seems to have fixed our problems. Thank you so much for all your help! |
Hi @vf211, great to hear that you have fixed the problems, thanks for the update! |
Hello, I am using this API to translate XML documents from Schema. Some of my text elements have bold sections and I use lxml.etree to parse and translate text and tail elements. The bold elements within text end up with the space removed in front of them.
Anything I can do to keep the spaces?
The text was updated successfully, but these errors were encountered: