[EXCONTRANS-386] Unable to submit a document for translation Created: 17/Jan/23  Updated: 20/Mar/23  Resolved: 02/Feb/23

Status: Closed
Project: Content Translation Extended (CTX)
Component/s: Translations.com Translator
Affects Version/s: 2.9.8
Fix Version/s: 2.9.9

Type: Bug Priority: Blocker
Reporter: Tech Team Assignee: Riste Drangovski
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot_15.png     Text File error_logs.txt     File fr_FR.xlf     XML File translationBatches.AP-FR1.xml     XML File website.global.your-avis.avis-loyalty.xml    
Issue Links:
Relates
relation
Template:
Start Date:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[X]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:

 Description   

Steps to reproduce

  1. From Pages App choose any page and click on 'Add to translation batch'
  2. Create New Batch or Choose existing batch, choose languages that need to be translated to, and Save changes
  3. Go to 'Translation Extend' App and choose the newly created batch and click on 'Submit Batch'

Submit batch fails with an error.

While debugging the jar we found that it's breaking while unzipping the xlf file. We can see the xlf document is getting zipped in a temp folder and while unzipping it below error is thrown. I am attaching the xlf file as well.

Fatal Error] :1:1: Premature end of file.
2022-11-11 15:44:24,690 ERROR a.translation.ext.core.helper.XliffTransporterImpl: Cannot convert to Document:
org.xml.sax.SAXParseException: Premature end of file.
    at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source) ~[?:1.8.0_301]
    at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source) ~[?:1.8.0_301]
    at info.magnolia.translation.ext.core.helper.DocumentParser.parse(DocumentParser.java:88) ~[magnolia-content-translation-support-ext-core-2.9.8.jar:?]
    at info.magnolia.translation.ext.core.helper.XliffTransporterImpl.export(XliffTransporterImpl.java:84) [magnolia-content-translation-support-ext-core-2.9.8.jar:?]
    at info.magnolia.translation.ext.core.command.ExportTranslationCommand.exportDocument(ExportTranslationCommand.java:284) [magnolia-content-translation-support-ext-core-2.9.8.jar:?]
    at info.magnolia.translation.ext.core.command.ExportTranslationCommand.createSubmissionItem(ExportTranslationCommand.java:243) [magnolia-content-translation-support-ext-core-2.9.8.jar:?]
    at info.magnolia.translation.ext.core.command.ExportTranslationCommand.processResourceNodes(ExportTranslationCommand.java:179) [magnolia-content-translation-support-ext-core-2.9.8.jar:?]
    at info.magnolia.translation.ext.core.command.ExportTranslationCommand.generateTranslationSubmission(ExportTranslationCommand.java:156) [magnolia-content-translation-support-ext-core-2.9.8.jar:?]
    at info.magnolia.translation.ext.core.command.ExportTranslationCommand.executeOnItem(ExportTranslationCommand.java:128) [magnolia-content-translation-support-ext-core-2.9.8.jar:?]
    at info.magnolia.translation.ext.core.command.AbstractTranslationCommand.execute(AbstractTranslationCommand.java:63) [magnolia-content-translation-support-ext-core-2.9.8.jar:?]

Expected results

Translation batch should be successfully submitted

Actual results

Submit batch fails with an error.

Workaround

No workaround

Development notes



 Comments   
Comment by Riste Drangovski [ 25/Jan/23 ]

Hi guys,

we are not able to reproduce the issue on our local environment, so I would ask you if you can upload export from the wab page you are trying to translate and/or export of the translation batch?

Thx,
Riste

Comment by Avik Das [ 25/Jan/23 ]

Hello Riste, I have uploaded xml exports of both the page and batch as requested

Comment by Riste Drangovski [ 27/Jan/23 ]

Hi Avik,
I was able to reproduce your issue. For me this is happening when I try to translate a document to unsupported language.
Can you please confirm that your translations.com account supports "en_GB" to "fr_FR" locale translation ?
Just a note that translations.com account can be configured for "fr" translation, but not for "fr_FR" ....

Regards,
Riste

Comment by Avik Das [ 31/Jan/23 ]

Hi Riste,

So we contacted translations.com about the locale format supported and below was their reply. 

"We can support 2 and 4 letter codes (we do advise to use 4 letter codes). We are currently set for fr-FR (there should be a language map on Magnolia)

On magnolia I believe underscore( _ ) is used and PD uses “-“ this is resolved with the language mapping."

Will you be able to guide us now in advising the next steps?

Comment by Riste Drangovski [ 31/Jan/23 ]

Hi Avik,

On magnolia side language mapping is done right (at least, as far as I can see from the xlf file). So if translations.com is set for en-GB to fr-FR translation, you just need to try to re-submit the translation batch.

Regards,
Riste

Comment by Avik Das [ 31/Jan/23 ]

Hi Riste, how to submit the batch with locale fr-fr because our whole website setup locale is with underscore e.g. en_GB, fr_FR etc. The xlf which I attached that is getting generated we can clearly see source is en_GB and target is fr_FR, so where should we correct this?

<file datatype="html" original="magnolia.export" source-language="en_GB" target-language="fr_FR">
<header/>
<body>
<trans-unit extradata="2020.07.01 19:46:25 214" id="5e93b591-ce58-4bf3-abbb-e4f963feeb0b:windowTitle" resname="AvisBookingFlow:pages/awdCodeContainerForContentPage: Window Title">
<source xml:lang="en_GB">Join our affiliate programme</source>
<target xml:lang="fr_FR"/>
<note>http://local.avis.co.uk:8080/avis-affiliate-programme.html</note>
</trans-unit>

Comment by Riste Drangovski [ 31/Jan/23 ]

Hi Avik,

On the version that you are using I found a problem when locale has country set. xlf file is generated, but because of the country part, name does not match when we try to import it again in the translation batch.

I have to check with the colleagues what should we do here because you are using old version.

Generated at Mon Feb 12 00:30:43 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.