Y18N v1.0.0 Orisons.Y18N View Source

Module to get translation in a language specified in config.

Link to this section Summary

Functions

Reload translation from yaml files to ets

Translate string from parameter to language specified in config

Translate string from parameter to language from session stored in Plug.Conn

Translate string from parameter to language specified in config with plural detection

Translate string from parameter to language from session stored in Plug.Conn, with plural detection

Link to this section Functions

Link to this function reload_translations() View Source
reload_translations() :: boolean()

Reload translation from yaml files to ets.

Translate string from parameter to language specified in config.

Examples

iex> Orisons.Y18N.y("Hello world")
"Witaj świecie"
Link to this function y(conn, string) View Source
y(Plug.Conn.t(), String.t()) :: String.t()

Translate string from parameter to language from session stored in Plug.Conn.

Examples

iex> Orisons.Y18N.y(conn, "Hello world")
"Witaj świecie"
Link to this function y(string, string_plural, count) View Source
y(String.t(), String.t(), number()) :: String.t()

Translate string from parameter to language specified in config with plural detection.

Examples

iex> Orisons.Y18N.y("%d apple", "%d apples", 3)
"3 jabłka"
Link to this function y(conn, string, string_plural, count) View Source
y(Plug.Conn.t(), String.t(), String.t(), number()) :: String.t()

Translate string from parameter to language from session stored in Plug.Conn, with plural detection.

Examples

iex> Orisons.Y18N.y(conn, "%d apple", "%d apples", 3)
"3 jabłka"