Topic on Extension talk:CLDR

Mapping country names to ISO codes

1
أحمد (talkcontribs)

The return value of CountryNames::getNames seems to be an array of country names in the desired language, i.e the language whose code is passed in the call. Is the array an indexed array of codes and names? Otherwise, how can one use this to map codes to names? My use case is an extension that provides a parser function {{#country:countrycode [, languagecode]}} to return a country name in the preferred language, or if no language is specified, in the content language. much like

Reply to "Mapping country names to ISO codes"