exi18n v0.4.0 ExI18n.Cache

Cache that manage loaded locales.

Summary

Functions

Fetch translations for given locale

Handler for :fetch call

Initialize cache table

Starts a cache server

Functions

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

Fetch translations for given locale.

Parameters

  • locale: String with locale to fetch.

Examples

iex> ExI18n.Cache.fetch("en")
%{"hello" => "Hello world", "hello_2" => %{"world" => "test"},"hello_many" => ["Joe", "Mike"], "hello_name" => "Hello %{name}","incomplete" => %{"path" => %{"text" => "test"}}, "number" => 1}
handle_call(msg, from, state)

Handler for :fetch call.

init(args)

Initialize cache table.

start_link()

Starts a cache server.