Yatapp v0.1.4 Yatapp.ExI18n.Compiler View Source

Compile text with provided values.

Link to this section Summary

Functions

Compile text with provided values.

Parameters

  • text: String or List of strings to compile.
  • values: Map of values.

Examples

iex> Yatapp.ExI18n.Compiler.compile("hello %{test}", %{"test" => "world"})
"hello world"
iex> Yatapp.ExI18n.Compiler.compile("hello %{test}", %{})
"hello %{test}"
iex> Yatapp.ExI18n.Compiler.compile(["hello %{test}", "No.%{nr}"], %{"test" => "world", "nr" => 1})
["hello world", "No.1"]

Link to this section Functions

Link to this function compile(text, values) View Source
compile(String.t() | List.t(), Map.t()) :: String.t()

Compile text with provided values.

Parameters

  • text: String or List of strings to compile.
  • values: Map of values.

Examples

iex> Yatapp.ExI18n.Compiler.compile("hello %{test}", %{"test" => "world"})
"hello world"
iex> Yatapp.ExI18n.Compiler.compile("hello %{test}", %{})
"hello %{test}"
iex> Yatapp.ExI18n.Compiler.compile(["hello %{test}", "No.%{nr}"], %{"test" => "world", "nr" => 1})
["hello world", "No.1"]