Search code examples
androidhere-api

What is the language format returned by Map.getSupportedMapDisplayLanguages()


I'm working on an app using Here API Android Premium and want to show users a list of languages to select from for use with Map.setMapSecondaryDisplayLanguage() from Class Map.

The same Map class has a function to provide a list of all supported languages Map.getSupportedMapDisplayLanguages(), which should be perfect.

List<String> mapTLangs = map.getSupportedMapDisplayLanguages();
sLogger.e(mapTLangs);
E/LanguageMenu: [AFR, ALB, ARA, ARM, ASM, AZE, BAQ, BEL, BEN, BOS, BUL, CAT, CHI, CHT ...

The values returned by getSupportedMapDisplayLanguages() are three letter acronyms and I can't find what format they're in.

Most of them are found in the ISO 639-2/B" listings but some of them like CHT are not in any of the listings there.

Does anyone know how to convert these TLA's to the Locale needed for Map.setMapSecondaryDisplayLanguage()


Solution

  • I guess you're looking for this list of 2-letter and 3-letter language codes for map labels: Map Label Languages

    The 3-letter language codes are based on MARC codes (which are also the basis for ISO 639-2), but with some Navteq additions like CHT for Traditional Chinese (used in Taiwan and Hongkong), whereas CHI is used for Simplified Chinese (used in mainland China).

    While country codes look similar for being 3-letter acronyms as well, they make up a completely different list.