refactor: support i18n

This commit is contained in:
mlogclub
2026-05-25 12:06:15 +08:00
parent 309ac1fe9e
commit 988f55c80d
179 changed files with 10968 additions and 3763 deletions
+18
View File
@@ -0,0 +1,18 @@
const SEEDED_ROLE_LABELS: Record<string, string> = {
super_admin: "Super admin",
admin: "Admin",
cs_team_leader: "Support team lead",
cs_user: "Support agent",
}
export function getRoleDisplayName(
code: string | undefined,
fallbackName: string,
locale: string
) {
if (locale !== "en-US") {
return fallbackName
}
const label = SEEDED_ROLE_LABELS[code?.trim() ?? ""]
return label || fallbackName
}