diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2011-08-03 12:01:05 (GMT) |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2011-08-03 12:35:43 (GMT) |
commit | c8af8eaaf6e3a991d488cec56f7c901d88dfc098 (patch) | |
tree | 151615f1e1f4250f3528ee73c6d3fb85ae933176 /qmake | |
parent | 983dca7f3d92bd4f284f83464c164d5fa580b48f (diff) | |
download | Qt-c8af8eaaf6e3a991d488cec56f7c901d88dfc098.zip Qt-c8af8eaaf6e3a991d488cec56f7c901d88dfc098.tar.gz Qt-c8af8eaaf6e3a991d488cec56f7c901d88dfc098.tar.bz2 |
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
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/generators/symbian/symbiancommon.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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(); } |