# `VerifiedTranslations.Credo.PreferSigil`
[🔗](https://github.com/treathealth/verified_translations/blob/v0.1.1/lib/verified_translations/credo/prefer_sigil.ex#L2)

## Basics

> #### This check is disabled by default. {: .neutral}
>
> [Learn how to enable it](`e:credo:config_file.html#checks`) via `.credo.exs`.

This check has a base priority of `normal` and works with any version of Elixir.

## Explanation

Prefer the `~t` sigil and `tn/2` over Gettext's macros.

    # not preferred
    gettext("Welcome back, %{name}!", name: @user.name)
    ngettext("1 file", "%{count} files", length(files))

    # preferred
    ~t"Welcome back, #{@user.name}!"
    tn(length(files), one: "1 file", other: "%{count} files")

Both are verified at compile time by verified_translations, but `~t`
keeps the bindings next to the text. Fix all of them automatically
with:

    mix verified_translations.migrate

## Check-Specific Parameters

*There are no specific parameters for this check.*

## General Parameters

Like with all checks, [general params](`e:credo:check_params.html`) can be applied.

Parameters can be configured via the [`.credo.exs` config file](`e:credo:config_file.html`).

---

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