diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-04-01 15:51:27 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2009-04-02 07:56:07 (GMT) |
commit | 385bb34a9dc8e7bd6d1d3c11247862b87978d629 (patch) | |
tree | a93c84529181ab715bf44648ea9287727bd01a55 /tools/linguist/lrelease/main.cpp | |
parent | 4e036ebbc6351a9bd6597e89a803f5c4de746092 (diff) | |
download | Qt-385bb34a9dc8e7bd6d1d3c11247862b87978d629.zip Qt-385bb34a9dc8e7bd6d1d3c11247862b87978d629.tar.gz Qt-385bb34a9dc8e7bd6d1d3c11247862b87978d629.tar.bz2 |
duplicate message handling improvements
- lrelease will not abort on duplicates any more
- lconvert now gets noisy, but only if messages within one file are
duplicated (combining files with identical messages is ok)
- lupdate stays silent, but will eliminate duplicates again
- consolidate handling of dual-encoded and duplicate messages - for
performance
- instead of the format loader, now the app is responsible for calling
the duplicate handler. this allows for the fine-grained control
necessary for optimal performance.
Task-number: 247738
Diffstat (limited to 'tools/linguist/lrelease/main.cpp')
-rw-r--r-- | tools/linguist/lrelease/main.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/tools/linguist/lrelease/main.cpp b/tools/linguist/lrelease/main.cpp index f1fdb3a..3bcc998 100644 --- a/tools/linguist/lrelease/main.cpp +++ b/tools/linguist/lrelease/main.cpp @@ -94,19 +94,6 @@ static bool loadTsFile(Translator &tor, const QString &tsFileName, bool /* verbo } else { if (!cd.errors().isEmpty()) printOut(cd.error()); - const QList<TranslatorMessage> dupes = tor.findDuplicates(); - if (!dupes.isEmpty()) { - qWarning("lrelease error: duplicate messages found in '%s':", - qPrintable(tsFileName)); - foreach (const TranslatorMessage &msg, dupes) { - qWarning("\n* Context: %s\n* Source: %s", - qPrintable(msg.context()), - qPrintable(msg.sourceText())); - if (!msg.comment().isEmpty()) - qWarning("\n* Comment: %s", qPrintable(msg.comment())); - } - ok = false; - } } return ok; } @@ -115,6 +102,8 @@ static bool releaseTranslator(Translator &tor, const QString &qmFileName, bool verbose, bool ignoreUnfinished, bool removeIdentical, TranslatorSaveMode mode) { + Translator::reportDuplicates(tor.resolveDuplicates(), qmFileName, verbose); + if (verbose) printOut(QCoreApplication::tr( "Updating '%1'...\n").arg(qmFileName)); if (removeIdentical) { |