View Source IsoLang (iso_lang v0.3.1)
Documentation for IsoLang
.
Provides utilities for dealing with ISO 639 languages.
see-also
See Also
Link to this section Summary
Functions
Returns a list of all available ISO language codes.
Callback implementation for Gettext.Backend.dgettext/3
.
Callback implementation for Gettext.Backend.dgettext_noop/2
.
Callback implementation for Gettext.Backend.dngettext/5
.
Callback implementation for Gettext.Backend.dngettext_noop/3
.
Callback implementation for Gettext.Backend.dpgettext/4
.
Callback implementation for Gettext.Backend.dpngettext/6
.
Searches for matching languages using a case-insensitive query string
As find/2
, but raises on error
Gets a single language struct identified by a field.
If the :by
field is not specified, fields are checked in the following order
As get/2
, but raises on error
Callback implementation for Gettext.Backend.gettext/2
.
Callback implementation for Gettext.Backend.gettext_comment/1
.
Callback implementation for Gettext.Backend.gettext_noop/1
.
Callback implementation for Gettext.Backend.handle_missing_bindings/2
.
Callback implementation for Gettext.Backend.handle_missing_plural_translation/7
.
Callback implementation for Gettext.Backend.handle_missing_translation/5
.
Callback implementation for Gettext.Backend.ngettext/4
.
Callback implementation for Gettext.Backend.ngettext_noop/2
.
Callback implementation for Gettext.Backend.pgettext/3
.
Callback implementation for Gettext.Backend.pngettext/5
.
Link to this section Types
Link to this section Functions
Returns a list of all available ISO language codes.
Callback implementation for Gettext.Backend.dgettext/3
.
Callback implementation for Gettext.Backend.dgettext_noop/2
.
dngettext(domain, msgid, msgid_plural, n, bindings \\ Macro.escape(%{}))
View Source (macro)Callback implementation for Gettext.Backend.dngettext/5
.
Callback implementation for Gettext.Backend.dngettext_noop/3
.
dpgettext(domain, msgctxt, msgid, bindings \\ Macro.escape(%{}))
View Source (macro)Callback implementation for Gettext.Backend.dpgettext/4
.
dpngettext(domain, msgctxt, msgid, msgid_plural, n, bindings \\ Macro.escape(%{}))
View Source (macro)Callback implementation for Gettext.Backend.dpngettext/6
.
Searches for matching languages using a case-insensitive query string
options
Options
:by
specifies which struct field to be used in the search. One of:alpha2
,:alpha3b
,:alpha3t
,:name
. Default::name
examples
Examples
iex> IsoLang.find("eng")
{:ok,
[
%IsoLang{
alpha2: "",
alpha3b: "ang",
alpha3t: "",
name: "English, Old (ca.450-1100)",
native_name: nil
},
%IsoLang{
alpha2: "bn",
alpha3b: "ben",
alpha3t: "",
name: "Bengali",
native_name: "বাংলা"
},
# ... etc...
]
}
As find/2
, but raises on error
Gets a single language struct identified by a field.
If the :by
field is not specified, fields are checked in the following order:
:alpha2
:alpha3b
:alpha3t
:name
Keep in mind that the :alpha2
(2-character codes) and :alpha3b
(3-character codes)
are the most common -- not every language defines a :alpha3t
code.
options
Options
:by
specifies which struct field to be used in the search. One of:alpha2
,:alpha3b
,:alpha3t
,:name
. (optional; default will examine all fields for a match in the order indicated above)
examples
Examples
iex> IsoLang.get("de")
{:ok,
%IsoLang{
alpha2: "de",
alpha3b: "ger",
alpha3t: "deu",
name: "German",
native_name: "Deutsch"
}}
As get/2
, but raises on error
Callback implementation for Gettext.Backend.gettext/2
.
Callback implementation for Gettext.Backend.gettext_comment/1
.
Callback implementation for Gettext.Backend.gettext_noop/1
.
Callback implementation for Gettext.Backend.handle_missing_bindings/2
.
handle_missing_plural_translation(locale, domain, msgctxt, msgid, msgid_plural, n, bindings)
View SourceCallback implementation for Gettext.Backend.handle_missing_plural_translation/7
.
handle_missing_translation(locale, domain, msgctxt, msgid, bindings)
View SourceCallback implementation for Gettext.Backend.handle_missing_translation/5
.
lngettext(locale, domain, msgctxt \\ nil, msgid, msgid_plural, n, bindings)
View Sourcengettext(msgid, msgid_plural, n, bindings \\ Macro.escape(%{}))
View Source (macro)Callback implementation for Gettext.Backend.ngettext/4
.
Callback implementation for Gettext.Backend.ngettext_noop/2
.
Callback implementation for Gettext.Backend.pgettext/3
.
pngettext(msgctxt, msgid, msgid_plural, n, bindings \\ Macro.escape(%{}))
View Source (macro)Callback implementation for Gettext.Backend.pngettext/5
.