Home > @magiclane/maps-sdk > LocalizationService > getString
LocalizationService.getString() method
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.
Signature:
static getString(stringId: number, useDefaultString?: boolean): string;Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
stringId |
number |
The ID of the string to retrieve |
|
useDefaultString |
boolean |
(Optional) Whether to return the default string if the ID is not found |
Returns:
string
The localized string corresponding to the given string ID