Aurora.Uix.GettextBackend (Aurora UIX v0.1.5-rc.1)

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.warning for every missing translation so gaps are visible during development.
  • POT file generation — appends a stub entry to the matching .pot file the first time an msgid is 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:

KeyTypeDefaultDescription
:gettext_pot_pathString.t() | nilnilDirectory where .pot files are written. No file I/O when nil.
:gettext_show_warnings?boolean()falseSet 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?: true

Replacing 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.CustomGettextBackend

See Aurora.Uix.Gettext for the backend resolution order.