exi18n v0.5.1 ExI18n.Loader

Loads translations.

Summary

Functions

Returns loader module based on type that will load translation file

Loads translations for locale

Functions

get(atom)
get(Atom.t) :: Module.t

Returns loader module based on type that will load translation file.

Parameters

  • type: Atom with name of storage type.

Examples

iex> ExI18n.Loader.get(:yml)
ExI18n.Loader.YAML
load(locale)
load(String.t) :: Map.t

Loads translations for locale.

It will use adapter based on storage set in configuration. See get/1

Parameters

  • locale: String with name of locale/file.

Examples

iex> ExI18n.Loader.load("en")
%{"empty" => "empty", "hello" => "Hello world", "hello_2" => %{"world" => "test"},"hello_many" => ["Joe", "Mike"], "hello_name" => "Hello %{name}","incomplete" => %{"path" => %{"text" => "test"}}, "number" => 1}