Downloads inflection data files from the Localize CDN into the configured inflection data directory.
Inflection data is optional: nothing is downloaded unless this
task runs, and inflection functions return
{:error, %Localize.InflectionDataNotAvailableError{}} for a
locale whose data is absent. Run the task at build time (a
Dockerfile or CI pipeline), like mix localize.download_locales.
Usage
mix localize.download_inflectionDownloads the configured :supported_locales (intersected with
the languages the inflection data covers).
mix localize.download_inflection en fr de ruDownloads the specified locales.
mix localize.download_inflection --allDownloads every inflection-supported language.
mix localize.download_inflection --forceRe-downloads files that already exist in the data directory.
mix localize.download_inflection --pruneRemoves the directories of superseded data versions once the current version has downloaded.
Output directory
Files are written to Localize.Inflection.DataDir.dir/0; see
that module for the :otp_app / :inflection_data_dir
configuration forms.
That directory carries the data version, so each version holds its
own artifacts and a file of an earlier version is never read in
place of a current one. The directories of superseded versions
survive an upgrade; the task names them when it finds them, and
--prune removes them.
Every download is verified against the SHA-256 manifest shipped in the package before it is written.
Summary
Functions
Downloads inflection data for the inflection-supported languages
among locale_names.
Functions
Downloads inflection data for the inflection-supported languages
among locale_names.
Accepts locale identifiers in any form; regional locales map to
their parent language (en-AU → en) and locales the inflection
project does not support are skipped. Shared with
mix localize.download_locales, which downloads inflection data
alongside the locale data so one command provisions both.
Arguments
locale_namesis a list of locale identifiers.force?downloads files already present whentrue. The default isfalse.
Returns
- The number of failed downloads,
0when every download succeeded.
Examples
A locale the inflection project does not support is skipped, so nothing is downloaded:
iex> Mix.Tasks.Localize.DownloadInflection.download_for(["zz"])
0