Home > @magiclane/maps-sdk > SdkSettings > getBestLanguageMatch

SdkSettings.getBestLanguageMatch() method

Find the best language match for the provided input.

Signature:

static getBestLanguageMatch(languageCode: string, regionCode?: string, scriptCode?: string, variant?: ScriptVariant): Language | null;

Parameters

Parameter

Type

Description

languageCode

string

ISO 639-3 three-letter language code.

regionCode

string

(Optional) ISO 3166-1_3 three-letter region code, can be empty.

scriptCode

string

(Optional) ISO 15924 four-letter script code, can be empty.

variant

ScriptVariant

(Optional) script variant

Returns:

Language | null

Language object if a match is found, otherwise null.

Exceptions

An exception if it fails.