Aurora. Uix. Gettext
(Aurora UIX v0.1.4-rc.6)
Copy Markdown
Injects Gettext functionality with configurable backend support.
Sets up the module to use Gettext with a configurable backend. The backend is resolved by:
- Checking the
:backendoption in opts. - Checking the
:gettext_backendapplication configuration. - Falling back to
Aurora.Uix.GettextBackend.
If a deprecated :gettext application configuration exists, it imports that module
instead of using the standard Gettext setup.
Options
:backend(module()) - Optional. The Gettext backend module to use. Defaults toAurora.Uix.GettextBackend.
Examples
defmodule MyApp.Gettext do
use Aurora.Uix.Gettext
end
defmodule MyApp.Gettext do
use Aurora.Uix.Gettext, backend: MyCustomBackend
end
# Usage in modules
defmodule MyApp.Web do
use Aurora.Uix.Gettext
end
# Then use standard Gettext functions
MyApp.Gettext.gettext("Hello") # => "Hola" (depending on locale)Configuration
Can be configured via application config:
config :aurora_uix, :gettext_backend, MyCustomBackend