exi18n v0.4.0 ExI18n
ExI18n - key-based internationalization library.
Summary
Functions
Search for translation in given locale
based on provided key
.
Parameters
locale
:String
with name of locale.key
:String
with path to translation.values
:Map
with values that will be interpolated.
Examples
iex> ExI18n.t("en", "hello")
"Hello world"
iex> ExI18n.t("en", "hello_name", name: "Joe")
"Hello Joe"
iex> ExI18n.t("en", "invalid")
** (ArgumentError) Missing translation for key: invalid
iex> ExI18n.t("en", "incomplete.path")
** (ArgumentError) incomplete.path is incomplete path to translation.
iex> ExI18n.t("en", "hello_name", name: %{"1" => "2"})
** (Protocol.UndefinedError) protocol String.Chars not implemented for %{"1" => "2"}