584 |
586 |
585 void Translator::reportDuplicates(const Duplicates &dupes, |
587 void Translator::reportDuplicates(const Duplicates &dupes, |
586 const QString &fileName, bool verbose) |
588 const QString &fileName, bool verbose) |
587 { |
589 { |
588 if (!dupes.byId.isEmpty() || !dupes.byContents.isEmpty()) { |
590 if (!dupes.byId.isEmpty() || !dupes.byContents.isEmpty()) { |
|
591 std::cerr << "Warning: dropping duplicate messages in '" << qPrintable(fileName); |
589 if (!verbose) { |
592 if (!verbose) { |
590 qWarning("Warning: dropping duplicate messages in '%s'\n(try -verbose for more info).", |
593 std::cerr << "'\n(try -verbose for more info).\n"; |
591 qPrintable(fileName)); |
|
592 } else { |
594 } else { |
593 qWarning("Warning: dropping duplicate messages in '%s':", qPrintable(fileName)); |
595 std::cerr << "':\n"; |
594 foreach (int i, dupes.byId) |
596 foreach (int i, dupes.byId) |
595 qWarning("\n* ID: %s", qPrintable(message(i).id())); |
597 std::cerr << "\n* ID: " << qPrintable(message(i).id()) << std::endl; |
596 foreach (int j, dupes.byContents) { |
598 foreach (int j, dupes.byContents) { |
597 const TranslatorMessage &msg = message(j); |
599 const TranslatorMessage &msg = message(j); |
598 qWarning("\n* Context: %s\n* Source: %s", |
600 std::cerr << "\n* Context: " << qPrintable(msg.context()) |
599 qPrintable(msg.context()), |
601 << "\n* Source: " << qPrintable(msg.sourceText()) << std::endl; |
600 qPrintable(msg.sourceText())); |
|
601 if (!msg.comment().isEmpty()) |
602 if (!msg.comment().isEmpty()) |
602 qWarning("* Comment: %s", qPrintable(msg.comment())); |
603 std::cerr << "* Comment: " << qPrintable(msg.comment()) << std::endl; |
603 } |
604 } |
604 qWarning(); |
605 std::cerr << std::endl; |
605 } |
606 } |
606 } |
607 } |
607 } |
608 } |
608 |
609 |
609 // Used by lupdate to be able to search using absolute paths during merging |
610 // Used by lupdate to be able to search using absolute paths during merging |
686 } |
687 } |
687 if (truncated) |
688 if (truncated) |
688 cd.appendError(QLatin1String( |
689 cd.appendError(QLatin1String( |
689 "Removed plural forms as the target language has less " |
690 "Removed plural forms as the target language has less " |
690 "forms.\nIf this sounds wrong, possibly the target language is " |
691 "forms.\nIf this sounds wrong, possibly the target language is " |
691 "not set or recognized.\n")); |
692 "not set or recognized.")); |
692 } |
693 } |
693 |
694 |
694 QString Translator::guessLanguageCodeFromFileName(const QString &filename) |
695 QString Translator::guessLanguageCodeFromFileName(const QString &filename) |
695 { |
696 { |
696 QString str = filename; |
697 QString str = filename; |