diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-10-25 23:26:53 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-10-25 23:26:53 (GMT) |
commit | cbb1b29d397c063fc3bcae04c5b062f20cbd12c5 (patch) | |
tree | d89cebe45c9f6dfdcab34a95da19ee0d670e30f5 /tools/linguist | |
parent | ed7d58f6668be4ffb5f915722dee81c864f74844 (diff) | |
parent | 9aa00de1d277763c0f7a380fde27face60e5f686 (diff) | |
download | Qt-cbb1b29d397c063fc3bcae04c5b062f20cbd12c5.zip Qt-cbb1b29d397c063fc3bcae04c5b062f20cbd12c5.tar.gz Qt-cbb1b29d397c063fc3bcae04c5b062f20cbd12c5.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Conflicts:
tools/qdoc3/cppcodemarker.cpp
Diffstat (limited to 'tools/linguist')
-rw-r--r-- | tools/linguist/lupdate/main.cpp | 2 | ||||
-rw-r--r-- | tools/linguist/shared/qm.cpp | 9 | ||||
-rw-r--r-- | tools/linguist/shared/translatormessage.cpp | 8 |
3 files changed, 13 insertions, 6 deletions
diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp index d570e02..af40616 100644 --- a/tools/linguist/lupdate/main.cpp +++ b/tools/linguist/lupdate/main.cpp @@ -160,6 +160,8 @@ static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFil tor.setCodecName(codecForTr); if (!targetLanguage.isEmpty()) tor.setLanguageCode(targetLanguage); + else + tor.setLanguageCode(Translator::guessLanguageCodeFromFileName(fileName)); if (!sourceLanguage.isEmpty()) tor.setSourceLanguageCode(sourceLanguage); } diff --git a/tools/linguist/shared/qm.cpp b/tools/linguist/shared/qm.cpp index fefe91c..317a07e 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); } @@ -713,7 +714,7 @@ static bool saveQM(const Translator &translator, QIODevice &dev, ConversionData continue; } if (typ == TranslatorMessage::Unfinished) { - if (msg.translation().isEmpty()) { + if (!cd.m_idBased && msg.translation().isEmpty()) { ++untranslated; continue; } else { diff --git a/tools/linguist/shared/translatormessage.cpp b/tools/linguist/shared/translatormessage.cpp index 417f6b1..db6f333 100644 --- a/tools/linguist/shared/translatormessage.cpp +++ b/tools/linguist/shared/translatormessage.cpp @@ -151,6 +151,7 @@ bool TranslatorMessage::operator==(const TranslatorMessage& m) const return (m_context == m.m_context) && m_sourcetext == m.m_sourcetext && m_extra[msgIdPlural] == m.m_extra[msgIdPlural] + && m_id == m.m_id && (m_sourcetext.isEmpty() || m_comment == m.m_comment); } @@ -161,7 +162,9 @@ bool TranslatorMessage::operator<(const TranslatorMessage& m) const return m_context < m.m_context; if (m_sourcetext != m.m_sourcetext) return m_sourcetext < m.m_sourcetext; - return m_comment < m.m_comment; + if (m_comment != m.m_comment) + return m_comment < m.m_comment; + return m_id < m.m_id; } int qHash(const TranslatorMessage &msg) @@ -170,7 +173,8 @@ int qHash(const TranslatorMessage &msg) qHash(msg.context()) ^ qHash(msg.sourceText()) ^ qHash(msg.extra(QLatin1String("po-msgid_plural"))) ^ - qHash(msg.comment()); + qHash(msg.comment()) ^ + qHash(msg.id()); } bool TranslatorMessage::hasExtra(const QString &key) const |