Home > @magiclane/maps-sdk > LocalizationService

LocalizationService class

Localization service to retrieve localized strings.

This class provides methods to get localized strings based on string IDs. The returned strings are localized according to the current SdkSettings.language setting.

The ids from LocalizationStringIds might be valuable for all API users.

Localization Service

Signature:

export declare abstract class LocalizationService 

Methods

Method

Modifiers

Description

getLanguageNativeName(language)

static

Retrieves the native name of the given language.

The native name is the name of the language in that language itself.

getString(stringId, useDefaultString)

static

Retrieves a localized string for the given string ID.

If useDefaultString is true and the string ID is not found in the current language, the default string (in English) will be returned instead of an empty string. If the string ID does not exist, an empty string is returned.

The localization is based on the current SdkSettings.language setting.

getStrings(stringIds, useDefaultString)

static

Retrieves multiple localized strings for the given list of string IDs.

If useDefaultString is true and a string ID is not found in the current language, the default string (in English) will be returned instead of an empty string. If a string ID does not exist, an empty string is returned for that ID.

The localization is based on the current SdkSettings.language setting.