Kanta.Backend.Adapter.CachedDB (kanta v0.5.1)
Kanta adapter used in *gettext functions from Kanta.Gettext.Macros.
Handles translation lookups in cache and DB for both singular and plural forms.
Summary
Functions
Translates a message with the given locale, domain, context, and message ID.
Translates a plural message with the given locale, domain, context, message IDs, count and bindings.
Functions
Translates a message with the given locale, domain, context, and message ID.
Parameters
locale- ISO-639 code for the localedomain- Name of the translation domainmsgctxt- Optional context for the messagemsgid- Message ID to translatebindings- Map or keyword list of variables to interpolate
Returns
{:ok, translation}- When translation is found{:error, :not_found}- When translation is not found
Translates a plural message with the given locale, domain, context, message IDs, count and bindings.
Parameters
locale- ISO-639 code for the localedomain- Name of the translation domainmsgctxt- Optional context for the messagemsgid- Singular message IDmsgid_plural- Plural message IDn- Count to determine which plural form to usebindings- Map or keyword list of variables to interpolate
Returns
{:ok, translation}- When translation is found{:error, :not_found}- When translation is not found