# `mix ash_gettext.install`
[🔗](https://github.com/Undeadlol1/ash_gettext/blob/v0.1.0/lib/mix/tasks/ash_gettext.install.ex#L1)

Wire this application into `ash_gettext`.

    mix ash_gettext.install                    # preview every edit
    mix ash_gettext.install --apply            # write them
    mix ash_gettext.install --backend MyApp.Gettext --resolver MyApp.LocaleResolver

For each Ash domain it adds the `AshGettext.Domain` extension and a
`gettext do` block naming this app's Gettext backend. A domain that already
has the extension is skipped, so re-running is safe.

## Options

  * `--backend` — the Gettext backend to translate against. Detected from the
    project when there is exactly one `use Gettext.Backend`.
  * `--resolver` — the module implementing `AshGettext.Locale.Resolver` that
    each domain names. Defaults to `LocaleResolver` in the backend's
    namespace, such as `MyApp.LocaleResolver`.
  * `--text-domain` — defaults to `ash`, so the texts go to `ash.pot`.
  * `--apply` — write the changes. Without it, nothing is written.

## What this cannot do for you

The resolver module. Translating to *the signed-in user's saved language*
needs code that knows where this app stores that, and a generic library must
not assume it. The task prints a module to copy; write it, because the build
fails until it exists.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
