exi18n v0.9.0 ExI18n.Compiler View Source

Compile text with provided values.

Link to this section Summary

Functions

Compile text with provided values.

Link to this section Functions

Link to this function

compile(text, values)

View Source
compile(String.t() | List.t(), map()) :: String.t()

Compile text with provided values.

Parameters

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

Examples

iex> ExI18n.Compiler.compile("hello %{test}", %{"test" => "world"})
"hello world"

iex> ExI18n.Compiler.compile("hello %{test}", %{})
"hello %{test}"

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