The cldr
crate is yanked. I'm looking for data that maps language codes (preferably taking into account only the first portion of the code, like "pt" instead of "pt-br") to their names in given language and also data that maps country code to name in given language. I've asked here previously, but still found no good solution.
language_direction(language_code)
-
language_name(language_code, target_language)
-
language_name("en", "pt-br")
= "Inglês" -
language_name("pt", "en-us")
= "Portuguese"
-
-
country_name(country_code, target_language)
-
country_name("us", "pt-br")
= "Estados Unidos" -
country_name("jp", "pt-br")
= "Japão"
-
I think that the target language is significant. For example, zh-CN (Simplified Chinese) and zh-TW (Traditional Chinese) are different.
Previous topics: