diff options
4 files changed, 17 insertions, 2 deletions
diff --git a/src/linguist/lupdate/cpp.cpp b/src/linguist/lupdate/cpp.cpp index b8bb1e859..6f720f27c 100644 --- a/src/linguist/lupdate/cpp.cpp +++ b/src/linguist/lupdate/cpp.cpp @@ -1397,6 +1397,7 @@ STRING(QCoreApplication); STRING(UnicodeUTF8); STRING(DefaultCodec); STRING(CodecForTr); +STRING(Latin1); bool CppParser::matchEncoding() { @@ -1411,7 +1412,8 @@ bool CppParser::matchEncoding() yyTok = getToken(); return true; } - yyMsg() << qPrintable(LU::tr("Unsupported encoding Latin1\n")); + if (yyWord == strLatin1) + yyMsg() << qPrintable(LU::tr("Unsupported encoding Latin1\n")); return false; } diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/expectedoutput.txt b/tests/auto/linguist/lupdate/testdata/good/parsecpp/expectedoutput.txt new file mode 100644 index 000000000..c35c086c8 --- /dev/null +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/expectedoutput.txt @@ -0,0 +1,5 @@ +.*/lupdate/testdata/good/parsecpp/finddialog.cpp:77: Qualifying with unknown namespace/class ::FindDialog +.*/lupdate/testdata/good/parsecpp/finddialog.cpp:127: Qualifying with unknown namespace/class ::FindDialog +.*/lupdate/testdata/good/parsecpp/finddialog.cpp:167: Qualifying with unknown namespace/class ::FindDialog +.*/lupdate/testdata/good/parsecpp/finddialog.cpp:173: Unsupported encoding Latin1 +lupdate warning: Message with id 'yet_another_id' has no source. diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/finddialog.cpp b/tests/auto/linguist/lupdate/testdata/good/parsecpp/finddialog.cpp index 3b1556a29..3833fac3b 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/finddialog.cpp +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/finddialog.cpp @@ -170,7 +170,7 @@ void FindDialog::reset() QString s = QApplication::translate("QCoreApplication", "encoding, using QApplication", 0, QApplication::UnicodeUTF8); QString s = QApplication::translate("Kåntekst", "encoding, using QApplication", 0, QApplication::UnicodeUTF8); - + QString s = QApplication::translate("QTranslator", "Key", "disambiguation", QCoreApplication::Latin1); } diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result index 8bb7fadd8..c0a4a83b2 100644 --- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result +++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result @@ -259,6 +259,14 @@ backslashed \ stuff.</source> </context> <context> <name>QTranslator</name> + <message numerus="yes"> + <location filename="finddialog.cpp" line="173"/> + <source>Key</source> + <comment>disambiguation</comment> + <translation type="unfinished"> + <numerusform></numerusform> + </translation> + </message> <message> <location filename="main.cpp" line="85"/> <location filename="main.cpp" line="86"/> |