Skip to content

Function: getLanguage()

ts
function getLanguage(): Promise<string>;

Read-path companion to setLanguage.

Returns the iframe's current language code (e.g. "en", "fr"). Source of truth is the iframe-side language store, not the API's cached mapStatus.language — this lets integrators read the value set by URL ?lang=…, CMS property defaults, or the iframe's built-in language switcher UI, even if setLanguage() was never called.

Returns

Promise<string>

Throws

MAPSTED-1090 when called before the API is READY.