Maps API for JavaScript Developer's Guide

H.ui.i18n.Localization

Class Summary

This class is used for internationalization of UI components.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

getLocale () : {string}

This method retrieves the current locale code, for example 'en-US'.

getKeys () : {Array<string>}

This method retrieves translation keys for current locale. Keys from this set can be used to get translations via translate method.

hasKey (key) : {boolean}

This method retrieves a Boolean value indicating whether the given localization object has a translation for the specified translation key.

translate (key) : {string}

This method retrieves translation for the key provided by the caller. It throws an exception if a translation is not available.

Class Description

This class is used for internationalization of UI components.

Constructor Details

H.ui.i18n.Localization(locale, opt_translationMap)

Parameters:
 
locale:
{string}
 
A locale code, for example 'en-GB'
opt_translationMap:
{Object=} [optional]
 
An optional translation map for this locale. If not provided, the Locale is initialized with default translations, if available

Method Details

getLocale () : {string}

This method retrieves the current locale code, for example 'en-US'.

Returns:
 
{string}
A locale identifier

getKeys () : {Array<string>}

This method retrieves translation keys for current locale. Keys from this set can be used to get translations via translate method.

Returns:
 
{Array<string>}
A string containin translation keys

hasKey (key) : {boolean}

This method retrieves a Boolean value indicating whether the given localization object has a translation for the specified translation key.

Parameters:
 
key:
{string}
 
A transaltion key
Returns:
 
{boolean}
true if the key exists, otherwise false.

translate (key) : {string}

This method retrieves translation for the key provided by the caller. It throws an exception if a translation is not available.

Parameters:
 
key:
{string}
 
A translation key
Returns:
 
{string}
A localized string corresponding to the provided key

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.