exi18n v0.9.0 ExI18n.Loader behaviour View Source

Loads translations.

Link to this section Summary

Functions

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

Loads translations for locale.

Loader type used to store translations.

Options for loader.

Link to this section Functions

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

Parameters

  • loader: Atom with name of storage type or Module.

Examples

iex> ExI18n.Loader.get(:yml)
ExI18n.Loader.YAML
Link to this function

load(locale)

View Source
load(String.t()) :: {:ok, map()} | {:error, term()}

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.
Link to this function

loader_type()

View Source
loader_type() :: atom()

Loader type used to store translations.

Options for loader.

Link to this section Callbacks

Link to this callback

load(locale, options)

View Source
load(locale :: String.t(), options :: term()) ::
  {:ok, translations :: map()} | {:error, error :: term()}