One translation file: <path>/<domain>/<slug>-<hash>.json holding the
source text ("msgid") and one key per locale.
The file name is derived from the source text, so finding a message never requires an index and two branches adding different messages never touch the same file.
Summary
Functions
Placeholder names (%{name}) used in text.
Atomically creates path with content unless it exists. Returns true if
written. Parallel compilers never see a partially written file.
Encodes a message deterministically: msgid first, then locales sorted.
File name for msgid: readable slug plus a content hash of identity.
Path of the JSON file for msgid.
Reads a message file.
Plural source forms in CLDR order, as path/4 expects for tn/2 messages.
Merges translations into the file for msgid, creating it if missing.
Raises if the existing file is invalid or belongs to another msgid.
Functions
Placeholder names (%{name}) used in text.
Atomically creates path with content unless it exists. Returns true if
written. Parallel compilers never see a partially written file.
Encodes a message deterministically: msgid first, then locales sorted.
File name for msgid: readable slug plus a content hash of identity.
Path of the JSON file for msgid.
Options
:context- Gettext-style message context (msgctxt):plural-truefor~t"..."N, or the source forms map oftn/2
Reads a message file.
Plural source forms in CLDR order, as path/4 expects for tn/2 messages.
Merges translations into the file for msgid, creating it if missing.
Raises if the existing file is invalid or belongs to another msgid.
origin (e.g. %{"by" => "machine", "model" => "claude-opus-5-5"}, or nil
for human-written) is recorded for every locale in translations.