HERE Maps API - Setting the language
Oskar Bukolt
(Talk | contribs) m (Oskar Bukolt - Update JS Lib + API Links) |
m (Jasfox - update to 2.2.4) |
||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 11: | Line 11: | ||
|platform= Web browser | |platform= Web browser | ||
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) --> | |devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) --> | ||
| − | |dependencies=Nokia Maps 2.2. | + | |dependencies=Nokia Maps 2.2.4 |
|signing=<!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer --> | |signing=<!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer --> | ||
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. --> | |capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. --> | ||
| − | |keywords= | + | |keywords= Nokia Maps, JavaScript, language |
|id= <!-- Article Id (Knowledge base articles only) --> | |id= <!-- Article Id (Knowledge base articles only) --> | ||
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese --> | |language= <!-- Language category code for non-English topics - e.g. Lang-Chinese --> | ||
| Line 29: | Line 29: | ||
{{SeeAlso| | {{SeeAlso| | ||
| − | * [http:// | + | * [http://developer.here.net/javascript_api Nokia Maps API] |
| − | * [http:// | + | * [http://www.developer.nokia.com/Community/Wiki/Nokia_Maps_API_-_getting_and_setting_the_default_language_in_application_context Getting and Setting the Default Language] |
| + | * [http://developer.here.net/apiexplorer/examples/api-for-js/map/map-change-language.html Changing the language of the map] | ||
}} | }} | ||
== Setting the map interface language == | == Setting the map interface language == | ||
| Line 36: | Line 37: | ||
To set the language, use the following: | To set the language, use the following: | ||
| − | <code | + | <code javascript> |
| − | nokia.Settings.set( "defaultLanguage","de-DE"); | + | nokia.Settings.set("defaultLanguage","de-DE"); |
</code> | </code> | ||
| Line 77: | Line 78: | ||
== Summary == | == Summary == | ||
| − | Please check out the chapter http:// | + | Please check out the chapter http://developer.here.net/docs/maps_js/topics/language-support.html for more information on languages. |
Revision as of 14:35, 14 March 2013
This article explains how to set the map interface language and how to display more language information
Article Metadata
Compatibility
Article
Setting the map interface language
To set the language, use the following:
nokia.Settings.set("defaultLanguage","de-DE");
For the language, define it in format of ISO3166-1 alpha-2 country code, e.g. en-US, de-DE and so on.
Getting more language information
When you want to display more information, use the class nokia.maps.language.Info.
It has a method called getDefinition (code, [definitions]) : Object.
This will retrieve the language meta data for a given LCID. The look up will be done in two steps: First the full LCID (ISO-639-1 AND ISO-3166-1 alpha-2) will be matched. If the full LCID cannot be found the more general form (ISO-639-1 only) will be matched.
An example of using the getDefinition() method:
mylanguage = nokia.maps.language.Info;
Would return:
Object { definitions={...}, translations={...}, more...}
then...
mylanguage.getDefinition("de-DE");
would return e.g:
Object { key="de", iso639_1="de", more...}
Summary
Please check out the chapter http://developer.here.net/docs/maps_js/topics/language-support.html for more information on languages.

