diff options
author | Lucie Gerard <lucie.gerard@qt.io> | 2019-01-22 13:58:41 +0100 |
---|---|---|
committer | Lucie Gerard <lucie.gerard@qt.io> | 2019-01-23 10:18:20 +0000 |
commit | 9f5f80570c91f6da8f558f305c51734768fbec7c (patch) | |
tree | dba6032076ee5dfc2f9502d7a4dcb7d75bc66d63 /src/linguist | |
parent | 150cccb4a935a2a889ac8379e08dcaa52e48f6b5 (diff) |
Check that similar message does not have an other exact fit
Task-number: QTBUG-69521
Change-Id: I77d936feb4d4ee189ed1c774b5e2afecfad7676b
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/linguist')
-rw-r--r-- | src/linguist/lupdate/merge.cpp | 10 |
1 files 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; + } } } } |