gettext v0.11.0 Gettext.Backend behaviour

Behaviour that defines the macros that a Gettext backend has to implement.

These macros are documented in great detail in the documentation for the Gettext module.

Summary

Callbacks

Same as dgettext(domain, msgid, %{})

Translates the given msgid in the given domain

Same as dngettext(domain, msgid, msgid_plural, n, %{})

Translates the given plural translation (msgid + msgid_plural) in the given domain

Same as gettext(msgid, %{})

Same as dgettext("default", msgid, %{})

Same as ngettext(msgid, msgid_plural, n, %{})

Same as dngettext("default", msgid, msgid_plural, n, bindings)

Callbacks

dgettext(domain, msgid)

Specs

dgettext(env :: Macro.Env.t, domain :: Macro.t, msgid :: String.t) :: Macro.t

Same as dgettext(domain, msgid, %{}).

See also Gettext.dgettext/4.

dgettext(domain, msgid, bindings)

Specs

dgettext(env :: Macro.Env.t, domain :: Macro.t, msgid :: String.t, bindings :: Macro.t) :: Macro.t

Translates the given msgid in the given domain.

bindings is a map of bindings to support interpolation.

See also Gettext.dgettext/4.

dngettext(domain, msgid, msgid_plural, n)

Specs

dngettext(env :: Macro.Env.t, domain :: Macro.t, msgid :: String.t, msgid_plural :: String.t, n :: Macro.t) :: Macro.t

Same as dngettext(domain, msgid, msgid_plural, n, %{}).

See also Gettext.dngettext/6.

dngettext(domain, msgid, msgid_plural, n, bindings)

Specs

dngettext(env :: Macro.Env.t, domain :: Macro.t, msgid :: String.t, msgid_plural :: String.t, n :: Macro.t, bindings :: Macro.t) :: Macro.t

Translates the given plural translation (msgid + msgid_plural) in the given domain.

n is an integer used to determine how to pluralize the translation. bindings is a map of bindings to support interpolation.

See also Gettext.dngettext/6.

gettext(msgid)

Specs

gettext(env :: Macro.Env.t, msgid :: String.t) :: Macro.t

Same as gettext(msgid, %{}).

See also Gettext.gettext/3.

gettext(msgid, bindings)

Specs

gettext(env :: Macro.Env.t, msgid :: String.t, bindings :: Macro.t) :: Macro.t

Same as dgettext("default", msgid, %{}).

See also Gettext.gettext/3.

ngettext(msgid, msgid_plural, n)

Specs

ngettext(env :: Macro.Env.t, msgid :: String.t, msgid_plural :: String.t, n :: Macro.t) :: Macro.t

Same as ngettext(msgid, msgid_plural, n, %{}).

See also Gettext.ngettext/5.

ngettext(msgid, msgid_plural, n, bindings)

Specs

ngettext(env :: Macro.Env.t, msgid :: String.t, msgid_plural :: String.t, n :: Macro.t, bindings :: Macro.t) :: Macro.t

Same as dngettext("default", msgid, msgid_plural, n, bindings).

See also Gettext.ngettext/5.