summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-09-20 12:23:53 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-09-20 12:23:53 (GMT)
commitb81201a29a9794ed490098c8eb136464afa12b8a (patch)
tree7d7ad331c8c5316924bd5ff3fd7e6ccb21e7cc48 /qmake
parent5243b9eaf3deb201f23b2710c274e3108a4eb23b (diff)
parentfde1488aa7476eba915fbac958c56664df8ecf82 (diff)
downloadQt-b81201a29a9794ed490098c8eb136464afa12b8a.zip
Qt-b81201a29a9794ed490098c8eb136464afa12b8a.tar.gz
Qt-b81201a29a9794ed490098c8eb136464afa12b8a.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-symbian-staging into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/qt-symbian-staging: (31 commits) runonphone: Include USB serial ports on OS X for CODA, too runonphone: Implement traceswitch support for coda Fix missing clean up stack panic for a new thread in Symbian Regression in QS60Style when drawing webview scrollbars Cleanup qwidget_s60.cpp Fix panic when global QSettings instance needs flusing at app exit Fix uninitialised variable in temporary files More accurately determine bearer type for symbian GPRS/3G Add documentation for Symbian QSettings locations and security Update QDesktopServices openUrl() documentation on Symbian OS Mark binaries as SMPSAFE in Symbian Fix "sbs -c tools2 --what" output for Qt. Update environment.prf QS60Style: Make spinboxes and lineedits slightly taller runonphone: Add a missing space between a message and the file name runonphone: Allow overriding the temporary sis file name Fix QIcon auto-tests for Symbian Add a cast to moc cpp generator to remove armcc warnings Fix qt.conf for Symbian to use $${EPOCROOT} Remove few unused variables. ...
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/symbian/symbiancommon.cpp63
1 files changed, 28 insertions, 35 deletions
diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp
index c9ffa11..2c4373a 100644
--- a/qmake/generators/symbian/symbiancommon.cpp
+++ b/qmake/generators/symbian/symbiancommon.cpp
@@ -953,12 +953,15 @@ bool SymbianCommonGenerator::parseTsContent(const QString &tsFilename, SymbianLo
static QString messageElement = QLatin1String("message");
static QString sourceElement = QLatin1String("source");
static QString translationElement = QLatin1String("translation");
- static QString shortCaptionId = QLatin1String("Application short caption");
- static QString longCaptionId = QLatin1String("Application long caption");
- static QString pkgDisplayNameId = QLatin1String("Package name");
- static QString installerPkgDisplayNameId = QLatin1String("Smart installer package name");
- static QString languageAttribute = QLatin1String("language");
- static QChar underscoreChar = QLatin1Char('_');
+ static QString idAttribute = QLatin1String("id");
+ static QString shortCaptionId = QLatin1String("qtn_short_caption_");
+ static QString longCaptionId = QLatin1String("qtn_long_caption_");
+ static QString pkgDisplayNameId = QLatin1String("qtn_package_name_");
+ static QString installerPkgDisplayNameId = QLatin1String("qtn_smart_installer_package_name_");
+ static QString shortCaptionSource = QLatin1String("Application short caption");
+ static QString longCaptionSource = QLatin1String("Application long caption");
+ static QString pkgDisplayNameSource = QLatin1String("Package name");
+ static QString installerPkgDisplayNameSource = QLatin1String("Smart installer package name");
enum CurrentContext {
ContextUnknown,
@@ -991,6 +994,7 @@ bool SymbianCommonGenerator::parseTsContent(const QString &tsFilename, SymbianLo
if (xml.name() == messageElement) {
QString source;
QString translation;
+ QString id = xml.attributes().value(idAttribute).toString();
while (xml.readNextStartElement()) {
if (xml.name() == sourceElement) {
source = xml.readElementText();
@@ -1005,35 +1009,24 @@ bool SymbianCommonGenerator::parseTsContent(const QString &tsFilename, SymbianLo
xml.skipCurrentElement();
}
}
-
- if (source == shortCaptionId) {
- if (loc->shortCaption.isEmpty()) {
- loc->shortCaption = translation;
- } else {
- fprintf(stderr, "Warning: Duplicate application short caption defined in (%s).\n",
- qPrintable(tsFilename));
- }
- } else if (source == longCaptionId) {
- if (loc->longCaption.isEmpty()) {
- loc->longCaption = translation;
- } else {
- fprintf(stderr, "Warning: Duplicate application long caption defined in (%s).\n",
- qPrintable(tsFilename));
- }
- } else if (source == pkgDisplayNameId) {
- if (loc->pkgDisplayName.isEmpty()) {
- loc->pkgDisplayName = translation;
- } else {
- fprintf(stderr, "Warning: Duplicate package display name defined in (%s).\n",
- qPrintable(tsFilename));
- }
- } else if (source == installerPkgDisplayNameId) {
- if (loc->installerPkgDisplayName.isEmpty()) {
- loc->installerPkgDisplayName = translation;
- } else {
- fprintf(stderr, "Warning: Duplicate smart installer package display name defined in (%s).\n",
- qPrintable(tsFilename));
- }
+ // Interesting translations can be identified either by id attribute
+ // of the message or by the source text.
+ // Allow translations with correct id to override translations
+ // detected by source text, as the source text can accidentally
+ // be the same in another string if there are non-interesting
+ // translations added to same context.
+ if (id.startsWith(shortCaptionId)
+ || (loc->shortCaption.isEmpty() && source == shortCaptionSource)) {
+ loc->shortCaption = translation;
+ } else if (id.startsWith(longCaptionId)
+ || (loc->longCaption.isEmpty() && source == longCaptionSource)) {
+ loc->longCaption = translation;
+ } else if (id.startsWith(pkgDisplayNameId)
+ || (loc->pkgDisplayName.isEmpty() && source == pkgDisplayNameSource)) {
+ loc->pkgDisplayName = translation;
+ } else if (id.startsWith(installerPkgDisplayNameId)
+ || (loc->installerPkgDisplayName.isEmpty() && source == installerPkgDisplayNameSource)) {
+ loc->installerPkgDisplayName = translation;
}
} else {
xml.skipCurrentElement();