rebar3 erli18n compile — opt-in compile-time .po->BEAM catalog codegen.
For every (Domain, Locale) catalog under the catalog root this provider
reads the .po, parses its entries and compiles its Plural-Forms rule
AHEAD of time, then emits a tiny generated carrier module
(erli18n_cc_<Domain>__<Locale>.erl) whose catalog/0 returns the
ALREADY-parsed entries plus the ALREADY-compiled plural rule baked into the
BEAM literal pool (see rebar3_erli18n_codegen). A consumer registers them
at boot through erli18n:register_compiled_catalogs/1 with NO runtime .po
parse and NO plural compile.
The whole surface is OPT-IN: with no {compiled_catalogs, true} in
rebar.config the provider is a loud-logged no-op and writes nothing, so a
project that uses no compiled catalogs sees zero change. Reading the runtime
ensure_loaded/3 path stays the default.
Configuration (read from rebar.config)
The entire surface is read via rebar3_erli18n_host:get_config/3 under the
erli18n key:
compiled_catalogs— master gate;false/absent makes the provider a loud-logged no-op.key_check—off | warn | strict; an unknown atom normalises towarn(logged once). Folds in the compiled-catalog key-existence check after codegen.compiled_domains—all(default: every extracted domain that has a catalog) or an explicit[atom()]list; scopes BOTH the codegen and the key check.gen_dir— output directory for the generated carriers (default"src/erli18n_gen", resolved relative to the root app).include_fuzzy— include#, fuzzyentries (defaultfalse), passed toerli18n_po:parse/2and baked intoheader.fuzzy_included.gen_eqwalizer_nowarn— emit the function-scoped eqwalizer nowarn on each carrier'scatalog/0(defaulttrue), passed as render options.max_po_bytes— reject a.polarger than this many bytes BEFORE reading it (default: the runtime library'serli18n_server:default_max_bytes/0, 16 MiB);infinitydisables the size cap.max_entries— reject a parsed catalog with more than this many entries (default: the runtime library'serli18n_server:default_max_entries/0, 500000);infinitydisables the entry cap. Both caps mirror the runtime loader so a compiled carrier can never carry more thanensure_loaded/3would accept; a violation is a loud build error.
Command-line options
--strict (treat missing keys as a build failure), --no-key-check (skip
the key check entirely), --check (dry run: generate nothing, only validate)
plus the shared --domain and --pot-dir. Policy precedence:
--no-key-check > --strict/--check > the {key_check} config > the
default warn.
Summary
Functions
Run the compile provider.
Render a provider error to a human-readable string.
Register the compile provider under the erli18n namespace.
Functions
-spec do(rebar3_erli18n_host:state()) -> {ok, rebar3_erli18n_host:state()} | {error, string()}.
Run the compile provider.
A loud-logged no-op (writing nothing) unless {compiled_catalogs, true} is in
rebar.config. Otherwise generates one carrier per (Domain, Locale) and runs
the folded key check.
Render a provider error to a human-readable string.
-spec init(rebar3_erli18n_host:state()) -> {ok, rebar3_erli18n_host:state()}.
Register the compile provider under the erli18n namespace.