OptimumCredo.Check.Readability.GettextDomain (OptimumCredo v0.5.0)

View Source

Basics

This check is disabled by default.

Learn how to enable it via .credo.exs.

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

Explanation

Use a per-feature Gettext domain.

Bad

gettext("Save")

Good

dgettext("accounts", "Save")

Set ash: true to enable the check, and allowed_domains to restrict the domain names.

Check-Specific Parameters

Use the following parameters to configure this check:

:ash

Enable the Ash heuristics (default false).

This parameter defaults to false.

:allowed_domains

Accepted domain strings; empty accepts any literal.

This parameter defaults to [].

:bare_functions

Gettext functions that must not be called without a domain.

This parameter defaults to [:gettext, :ngettext, :pgettext, :npgettext, :gettext_noop].

General Parameters

Like with all checks, general params can be applied.

Parameters can be configured via the .credo.exs config file.