summaryrefslogtreecommitdiff
path: root/src/opensearch/opensearchengine.cpp
diff options
context:
space:
mode:
authormegabigbug <megabigbug@arrakis.(none)>2010-10-03 14:56:21 +0200
committermegabigbug <megabigbug@arrakis.(none)>2010-10-03 14:56:21 +0200
commitc6269e60d14b8e2682cbb42d708e4fc9e640075c (patch)
tree04d9d39ba02fea123285b108915f4b8368388059 /src/opensearch/opensearchengine.cpp
parentFix OpenSearchManager behavior to work in every case (also the disconnected o... (diff)
downloadrekonq-c6269e60d14b8e2682cbb42d708e4fc9e640075c.tar.xz
use local language instead of english for opensearch
Diffstat (limited to 'src/opensearch/opensearchengine.cpp')
-rw-r--r--src/opensearch/opensearchengine.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/opensearch/opensearchengine.cpp b/src/opensearch/opensearchengine.cpp
index 78e50980..4ef43871 100644
--- a/src/opensearch/opensearchengine.cpp
+++ b/src/opensearch/opensearchengine.cpp
@@ -55,12 +55,15 @@ OpenSearchEngine::~OpenSearchEngine()
QString OpenSearchEngine::parseTemplate(const QString &searchTerm, const QString &searchTemplate)
{
+ QString language = QLocale().name();
+ // Simple conversion to RFC 3066.
+ language = language.replace(QLatin1Char('_'), QLatin1Char('-'));
+
QString result = searchTemplate;
result.replace(QL1S("{count}"), QL1S("20"));
result.replace(QL1S("{startIndex}"), QL1S("0"));
result.replace(QL1S("{startPage}"), QL1S("0"));
- // TODO - get setting from KDE
- result.replace(QL1S("{language}"), QL1S("en-US"));
+ result.replace(QLatin1String("{language}"), language);
result.replace(QL1S("{inputEncoding}"), QL1S("UTF-8"));
result.replace(QL1S("{outputEncoding}"), QL1S("UTF-8"));
result.replace(QL1S("{searchTerms}"), searchTerm);