ExI18n
ExI18n is key-based internationalization library for Elixir.
Installation
Add exi18n to your list of dependencies and to applications in mix.exs:
def deps do
[
{:exi18n, "~> 0.4.0"}
]
end
def application do
[applications: [:exi18n]]
endConfiguration
Add configuration to your config/config.exs:
config :exi18n,
default_locale: "en",
locales: ~w(en),
path: "priv/locales",
compile_prefix: "%{",
compile_suffix: "}",
storage: :ymlConfiguration parameters:
default_locale- default locale in your application. Default:"en"locales- supported locales. Default:["en"]fallback- fallback to default locale if translation empty. Default:falsepath- path to your translation files. Default:"priv/locales"compile_prefix- prefix for values in translations. Default:"%{"compile_suffix- suffix for values in translations. Default:"}"storage- storage type. Supported types::yml, Default::yml