View Source Bonfire.Common.Localise.Gettext.Helpers (bonfire v0.3.5-classic-beta.4)

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

  <%= l("Hello") %>
  <%= l("Hello %{name}", name: "Bookchin") %>
  <%= l("Hi", [], "test context") %>

  Hello Bookchin

# Plural translation

  <%= lp("Hi friend", "Hi friends", 2) %>
  <%= lp("Hiya %{user_or_users}", "Hiyas %{user_or_users}", 1, [user_or_users: "Bookchin"], "test context") %>

  Hi friends
  Hiya Bookchin

See the Gettext Docs for details.

Link to this section Summary

Link to this section Functions

Link to this macro

l(original_text_or_id, bindings \\ [], context \\ nil, domain \\ nil)

View Source (macro)
Link to this function

localise_dynamic(msgid, caller_module \\ nil)

View Source
Link to this macro

localise_strings(strings, caller_module \\ nil)

View Source (macro)

Localise a list of strings at compile time

Link to this macro

lp(original_text_or_id, msgid_plural, n, bindings \\ [], context \\ nil, domain \\ nil)

View Source (macro)