refactor: move author-facing mail copy into a Fluent catalogue

Ports carrier's src/i18n.rs and its locales/en-US/main.ftl layout, same
fluent-bundle and unic-langid versions, so the two catalogues stay portable
between them. Only mail the daemon sends an author moves; operator CLI output
stays inline, since the operator runs the binary and reads English.

The error-reply reasons from dispatch and ApplyError are deliberately left
behind: dispatch is pure by contract, so those become reason identifiers
resolved at the mail-building edge in a separate change rather than having the
pure layer reach for a bundle.

Adds a test carrier lacks. FluentResource::try_new and add_resource both panic
on a malformed or duplicate-id catalogue, and nothing touches the bundle until
the daemon first mails someone, so without it a bad catalogue surfaces inside
poll() on a live instance.

Sentences are verbatim; the bodies are now hard-wrapped where they were single
long lines, which reads better in a plain-text client.
This commit is contained in:
randogoth 2026-10-14 18:48:31 +03:00
parent f2d2d75063
commit 3279fd3a2d
6 changed files with 321 additions and 17 deletions

View file

@ -10,3 +10,7 @@ smolboid-core = { path = "../core" }
fumi-core = { path = "../../fumi/core" }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
# Author-facing mail copy lives in a Fluent catalogue; see src/i18n.rs. Same
# versions carrier pins, so the two catalogues stay portable between them.
fluent-bundle = "0.16.0"
unic-langid = "0.9.6"