View Source Cldr Languages

Build Status Hex.pm Hex.pm Hex.pm

ex_cldr_languages is an addon library application for ex_cldr that provides localization and listing of languages.

The primary api is MyApp.Backend.Language.to_string/2. The following examples demonstrate:

iex> MyApp.Backend.Language.to_string "en-GB"
{:ok, "British English"}

iex> MyApp.Backend.Language.to_string "en-GB", style: :short
{:ok, "UK English"}

iex> MyApp.Backend.Language.to_string "en", locale: "de"
{:ok, "Englisch"}

installation

Installation

def deps do
  [
    {:ex_cldr_languages, "~> 0.2.0"}
  ]
end

migration-from-v0-1-1-to-v0-2-0

Migration from v0.1.1 to v0.2.0

With the switch to ex_cldr v2 any functionality is now to be called via MyApp.Backend.Language instead of Cldr.Language. This breaking change was also used to remove all_languages/0 in favor of available_languages/0.