summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp
diff options
context:
space:
mode:
authorChris Axiarlis <chris.axiarlis@nokia.com>2012-05-03 08:24:11 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-16 04:06:31 +0200
commite057680b996d6854c9aee8f6504acc873f0e65ac (patch)
tree1d915a7bdaa1fe9b6b64c2f8239df59d0067b148 /src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp
parent9c68d7c658bc1901efa7b2e43a4a8be61a313c40 (diff)
downloadqtlocation-e057680b996d6854c9aee8f6504acc873f0e65ac.tar.gz
Add support for language setting in the plugin.
Added support for handling the languages in the plugin based on the locale. Allowing for flexibility based on other paramaters which cannot be determined simply from the language. Change-Id: I37302cb14d84f865898b8aaa9b41be2ae8075352 Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp')
-rw-r--r--src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp
index 3a77f215..59a9cea3 100644
--- a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp
@@ -193,9 +193,48 @@ QString QGeoTileFetcherNokia::getRequestString(const QGeoTileSpec &spec)
requestString += "&referer=";
requestString += QGeoServiceProviderFactoryNokia::defaultReferer;
}
+
+ requestString += "&lg=";
+ requestString += getLanguageString();
+
return requestString;
}
+QString QGeoTileFetcherNokia::getLanguageString() const
+{
+ const QLocale::Language lang = m_engineNokia->locale().language();
+ // English is the default, where no ln is specified. We hardcode the languages
+ // here even though the entire list is updated automagically from the server.
+ // The current languages are Arabic, Chinese, Simplified Chinese, English
+ // French, German, Italian, Polish, Russian and Spanish. The default is English.
+ // These are acually available from the same host under the URL: /maptiler/v2/info
+
+ switch (lang) {
+ case QLocale::Arabic:
+ return "ARA";
+ case QLocale::Chinese:
+ if (QLocale::TraditionalChineseScript == m_engineNokia->locale().script())
+ return "CHI";
+ else
+ return "CHT";
+ case QLocale::French:
+ return "FRE";
+ case QLocale::German:
+ return "GER";
+ case QLocale::Italian:
+ return "ITA";
+ case QLocale::Polish:
+ return "POL";
+ case QLocale::Russian:
+ return "RUS";
+ case QLocale::Spanish:
+ return "SPA";
+ default:
+ return "ENG";
+ }
+ // No "lg" param means that we want English.
+}
+
QString QGeoTileFetcherNokia::token() const
{
return m_token;