Lets the emails speak the instance's language from the same catalogs as
the interface. A template passes each message as a descriptor holding its
id and its English, as i18n._({ id: "email.reset.title", message: "Reset your password" }), or one of shared/digest-messages.ts, which a page
says too. lingui extract reads them into locales/<lang>.po beside the
interface's messages, and lingui compile turns the catalogs into the
locales/<lang>.mjs imported here, failing when a language lacks one. The
ids are named rather than hashed from the English, since the server runs
no Lingui macro.
v
i18n: I18n
Translates the emails' messages, in EMAIL_LOCALE. Every catalog is loaded, so a test can activate another language.
Usage
import * as mod from "api/mail/i18n.ts";