View Source Bonfire.Common.Localise.Gettext.Helpers (bonfire_umbrella v0.9.6-classic-beta.12)
A module providing Internationalization with a gettext-based API.
By using Gettext, your module gains a set of macros for translations, for example:
import Bonfire.Common.Localise.Gettext
# Simple translation
usage:
<%= l("Hello") %>
<%= l("Hello %{name}", name: "Bookchin") %>
<%= l("Hi", [], "test context") %>
output:
Hello
Hello Bookchin
Hi
# Plural translation
usage:
<%= lp("Hi friend", "Hi friends", 2) %>
<%= lp("Hiya %{user_or_users}", "Hiyas %{user_or_users}", 1, [user_or_users: "Bookchin"], "test context") %>
output:
Hi friends
Hiya Bookchin
See the Gettext Docs for details.
Summary
Functions
Localise a list of strings at compile time
Functions
Link to this macro
l(original_text_or_id, bindings \\ [], context \\ nil, domain \\ nil)
View Source (macro)Localise a list of strings at compile time
Link to this macro