summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-03-31 09:32:48 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-03-31 16:37:14 (GMT)
commit89c369f344455a11259b29854a3556650a88c63d (patch)
treeb640d894e21529a09e07706b8d24c767ec68a7a1
parentba40d481456095304729d0ef4279e0a53281798a (diff)
downloadQt-89c369f344455a11259b29854a3556650a88c63d.zip
Qt-89c369f344455a11259b29854a3556650a88c63d.tar.gz
Qt-89c369f344455a11259b29854a3556650a88c63d.tar.bz2
don't mark untranslated messages as fuzzy in PO files
... as this is what gettext processors expect.
-rw-r--r--tests/auto/linguist/lconvert/data/endless-po-loop.ts4
-rw-r--r--tests/auto/linguist/lconvert/data/msgid.ts8
-rw-r--r--tests/auto/linguist/lconvert/data/singular.po3
-rw-r--r--tests/auto/linguist/lconvert/data/wrapping.po1
-rw-r--r--tools/linguist/shared/po.cpp4
5 files changed, 8 insertions, 12 deletions
diff --git a/tests/auto/linguist/lconvert/data/endless-po-loop.ts b/tests/auto/linguist/lconvert/data/endless-po-loop.ts
index 6212fbd..8aa7215 100644
--- a/tests/auto/linguist/lconvert/data/endless-po-loop.ts
+++ b/tests/auto/linguist/lconvert/data/endless-po-loop.ts
@@ -5,12 +5,12 @@
<name>Assistant</name>
<message>
<source>This is some text which introduces the DonauDampfSchifffahrtsKapitaensMuetzeMitKomischenUltraViolettenFransenUndEinemKnopf</source>
- <translation></translation>
+ <translation type="unfinished"></translation>
</message>
<message>
<location filename="this/is/a/really/really/absurdly/no,/grotesquely/long/path/supposed/to/blow/up.cpp" line="20"/>
<source>%n document(s) found.</source>
- <translation></translation>
+ <translation type="unfinished"></translation>
</message>
</context>
</TS>
diff --git a/tests/auto/linguist/lconvert/data/msgid.ts b/tests/auto/linguist/lconvert/data/msgid.ts
index f89fa74..39401d8 100644
--- a/tests/auto/linguist/lconvert/data/msgid.ts
+++ b/tests/auto/linguist/lconvert/data/msgid.ts
@@ -5,23 +5,23 @@
<name>Dialog2</name>
<message numerus="yes">
<source>%n files</source>
- <translation>
+ <translation type="unfinished">
<numerusform></numerusform>
</translation>
</message>
<message id="this_is_some_id" numerus="yes">
<source>%n cars</source>
- <translation>
+ <translation type="unfinished">
<numerusform></numerusform>
</translation>
</message>
<message>
<source>Age: %1</source>
- <translation></translation>
+ <translation type="unfinished"></translation>
</message>
<message id="this_is_another_id">
<source>func3</source>
- <translation></translation>
+ <translation type="unfinished"></translation>
</message>
</context>
</TS>
diff --git a/tests/auto/linguist/lconvert/data/singular.po b/tests/auto/linguist/lconvert/data/singular.po
index a0d4019..e0cfafb 100644
--- a/tests/auto/linguist/lconvert/data/singular.po
+++ b/tests/auto/linguist/lconvert/data/singular.po
@@ -9,7 +9,6 @@ msgstr "translated"
msgid "untranslated two"
msgstr "translated"
-#, fuzzy
#| msgid "old untranslated"
msgid "untranslated two b"
msgstr ""
@@ -20,7 +19,6 @@ msgstr ""
msgid "untranslated three"
msgstr "translated"
-#, fuzzy
#| msgid "old untranslated"
#| msgid_plural "old untranslated plural"
msgid "untranslated three b"
@@ -31,7 +29,6 @@ msgstr ""
msgid "untranslated four"
msgstr "translated"
-#, fuzzy
#| msgid_plural "old untranslated only plural"
msgid "untranslated four b"
msgstr ""
diff --git a/tests/auto/linguist/lconvert/data/wrapping.po b/tests/auto/linguist/lconvert/data/wrapping.po
index 39b7fbe..8223611 100644
--- a/tests/auto/linguist/lconvert/data/wrapping.po
+++ b/tests/auto/linguist/lconvert/data/wrapping.po
@@ -3,7 +3,6 @@
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
-#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
diff --git a/tools/linguist/shared/po.cpp b/tools/linguist/shared/po.cpp
index 87b2a8a..2895143 100644
--- a/tools/linguist/shared/po.cpp
+++ b/tools/linguist/shared/po.cpp
@@ -482,7 +482,7 @@ bool loadPO(Translator &translator, QIODevice &dev, ConversionData &cd)
msg.setTranslations(item.msgStr);
if (isObsolete)
msg.setType(TranslatorMessage::Obsolete);
- else if (item.isFuzzy)
+ else if (item.isFuzzy || (!msg.sourceText().isEmpty() && !msg.isTranslated()))
msg.setType(TranslatorMessage::Unfinished);
else
msg.setType(TranslatorMessage::Finished);
@@ -645,7 +645,7 @@ bool savePO(const Translator &translator, QIODevice &dev, ConversionData &cd)
bool noWrap = false;
QStringList flags;
- if (msg.type() == TranslatorMessage::Unfinished)
+ if (msg.type() == TranslatorMessage::Unfinished && msg.isTranslated())
flags.append(QLatin1String("fuzzy"));
TranslatorMessage::ExtraData::const_iterator itr =
msg.extras().find(QLatin1String("po-flags"));