orgRoleLabel function
- AppLocalizations l10n,
- String role
Localized display names for the org_members.role enum.
The role values themselves (owner/admin/manager/member) are database
enums and stay untranslated on the wire — only their presentation is
localized. Unknown roles fall back to the raw value so a future role added
server-side still renders something sensible instead of blank.
Screens that show a role in all-caps (member rows, the member-detail chip,
team rosters) call .toUpperCase() on the result rather than storing a
second set of upper-case keys.
Implementation
String orgRoleLabel(AppLocalizations l10n, String role) => switch (role) {
'owner' => l10n.orgRoleOwner,
'admin' => l10n.orgRoleAdmin,
'manager' => l10n.orgRoleManager,
'member' => l10n.orgRoleMember,
_ => role,
};