Add i18n framework: per-account language, catalogs, t! macro, SET LANGUAGE
All checks were successful
CI / check (push) Successful in 5m16s

This commit is contained in:
Jean Chevronnet 2026-07-19 22:57:45 +00:00
parent 83851c794d
commit b462d37bd5
No known key found for this signature in database
16 changed files with 272 additions and 12 deletions

View file

@ -7,7 +7,10 @@ impl Engine {
let nick = self.network.nick_of(from).unwrap_or(from).to_string();
let account = self.network.account_of(from).map(str::to_string);
let privs = account.as_deref().map(|a| self.oper_privs(a)).unwrap_or_default();
let mut ctx = ServiceCtx::default();
// Render this command's replies in the sender's language: their account
// preference if set, otherwise the network default.
let lang = account.as_deref().and_then(|a| self.db.language_of(a)).unwrap_or_else(|| self.db.default_language());
let mut ctx = ServiceCtx { lang, ..Default::default() };
// Mark the log so we can tell exactly which events this command appends.
let audit_mark = self.db.log_len();
let sender = Sender { uid: from, nick: &nick, account: account.as_deref(), privs };