Updated: Comment #N

Problem/Motivation

Current situation is that both XLIFF source and target elements contain the source.

Proposed resolution

Make the target element empty.

Remaining tasks

As a followup we can even provide an option in settings to either export the target as empty element or add the previous translation.

User interface changes

API changes

Original report by @titouille

Comments

miro_dietiker’s picture

Title: File export (xliff) export only source language, even if translation node exists » File export (xliff) export only source language, even if translation already exists
Category: support » feature

As far as i know we prefill the translation with the source.
Adding the translation to the output if available would be a feature in tmgmt.

The system is designed to deal with a lot improvements. However, processes like creating a review only job or asking to apply changes from origin is not implemented yet. Only the process of new content with request to translation, review, and flagging as outdated works. Placing another job (of the same source item) is a full cycle to ask for full retranslation of the document.

miro_dietiker’s picture

Title: File export (xliff) export only source language, even if translation already exists » Job / File export (xliff) contains only source language, even if translation already exists
miro_dietiker’s picture

We are currently improving the XLIFF support and adding paired tags.
The problem is that CAT tools check if the source structure is identical to the target structure and things like paired tags are all there. It's integrity.

If we add a new chapter, new HTML elements, new paired tags and they are missing in the outdated translation provided, the validation will fail.

With translation memory based systems, it's easy to reapply the translation memory to the target again.
However, in case a user changed the translation in Drupal during the review / accept phase, the translation memory might be outdated.

This issue needs intelligent merging in the translation domain in case the structure / translation meta tags changed.

miro_dietiker’s picture

Title: Job / File export (xliff) contains only source language, even if translation already exists » Job / XLIFF File export contains only source language, even if translation already exists
Issue summary: View changes
miro_dietiker’s picture

Status: Active » Needs work

This requires testing with tools like Trados.

The idea is to have the translation field EMPTY instead of the duplicated source.
Adding the (previously) translated source to the translation side doesn't work as tools will not accept the xliff this way.

blueminds’s picture

Yes, can confirm this is no go. Tried this out with Trados and the import might fail due to source and target not having same semantic structure. Moreover this should not be our responsibility. Translation tools have translation memory that should do exactly this job. So I suggest to close this issue as "won't fix".

blueminds’s picture

Title: Job / XLIFF File export contains only source language, even if translation already exists » XLIFF export should be with empty targets
Issue summary: View changes
blueminds’s picture

Status: Needs work » Needs review
StatusFileSize
new699 bytes

Looks like not passing the source text into the target element is enough.

berdir’s picture

I assume you did test this with trados?

Can we add an assert for this? We already parse it to add the translation, should be a one line change to add an assertEqual((string) $transunit->target, '', 'Target text is empty') there?

blueminds’s picture

StatusFileSize
new1.42 KB

yes, tested with trados.

provided test.

blueminds’s picture

StatusFileSize
new1.42 KB

yes, forgot the dot.

miro_dietiker’s picture

Status: Needs review » Reviewed & tested by the community

OK, tested this. Works fine this way.

berdir’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new6.59 KB
new7.78 KB

Ok, that was fun.

This exposed a bug in the actual implementation of the mask patch, and flaws in the test coverage.

Improved and fixed that.

The last submitted patch, 13: 2006786-xliff_empty_target-13-test-only.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 13: 2006786-xliff_empty_target-13.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review
StatusFileSize
new7.78 KB
new891 bytes

Last minute argument change was a bad idea.

blueminds’s picture

Status: Needs review » Reviewed & tested by the community

cannot get dreditor working...

Looks good, found only one typo:

Creates a translated XLIFF file basd on the replacement definition.

basd -> based

berdir’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

kopeboy’s picture

Status: Closed (fixed) » Needs review

This is way worse than it was for manual translation!

If I had the target prefilled I could replace text with a text editor quickly and easly, now I don't know how to do it (since there is nothing in documentation on how to translate manually, the format the file html or xif file should have etc.)

Can you please create an option in the module to choose whether to have target prefilled or not?

miro_dietiker’s picture

Status: Needs review » Closed (fixed)

This is XLIFF specification. Perfectly documented:
http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html

It is a machine readable format. We follow semantics (as it is semantically wrong to prefill translation).
I recommend you to use a tool that can deal with XLIFF.

Plain text editor experience is no valid reason to change this behavior.
Please open a support request in case you need to discuss this situation.