exi18n v0.5.1 ExI18n.Compiler

Compile text with provided values.

Summary

Functions

Compile text with provided values

Functions

compile(text, values)
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> 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"]