exi18n v0.5.1 ExI18n.Loader.YAML

Loads translations from YAML files.

Summary

Functions

Loads yaml file with translations

Functions

load(locale)
load(String.t) :: Map.t

Loads yaml file with translations.

Parameters

  • locale: String with name of locale/file.

Examples

iex> ExI18n.Loader.YAML.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}

iex> ExI18n.Loader.YAML.load("invalid")
** (ArgumentError) Failed to open file test/fixtures/invalid.yml