feat(groups): configure message language per group instead of per route

Route.lang is removed; Group.lang now drives the message language for
every route in the group (default en, custom via KV i18n:<lang>).
dispatch.ts loads translations per group and falls back to en for
groups without a lang. Admin UI: GroupEditor gains the language field,
RouteEditor/RouteCard drop theirs; docs and config example updated.
This commit is contained in:
RhenCloud committed 2026-08-12 00:43:47 +08:00
1 parent c73b642504
commit 7e45b0a09c
12 files changed
+114 -40

No files matched your search

+3 -3
View File
@@ -87,9 +87,6 @@ function validateRoutes(
}
if (typeof r.enabled !== "boolean")
return { ok: false, error: `route "${r.id}".enabled must be boolean` };
if (r.lang !== undefined && typeof r.lang !== "string") {
return { ok: false, error: `route "${r.id}".lang must be a string` };
}
if (r.fallback !== undefined && typeof r.fallback !== "boolean") {
return { ok: false, error: `route "${r.id}".fallback must be a boolean` };
}
@@ -283,6 +280,9 @@ function validateGroups(
if (g.emoji !== undefined && typeof g.emoji !== "boolean") {
return { ok: false, error: `group "${g.id}".emoji must be a boolean` };
}
if (g.lang !== undefined && typeof g.lang !== "string") {
return { ok: false, error: `group "${g.id}".lang must be a string` };
}
}
return { ok: true, groups: groups as Group[] };
}