Backpex (Backpex v0.12.0)

View Source

Backpex provides an easy way to manage existing resources in your application.

Summary

Functions

Translates a text with the configured translator_function. If a live_resource is given, it calls the LiveResource's translate callback.

Translates an error text with the configured error_translator_function.

Functions

translate(msg, live_resource \\ nil)

Translates a text with the configured translator_function. If a live_resource is given, it calls the LiveResource's translate callback.

Examples

Backpex.translate("Hello")

Backpex.translate({"Hello %{name}", %{name: "World"}})

Backpex.translate("Welcome", MyApp.LiveResource)

translate_error(msg)

Translates an error text with the configured error_translator_function.

Examples

Backpex.translate_error("can't be blank")

Backpex.translate_error({"must be greater than %{number}", %{number: 0}})