Validates :sigils options passed to use GettextSigils. All other options are passed through to use Gettext.
Options
:domain- Default Gettext domain within the module that is usingGettextSigils. Use the:defaultatom to follow the backend's configured default domain, or a binary to override.:context- Default Gettext context within the module that is usingGettextSigils. May benil(the default) or a binary.:modifiers- A keyword list of options applied when using the~tsigil with modifiers.The key has to be an atom between
:aand:z. Uppercase modifiers are used by the library (eg.Nfor pluralization).Each entry can be a static keyword list, a module atom, or a
{module, opts}tuple. The keyword-list form is shorthand for the built-inGettextSigils.Modifiers.KeywordModifier, whose options are::domain- Gettext domain. Use the:defaultatom to select the backend's configured default domain, or a binary to override.:context- Gettext context. Usenilto clear the context, or a binary to override.
The default value is
[].
Example
use GettextSigils,
backend: MyApp.Gettext,
sigils: [
domain: "default",
context: "dashboard",
modifiers: [
e: [domain: "errors"],
a: [context: "admin"]
]
]
Summary
Functions
Validates the given options or raises a NimbleOptions.ValidationError if invalid.
Functions
Validates the given options or raises a NimbleOptions.ValidationError if invalid.
After validation, the :modifiers keyword list is converted into a map keyed by
the character code of each modifier letter (e.g. ?e instead of :e) so that
modifier lookup can do a direct Map.fetch/2 against the sigil charlist without
re-converting characters to atoms on every expansion.