summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-10-21 12:42:43 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-10-22 08:40:43 (GMT)
commitbabfff66074573bb34a0abd561052c1cc4df5ef0 (patch)
treef282b3b04cc50ed74091029129d157b5640393d1
parente546f7b1bfe98436c26fb6aa11a88053ae4eb185 (diff)
downloadQt-babfff66074573bb34a0abd561052c1cc4df5ef0.zip
Qt-babfff66074573bb34a0abd561052c1cc4df5ef0.tar.gz
Qt-babfff66074573bb34a0abd561052c1cc4df5ef0.tar.bz2
id-based: use source strings instead of empty translations only for unfinished messages
-rw-r--r--tests/auto/linguist/lrelease/testdata/idbased.ts1
-rw-r--r--tools/linguist/shared/qm.cpp7
2 files changed, 5 insertions, 3 deletions
diff --git a/tests/auto/linguist/lrelease/testdata/idbased.ts b/tests/auto/linguist/lrelease/testdata/idbased.ts
index 61497de..cd47158 100644
--- a/tests/auto/linguist/lrelease/testdata/idbased.ts
+++ b/tests/auto/linguist/lrelease/testdata/idbased.ts
@@ -9,6 +9,7 @@
</message>
<message id="untranslated_id">
<source>This has no translation.</source>
+ <translation type="unfinished"></translation>
</message>
<message id="this_another_id">
<source>Foo bar.</source>
diff --git a/tools/linguist/shared/qm.cpp b/tools/linguist/shared/qm.cpp
index fefe91c..998d0ac 100644
--- a/tools/linguist/shared/qm.cpp
+++ b/tools/linguist/shared/qm.cpp
@@ -440,9 +440,10 @@ void Releaser::insert(const TranslatorMessage &message, bool forceComment)
void Releaser::insertIdBased(const TranslatorMessage &message)
{
QStringList tlns = message.translations();
- for (int i = 0; i < tlns.size(); ++i)
- if (tlns.at(i).isEmpty())
- tlns[i] = message.sourceText();
+ if (message.type() == TranslatorMessage::Unfinished)
+ for (int i = 0; i < tlns.size(); ++i)
+ if (tlns.at(i).isEmpty())
+ tlns[i] = message.sourceText();
ByteTranslatorMessage bmsg("", originalBytes(message.id(), false), "", tlns);
m_messages.insert(bmsg, 0);
}