summaryrefslogtreecommitdiffstats
path: root/tools/linguist/shared/qph.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/qph.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/qph.cpp')
-rw-r--r--tools/linguist/shared/qph.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/linguist/shared/qph.cpp b/tools/linguist/shared/qph.cpp
index 40f0386..4a29e0f 100644
--- a/tools/linguist/shared/qph.cpp
+++ b/tools/linguist/shared/qph.cpp
@@ -99,6 +99,8 @@ bool QPHReader::read(Translator &translator)
else if (m_currentField == DefinitionField)
m_currentDefinition += text();
} else if (isEndElement() && name() == QLatin1String("phrase")) {
+ m_currentTarget.replace(QChar(Translator::TextVariantSeparator),
+ QChar(Translator::BinaryVariantSeparator));
TranslatorMessage msg;
msg.setSourceText(m_currentSource);
msg.setTranslation(m_currentTarget);
@@ -159,7 +161,10 @@ static bool saveQPH(const Translator &translator, QIODevice &dev, ConversionData
foreach (const TranslatorMessage &msg, translator.messages()) {
t << "<phrase>\n";
t << " <source>" << protect(msg.sourceText()) << "</source>\n";
- t << " <target>" << protect(msg.translations().join(QLatin1String("@")))
+ QString str = msg.translations().join(QLatin1String("@"));
+ str.replace(QChar(Translator::BinaryVariantSeparator),
+ QChar(Translator::TextVariantSeparator));
+ t << " <target>" << protect(str)
<< "</target>\n";
if (!msg.context().isEmpty() || !msg.comment().isEmpty())
t << " <definition>" << msg.context() << msg.comment()