Menu ▾ ▴

#1349 “Allow translation to be equal to source” has no effect in 6.1.x: identical translations are always accepted

6.2
closed-duplicate
nobody
None
6.1.0
5
6 days ago
7 days ago
No

With Options → Editing Behavior → "Allow translation to be equal to source" switched off, a translation identical to the source text is still accepted and counted as translated. This worked in 6.0.x.

Affects: 6.1.0, 6.1.1, 6.1.2 and current master (3b45d6800).

Steps to reproduce

  1. Switch the option off.
  2. In an untranslated segment, type a translation identical to the source text.
  3. Move to the next segment.

Expected: the segment stays untranslated.
Actual: it is stored as a translation.

(Disclaimer: I let Claude do all the digging, and it also drew up the text below (as well as the "Affects" part above.)

Cause

In EditorController, the "equals to source" check was moved into getTranslationFromEditor() (a7e6310b9, "prevent enforced entry updates"). That method now creates a fresh PrepareTMXEntry, whose source is null. The caller only sets newen.source after the call, so

} else if (newTrans.equals(newen.source)) {

is always false and the "not allowed" branch is never reached.

Fix

Pass the segment's source text into the method and compare against that. Patch attached (identical_translation.patch, against master, one file, +4/−3).

(End of Claude's draft.)

I actually tested the proposed changes to the code, building master with the patch and using a copy of a project: with the option off, an identical translation now leaves the segment untranslated.

1 Attachments

Discussion

  • Jean-Christophe Helary

    • status: open --> closed-duplicate
     
  • Erik De Boeck

    Erik De Boeck - 6 days ago

    I apologize. I skipped the important step of checking for an existing issue. 😬

     
    👍
    1
    • Jean-Christophe Helary

      No problem at all 😊.

       

Log in to post a comment.