summaryrefslogtreecommitdiffstats
path: root/tools/linguist/shared/po.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-06-29 16:54:19 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-06-29 16:56:22 (GMT)
commitf0a66c60d1eba14be2b3fdc9307fdd2e4a421a5c (patch)
treeb1ef602a2ffef28c94d99a59ac8858691411c777 /tools/linguist/shared/po.cpp
parent1414c682c532a95a2204bc1b2d01d2493357b686 (diff)
downloadQt-f0a66c60d1eba14be2b3fdc9307fdd2e4a421a5c.zip
Qt-f0a66c60d1eba14be2b3fdc9307fdd2e4a421a5c.tar.gz
Qt-f0a66c60d1eba14be2b3fdc9307fdd2e4a421a5c.tar.bz2
support editing of length variants
this is not complete, e.g. full text search does not discern which variant contains the hit, the integration with phrases&guesses is non-existing, etc. the form preview will do funny things as long as the widgets don't support the multi-variant strings.
Diffstat (limited to 'tools/linguist/shared/po.cpp')
-rw-r--r--tools/linguist/shared/po.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/linguist/shared/po.cpp b/tools/linguist/shared/po.cpp
index cb943be..e22aa7d 100644
--- a/tools/linguist/shared/po.cpp
+++ b/tools/linguist/shared/po.cpp
@@ -395,7 +395,10 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd)
const QString prefix = QLatin1String(isObsolete ? "#~ " : "");
while (true) {
int idx = line.indexOf(QLatin1Char(' '), prefix.length());
- item.msgStr.append(slurpEscapedString(lines, l, idx, prefix, cd));
+ QString str = slurpEscapedString(lines, l, idx, prefix, cd);
+ str.replace(QChar(Translator::TextVariantSeparator),
+ QChar(Translator::BinaryVariantSeparator));
+ item.msgStr.append(str);
if (l + 1 >= lines.size() || !isTranslationLine(lines.at(l + 1)))
break;
++l;
@@ -635,8 +638,11 @@ bool savePO(const Translator &translator, QIODevice &dev, ConversionData &cd)
out << poEscapedString(prefix, QLatin1String("msgid_plural"), noWrap, plural);
QStringList translations = translator.normalizedTranslations(msg, cd, &ok);
for (int i = 0; i != translations.size(); ++i) {
+ QString str = translations.at(i);
+ str.replace(QChar(Translator::BinaryVariantSeparator),
+ QChar(Translator::TextVariantSeparator));
out << poEscapedString(prefix, QString::fromLatin1("msgstr[%1]").arg(i), noWrap,
- translations.at(i));
+ str);
}
}
first = false;