Kanta.Backend (kanta v0.5.1)
Kanta.Backend is a module that provides an enhanced Gettext backend with database support.
It extends the standard Gettext functionality by:
- First checking for translations in the database
- Falling back to PO file translations if not found in the database
Usage
defmodule MyApp.Gettext do
use Kanta.Backend, otp_app: :my_app
endOptions
:otp_app- The OTP application that contains the backend:priv- The directory where the translations are stored (defaults to "priv/YOUR_MODULE"):kanta_adapter- The adapter module to use for database lookups (defaults toKanta.Backend.Adapter.CachedDB)
it also accepts all the Gettext.Backend options. See the official Gettext documentation for more details.