From 9f5f80570c91f6da8f558f305c51734768fbec7c Mon Sep 17 00:00:00 2001 From: Lucie Gerard Date: Tue, 22 Jan 2019 13:58:41 +0100 Subject: Check that similar message does not have an other exact fit Task-number: QTBUG-69521 Change-Id: I77d936feb4d4ee189ed1c774b5e2afecfad7676b Reviewed-by: Kai Koehne --- src/linguist/lupdate/merge.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/linguist/lupdate/merge.cpp b/src/linguist/lupdate/merge.cpp index 3ab768b1d..f413610f9 100644 --- a/src/linguist/lupdate/merge.cpp +++ b/src/linguist/lupdate/merge.cpp @@ -460,9 +460,13 @@ Translator merge( if (options & HeuristicSimilarText) { int mi = tor.find(mv.context(), mv.comment(), mv.allReferences()); if (mi >= 0) { - if (getSimilarityScore(tor.constMessage(mi).sourceText(), mv.sourceText()) - >= textSimilarityThreshold) - continue; + // The similar message found in tor (ts file) must NOT correspond exactly + // to an other message is virginTor + if (virginTor.find(tor.constMessage(mi)) < 0) { + if (getSimilarityScore(tor.constMessage(mi).sourceText(), mv.sourceText()) + >= textSimilarityThreshold) + continue; + } } } } -- cgit v1.2.3