https://github.com/elixir-cldr/cldr_languages
https://github.com/elixir-cldr/cldr_languages
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/elixir-cldr/cldr_languages
- Owner: elixir-cldr
- License: other
- Created: 2017-12-07T16:23:46.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-06-13T12:08:41.000Z (about 2 years ago)
- Last Synced: 2025-06-28T10:48:36.965Z (12 months ago)
- Language: Elixir
- Size: 57.6 KB
- Stars: 6
- Watchers: 2
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Cldr Languages
[](https://hex.pm/packages/ex_cldr_languages)
[](https://hex.pm/packages/ex_cldr_languages)
[](https://hex.pm/packages/ex_cldr_languages)
[ex_cldr_languages](https://github.com/elixir-cldr/cldr_languages) is an addon library application for [ex_cldr](https://hex.pm/packages/ex_cldr) that provides localization and listing of languages.
The primary api is `MyApp.Backend.Language.to_string/2`. The following examples demonstrate:
```elixir
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
```elixir
def deps do
[
{:ex_cldr_languages, "~> 0.3.0"}
]
end
```
## 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`.