Const// 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}`);
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:
en-US,en-GB,pt-BR,pt-PT)zh-Hansfor Simplified Chinese,zh-Hantfor Traditional Chinese)ngt(Neutral Ground Truth) for language-neutral contentngt-Latn,ko-Latn-KR,ru-Latn-RU)ru-Cyrl-RU)Use this array to: