summaryrefslogtreecommitdiffstats
path: root/tools/linguist/shared/xliff.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-07-17 14:16:31 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-07-17 14:35:21 (GMT)
commitb4d801bf4d6e664ad729e3e95b212b83cc0c784f (patch)
tree086991093228f4296c576d258c3418ae86e23d5b /tools/linguist/shared/xliff.cpp
parent1d52548c21f9ca47e2ef02cd944b7640b0d4dd6b (diff)
downloadQt-b4d801bf4d6e664ad729e3e95b212b83cc0c784f.zip
Qt-b4d801bf4d6e664ad729e3e95b212b83cc0c784f.tar.gz
Qt-b4d801bf4d6e664ad729e3e95b212b83cc0c784f.tar.bz2
reorganize numerus form count normalization
replace implicit normalization of individual messages on file writeout with global normalization which is called by the command line tools. this should a) be faster and b) cover the most critical case: lrelease.
Diffstat (limited to 'tools/linguist/shared/xliff.cpp')
-rw-r--r--tools/linguist/shared/xliff.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/linguist/shared/xliff.cpp b/tools/linguist/shared/xliff.cpp
index 61e4b9f..969d5d4 100644
--- a/tools/linguist/shared/xliff.cpp
+++ b/tools/linguist/shared/xliff.cpp
@@ -243,13 +243,12 @@ static void writeComment(QTextStream &ts, const TranslatorMessage &msg, const QR
}
}
-static void writeTransUnits(QTextStream &ts, const TranslatorMessage &msg, const QRegExp &drops, int indent,
- const Translator &translator, ConversionData &cd, bool *ok)
+static void writeTransUnits(QTextStream &ts, const TranslatorMessage &msg, const QRegExp &drops, int indent)
{
static int msgid;
QString msgidstr = !msg.id().isEmpty() ? msg.id() : QString::fromAscii("_msg%1").arg(++msgid);
- QStringList translns = translator.normalizedTranslations(msg, cd, ok);
+ QStringList translns = msg.translations();
QHash<QString, QString>::const_iterator it;
QString pluralStr;
QStringList sources(msg.sourceText());
@@ -347,8 +346,7 @@ static void writeTransUnits(QTextStream &ts, const TranslatorMessage &msg, const
}
}
-static void writeMessage(QTextStream &ts, const TranslatorMessage &msg, const QRegExp &drops, int indent,
- const Translator &translator, ConversionData &cd, bool *ok)
+static void writeMessage(QTextStream &ts, const TranslatorMessage &msg, const QRegExp &drops, int indent)
{
if (msg.isPlural()) {
writeIndent(ts, indent);
@@ -362,12 +360,12 @@ static void writeMessage(QTextStream &ts, const TranslatorMessage &msg, const QR
writeLineNumber(ts, msg, indent);
writeComment(ts, msg, drops, indent);
- writeTransUnits(ts, msg, drops, indent, translator, cd, ok);
+ writeTransUnits(ts, msg, drops, indent);
--indent;
writeIndent(ts, indent);
ts << "</group>\n";
} else {
- writeTransUnits(ts, msg, drops, indent, translator, cd, ok);
+ writeTransUnits(ts, msg, drops, indent);
}
}
@@ -790,7 +788,7 @@ bool saveXLIFF(const Translator &translator, QIODevice &dev, ConversionData &cd)
}
foreach (const TranslatorMessage &msg, messageOrder[fn][ctx])
- writeMessage(ts, msg, drops, indent, translator, cd, &ok);
+ writeMessage(ts, msg, drops, indent);
if (!ctx.isEmpty()) {
--indent;