TomTom Maps for JavaScript
    Preparing search index...

    Variable languagesConst

    languages: readonly [
        "ngt",
        "ngt-Latn",
        "ar",
        "bg-BG",
        "zh-Hant",
        "zh-Hans",
        "cs-CZ",
        "da-DK",
        "nl-NL",
        "en-AU",
        "en-CA",
        "en-GB",
        "en-NZ",
        "en-US",
        "fi-FI",
        "fr-FR",
        "de-DE",
        "el-GR",
        "hu-HU",
        "id-ID",
        "it-IT",
        "ko-KR",
        "ko-Latn-KR",
        "lt-LT",
        "ms-MY",
        "nb-NO",
        "pl-PL",
        "pt-BR",
        "pt-PT",
        "ru-RU",
        "ru-Latn-RU",
        "ru-Cyrl-RU",
        "sk-SK",
        "sl-SI",
        "es-ES",
        "es-MX",
        "sv-SE",
        "th-TH",
        "tr-TR",
    ] = ...

    Array of all supported language codes for map display and service responses.

    This constant array contains all valid language codes that can be used to configure the language for map labels, place names, addresses, and other textual content.

    The array includes:

    • Region-specific language variants (e.g., en-US, en-GB, pt-BR, pt-PT)
    • Script-specific variants (e.g., zh-Hans for Simplified Chinese, zh-Hant for Traditional Chinese)
    • Special codes like ngt (Neutral Ground Truth) for language-neutral content
    • Latin script alternatives (e.g., ngt-Latn, ko-Latn-KR, ru-Latn-RU)
    • Cyrillic script variants (e.g., ru-Cyrl-RU)

    Use this array to:

    • Validate user-provided language codes
    • Generate language selection UI components
    • Iterate over all available language options
    • Check if a language code is supported
    // Validate a language code
    const userLanguage = 'en-US';
    if (languages.includes(userLanguage)) {
    console.log('Language is supported');
    }

    // Create a language selector
    languages.forEach(lang => {
    console.log(`Available language: ${lang}`);
    });

    // Check total number of supported languages
    console.log(`Total languages: ${languages.length}`);