diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2009-10-01 12:21:19 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-10-01 12:21:19 (GMT) |
commit | f52092927ac8c55f0c81fe218499995fd2478f27 (patch) | |
tree | 6e825acf1346cafa9e6c02296accdab7a6378bde | |
parent | 6f0b674c9c46ff76a4ee8daa61402c6ded849d69 (diff) | |
parent | ce7cf03ab1346b5f447db3d849d2c183abce0138 (diff) | |
download | Qt-f52092927ac8c55f0c81fe218499995fd2478f27.zip Qt-f52092927ac8c55f0c81fe218499995fd2478f27.tar.gz Qt-f52092927ac8c55f0c81fe218499995fd2478f27.tar.bz2 |
Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qt into 4.5
-rw-r--r-- | src/network/access/qhttpnetworkconnection.cpp | 9 | ||||
-rw-r--r-- | tools/linguist/lconvert/main.cpp | 8 | ||||
-rw-r--r-- | tools/linguist/lupdate/main.cpp | 9 |
3 files changed, 17 insertions, 9 deletions
diff --git a/src/network/access/qhttpnetworkconnection.cpp b/src/network/access/qhttpnetworkconnection.cpp index 4fcbc1f..aef1258 100644 --- a/src/network/access/qhttpnetworkconnection.cpp +++ b/src/network/access/qhttpnetworkconnection.cpp @@ -244,6 +244,15 @@ void QHttpNetworkConnectionPrivate::prepareRequest(HttpMessagePair &messagePair) request.d->autoDecompress = false; #endif } + + // some websites mandate an accept-language header and fail + // if it is not sent. This is a problem with the website and + // not with us, but we work around this by setting a + // universal one always. + value = request.headerField("accept-language"); + if (value.isEmpty()) + request.setHeaderField("accept-language", "en,*"); + // set the User Agent value = request.headerField("user-agent"); if (value.isEmpty()) diff --git a/tools/linguist/lconvert/main.cpp b/tools/linguist/lconvert/main.cpp index c342def..3cc9509 100644 --- a/tools/linguist/lconvert/main.cpp +++ b/tools/linguist/lconvert/main.cpp @@ -215,10 +215,6 @@ int main(int argc, char *argv[]) return usage(args); tr.setLanguageCode(Translator::guessLanguageCodeFromFileName(inFiles[0].name)); - if (!targetLanguage.isEmpty()) - tr.setLanguageCode(targetLanguage); - if (!sourceLanguage.isEmpty()) - tr.setSourceLanguageCode(sourceLanguage); if (!tr.load(inFiles[0].name, cd, inFiles[0].format)) { qWarning() << qPrintable(cd.error()); @@ -237,6 +233,10 @@ int main(int argc, char *argv[]) tr.replaceSorted(tr2.message(j)); } + if (!targetLanguage.isEmpty()) + tr.setLanguageCode(targetLanguage); + if (!sourceLanguage.isEmpty()) + tr.setSourceLanguageCode(sourceLanguage); if (noObsolete) tr.stripObsoleteMessages(); if (noFinished) diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp index 8818b50..8560c7d 100644 --- a/tools/linguist/lupdate/main.cpp +++ b/tools/linguist/lupdate/main.cpp @@ -119,12 +119,11 @@ static void printUsage() " Name of a .pro file. Useful for files with .pro\n" " file syntax but different file suffix\n" " -source-language <language>[_<region>]\n" - " Specify/override the language of the source strings. Defaults to\n" - " POSIX if not specified and the file does not name it yet.\n" + " Specify the language of the source strings for new files.\n" + " Defaults to POSIX if not specified.\n" " -target-language <language>[_<region>]\n" - " Specify/override the language of the translation.\n" - " The target language is guessed from the file name if this option\n" - " is not specified and the file contents name no language yet.\n" + " Specify the language of the translations for new files.\n" + " Guessed from the file name if not specified.\n" " -version\n" " Display the version of lupdate and exit.\n" ).arg(m_defaultExtensions)); |