I am working on the following code snippet:
locales = __.each results, (value, index, list) ->
locale = value.split("-")[0] # gives me type of string "ru"
console.log typeof locale
console.log cldr.extractLanguageDisplayNames(locale).ru
console.log cldr.extractLanguageDisplayNames(locale).locale
When I use
console.log cldr.extractLanguageDisplayNames(locale).ru
, it successfully returns 'русский'. However, when I use console.log cldr.extractLanguageDisplayNames(locale).locale
, I only get undefined
.
The main goal here is to dynamically generate country names based on the locales folders.