View Source mix gettext.extract (gettext v0.20.0)
Extracts translations by recompiling the Elixir source code.
mix gettext.extract [OPTIONS]
Translations are extracted into POT (Portable Object Template) files (with a
.pot
extension). The location of these files is determined by the :otp_app
and :priv
options given by Gettext modules when they call use Gettext
. One
POT file is generated for each translation domain.
All automatically extracted translations are assigned the elixir-autogen
flag.
If a translation from the POT is no longer present and has the elixir-autogen
flag, the translation will be removed.
Before v0.19.0
, the elixir-format
flag was used to detect automatically
extracted translations. This has been deprecated in v0.19.0
. When extracting
with the newest version, the new elixir-autogen
flag will be added to all
automatically extracted translations.
All translations will be assigned a format flag. When using the default
interpolation module, that flag is elixir-format
. With other interpolation
modules, the flag name is defined by that implementation.
If you would like to verify that your POT files are up to date with the
current state of the codebase, you can provide the --check-up-to-date
flag. This is particularly useful for automated checks and in CI systems.
This validation will fail even when the same calls to gettext
only change location in the codebase:
mix gettext.extract --check-up-to-date
It is possible to give the --merge
option to perform merging
for every Gettext backend updated during merge:
mix gettext.extract --merge
All other options passed to gettext.extract
are forwarded to the
gettext.merge
task (Mix.Tasks.Gettext.Merge
), which is called internally
by this task. For example:
mix gettext.extract --merge --no-fuzzy
Link to this section Summary
Functions
Callback implementation for Mix.Task.run/1
.
Link to this section Functions
Callback implementation for Mix.Task.run/1
.