Namespaces
Variants
Actions
(Difference between revisions)

HERE Maps API - Setting the language

Jump to: navigation, search
(Avnee.nathani - - Summary: updated link)
(Avnee.nathani -)
Line 1: Line 1:
 
[[Category:Web]][[Category:Browser]][[Category:Nokia Maps]]
 
[[Category:Web]][[Category:Browser]][[Category:Nokia Maps]]
 
{{Abstract|This article explains how to set the map interface language and how to display more language information }}
 
{{Abstract|This article explains how to set the map interface language and how to display more language information }}
 
+
{{ArticleMetaData
 +
|platform= Web browser
 +
|update-by=[[User:avnee.nathani]]
 +
|update-timestamp=20111231
 +
}}
 
== Setting the map interface language ==
 
== Setting the map interface language ==
  
Line 7: Line 11:
  
 
<code java>
 
<code java>
ovi.mapsapi.packages.load("language", "de-DE");
+
nokia.maps.packages.load("language", "de-DE");
 
</code>
 
</code>
  
Line 14: Line 18:
 
== Getting more language information ==
 
== Getting more language information ==
  
When you want to display more information, use the class ovi.mapsapi.language.Info.
+
When you want to display more information, use the class nokia.maps.language.Info.
  
 
It has a method called "getDefinition (code, [definitions]) : Object".
 
It has a method called "getDefinition (code, [definitions]) : Object".
Line 25: Line 29:
  
 
<code java>
 
<code java>
>>> mylanguage = ovi.mapsapi.language.Info;
+
>>> mylanguage = nokia.maps.language.Info;
 
</code>
 
</code>
  

Revision as of 14:06, 31 December 2011

This article explains how to set the map interface language and how to display more language information

Article Metadata

Compatibility
Platform(s): Web browser

Article
Created: (31 Dec 2011)
Updated: avnee.nathani (31 Dec 2011)
Last edited: avnee.nathani (31 Dec 2011)

Setting the map interface language

To set the language, use the following:

nokia.maps.packages.load("language", "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 lookup 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:

>>> 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://api.maps.nokia.com/2.1.0/apireference/symbols/nokia.maps.language.html for more information on languages.

329 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved