Aurora. Uix. GettextBackend
(Aurora UIX v0.1.4)
Copy Markdown
Default Gettext backend for Aurora UIX.
Implements the three Gettext.Backend callbacks — handle_missing_translation/5,
handle_missing_plural_translation/7, and handle_missing_bindings/2 — and adds two
optional behaviours controlled by compile-time configuration:
- Warning emission — logs a
Logger.warningfor every missing translation so gaps are visible during development. - POT file generation — appends a stub entry to the matching
.potfile the first time anmsgidis encountered at runtime, keeping translation templates in sync with the UI without any manual editing.
See the Internationalization guide for the full configuration reference and recommended development workflow.
Compile-time configuration
All options are read once at compile time via Application.compile_env/2:
| Key | Type | Default | Description |
|---|---|---|---|
:gettext_pot_path | String.t() | nil | nil | Directory where .pot files are written. No file I/O when nil. |
:gettext_show_warnings? | boolean() | false | Set to true to emit Logger.warning calls for missing translations. Warnings are suppressed by default. |
# config/dev.exs — recommended development settings
config :aurora_uix,
gettext_pot_path: "priv/gettext",
gettext_show_warnings?: trueReplacing this backend
Pass a different module via the :gettext_backend application key or via the :backend option
on use Aurora.Uix.Gettext:
config :aurora_uix, gettext_backend: MyApp.CustomGettextBackendSee Aurora.Uix.Gettext for the backend resolution order.