This library exposes functions to convert ISO 639-1 language code representation to ISO 639-2 and backwards where it's applicable. Data for conversions was taken from Benjamin Martin's repo. Note about ISO 639-2/B: all Bibliographic codes will be converted to ISO 639-2 codes
To use ISO639 in your Mix projects, first add ISO639 as a dependency, as well as the JSON library you want to use.
def deps do
[
{:iso639_elixir, "~> 0.2.1", submodules: true},
{:jason, "~> 1.0"}
]
end
You can use a different JSON library for decoding of JSON file with dictionary of languages, just add library of your preference to your deps:
def deps do
[
{:iso639_elixir, "~> 0.2.1", submodules: true},
{:poison, "~> 5.0"}
]
end
And configure which library to use in your config file. Default is Jason
# config/config.exs
config :iso639_elixir, :json_library, Poison
After adding ISO639 as a dependency, run mix deps.get
to install it.
Documentation can be found at hexdocs.