From c8af8eaaf6e3a991d488cec56f7c901d88dfc098 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 3 Aug 2011 15:01:05 +0300 Subject: Ignore child elements in non-application caption/pkg name translations In Symbian, when parsing .ts files for deployment localization, qmake would break if there was any translation using lengthvariants inside QtApplicationCaptions context. Technically this is legal though QtApplicationCaptions context is only meant for application captions and we don't support lenghtvariants for the actual captions themselves. Changed parsing so that any child elements on translations are simply skipped instead of causing parsing errors. Task-number: QT-5169 Reviewed-by: Guoqing Zhang --- qmake/generators/symbian/symbiancommon.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index 8f3bf64..8daef4b 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -993,7 +993,12 @@ bool SymbianCommonGenerator::parseTsContent(const QString &tsFilename, SymbianLo if (xml.name() == sourceElement) { source = xml.readElementText(); } else if (xml.name() == translationElement) { - translation = xml.readElementText(); + // Technically translation element can have child elements + // i.e. numerusform and lengthvariant. We don't support + // these for actual caption/pkgname translations, but since + // they may be present on other unrelated message elements, + // we need to explicitly skip them to avoid parsing errors. + translation = xml.readElementText(QXmlStreamReader::SkipChildElements); } else { xml.skipCurrentElement(); } -- cgit v0.12