v4: every message named by an id carries its English in the code — the emails and the four pages that share their words called Lingui with a bare id (i18n._("digest.community"), <Trans id="digest.community" />), so their English lived only in a hand-kept en.po, extract couldn't run with --overwrite, and a page reading the code couldn't tell what it said. The emails now pass descriptors, i18n._({ id, message, values }), the form Lingui reads without a macro, as the server needs. The fifteen messages the digest shares with the community page, Settings, the unsubscribe page and the avatar menu are declared once, as /*i18n*/ descriptors in shared/digest-messages.ts, which those pages translate with useLingui()'s i18n instead of the global one. lingui.config.ts scans shared/ too, and i18n:extract runs with --overwrite, so en.po is written from the code. Every other message already used the macros. The compiled catalogs are unchanged, key for key, in both languages. 272 backend tests and 677 frontend tests pass, and deno check, tsc, eslint, doc:lint and i18n:compile --strict are clean.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,12 +7,12 @@ const config: LinguiConfig = {
|
||||
sourceLocale: SOURCE_LOCALE,
|
||||
catalogs: [
|
||||
{
|
||||
// One catalog per language for the whole app: the interface's messages
|
||||
// and the emails' (api/mail/), which the server imports compiled. A
|
||||
// message named by id has its English in en.po only, which is why
|
||||
// extract runs without --overwrite (it would write the id there).
|
||||
// One catalog per language for the whole app: the interface's messages,
|
||||
// the emails' (api/mail/), which the server imports compiled, and those
|
||||
// both say (shared/digest-messages.ts). Every message's English is in
|
||||
// the code, so extract --overwrite writes en.po from it.
|
||||
path: "locales/{locale}",
|
||||
include: ["src", "api/mail"],
|
||||
include: ["src", "api/mail", "shared"],
|
||||
},
|
||||
],
|
||||
format: formatter(),
|
||||
|
||||
Reference in New Issue
Block a user