ex_cldr_languages v0.1.1 Cldr.Language View Source

Cldr Languages does provide functionality regarding languages within the data supplied by the Cldr core package.

Link to this section Summary

Functions

Returns a list of the languages’ iso-codes listed for the ex_cldr default locale

Return all the languages’ iso-codes available for a given locale. Defaults to the current locale

Return a map of iso-code keyed maps of language names in any available formats for the given locale. Defaults to the current locale

Try to translate the given lanuage iso code or language tag

Link to this section Types

Link to this type styles() View Source
styles() :: :standard | :short

Link to this section Functions

Link to this function all_languages() View Source
all_languages() :: [String.t()]

Returns a list of the languages’ iso-codes listed for the ex_cldr default locale.

Example

> Cldr.Language.all_languages()
["aa", "ab", "ace", "ach", "ada", "ady", "ae", "aeb", "af", "afh", "agq", "ain",
"ak", "akk", "akz", "ale", "aln", "alt", "am", "an", "ang", "anp", "ar",
"ar-001", "arc", "arn", "aro", "arp", "arq", "ars", "arw", "ary", "arz", "as",
"asa", "ase", "ast", "av", "avk", "awa", "ay", "az", "ba", "bal", "ban", "bar",
"bas", "bax", "bbc", "bbj", ...]
Link to this function available_languages(locale \\ Cldr.get_current_locale()) View Source
available_languages(String.t() | Cldr.LanguageTag.t()) ::
  [String.t()] |
  {:error, term()}

Return all the languages’ iso-codes available for a given locale. Defaults to the current locale.

Example

> Cldr.Language.available_languages("en")
["aa", "ab", "ace", "ach", "ada", "ady", "ae", "aeb", "af", "afh", "agq", "ain",
"ak", "akk", "akz", "ale", "aln", "alt", "am", "an", "ang", "anp", "ar",
"ar-001", "arc", "arn", "aro", "arp", "arq", "ars", "arw", "ary", "arz", "as",
"asa", "ase", "ast", "av", "avk", "awa", "ay", "az", "ba", "bal", "ban", "bar",
"bas", "bax", "bbc", "bbj", ...]
Link to this function known_languages(locale \\ Cldr.get_current_locale()) View Source
known_languages(String.t() | Cldr.LanguageTag.t()) ::
  %{required(styles()) => String.t()} |
  {:error, term()}

Return a map of iso-code keyed maps of language names in any available formats for the given locale. Defaults to the current locale.

Example

> Cldr.Language.known_languages("en")
%{"bez" => %{standard: "Bena"}, "lo" => %{standard: "Lao"},
"kha" => %{standard: "Khasi"}, "eo" => %{standard: "Esperanto"},
"rm" => %{standard: "Romansh"}, "ja" => %{standard: "Japanese"},
"sw-CD" => %{standard: "Congo Swahili"},
"pdc" => %{standard: "Pennsylvania German"}, "om" => %{standard: "Oromo"},
"jut" => %{standard: "Jutish"}, "lij" => %{standard: "Ligurian"},
"kut" => %{standard: "Kutenai"}, "vep" => %{standard: "Veps"},
"yao" => %{standard: "Yao"}, "gez" => %{standard: "Geez"},
"cr" => %{standard: "Cree"}, "ne" => %{standard: "Nepali"},
"zbl" => %{standard: "Blissymbols"}, "ae" => %{standard: "Avestan"},
"rof" => %{standard: "Rombo"}, "tkl" => %{standard: "Tokelau"},
"rgn" => %{standard: "Romagnol"}, "el" => %{standard: "Greek"},
"myv" => %{standard: "Erzya"}, "smj" => %{standard: "Lule Sami"},
"fo" => %{standard: "Faroese"}, "ii" => %{standard: "Sichuan Yi"},
"bum" => %{standard: "Bulu"}, "za" => %{standard: "Zhuang"},
"raj" => %{standard: "Rajasthani"}, "mrj" => %{standard: "Western Mari"},
"stq" => %{standard: "Saterland Frisian"}, "hu" => %{standard: "Hungarian"},
"mga" => %{standard: "Middle Irish"}, "bej" => %{standard: "Beja"},
"yue" => %{standard: "Cantonese"}, "xog" => %{standard: "Soga"},
"ttt" => %{standard: "Muslim Tat"}, "uga" => %{standard: "Ugaritic"},
"rup" => %{standard: "Aromanian"},
"crs" => %{standard: "Seselwa Creole French"}, "oc" => %{standard: "Occitan"},
"chp" => %{standard: "Chipewyan"}, "zen" => %{standard: "Zenaga"},
"kmb" => %{standard: "Kimbundu"}, "nr" => %{standard: "South Ndebele"},
"tiv" => %{standard: "Tiv"}, "aln" => %{standard: "Gheg Albanian"},
"sh" => %{standard: "Serbo-Croatian"}, "fil" => %{...}, ...}
Link to this function to_string(key, options \\ []) View Source

Try to translate the given lanuage iso code or language tag.