Namespaces
Variants
Actions
Revision as of 15:40, 3 January 2013 by jasfox (Talk | contribs)

HERE Maps API - Setting the language

Jump to: navigation, search

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


Article Metadata

Compatibility
Platform(s): Web browser
Dependencies: Nokia Maps 2.2.1

Article
Keywords: Nokia Maps, JavaScript, language
Created: Maveric (28 Jun 2011)
Updated: avnee.nathani (31 Dec 2011)
Last edited: jasfox (03 Jan 2013)

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.

352 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