Migrate interpolated service messages to the t! macro (8 modules)

This commit is contained in:
Jean Chevronnet 2026-07-19 23:22:56 +00:00
parent b462d37bd5
commit d207c3d60d
No known key found for this signature in database
133 changed files with 782 additions and 702 deletions

View file

@ -1,4 +1,4 @@
use echo_api::{Sender, ServiceCtx, Store};
use echo_api::{t, Sender, ServiceCtx, Store};
// INFO <!group>: show a group's founder and member count.
pub fn handle(me: &str, from: &Sender, name: Option<&str>, ctx: &mut ServiceCtx, db: &mut dyn Store) {
@ -7,10 +7,10 @@ pub fn handle(me: &str, from: &Sender, name: Option<&str>, ctx: &mut ServiceCtx,
return;
};
let Some(g) = db.group(name) else {
ctx.notice(me, from.uid, format!("\x02{name}\x02 isn't registered."));
ctx.notice(me, from.uid, t!(ctx, "\x02{name}\x02 isn't registered.", name = name));
return;
};
ctx.notice(me, from.uid, format!("Information for \x02{}\x02:", g.name));
ctx.notice(me, from.uid, format!(" Founder : \x02{}\x02", g.founder));
ctx.notice(me, from.uid, format!(" Members : {}", g.members.len()));
ctx.notice(me, from.uid, t!(ctx, "Information for \x02{name}\x02:", name = g.name));
ctx.notice(me, from.uid, t!(ctx, " Founder : \x02{founder}\x02", founder = g.founder));
ctx.notice(me, from.uid, t!(ctx, " Members : {count}", count = g.members.len()));
}