Aurora.Uix.Gettext (Aurora UIX v0.1.4-rc.3)

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:

  1. Checking the :backend option in opts.
  2. Checking the :gettext_backend application configuration.
  3. 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

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