feat: Rename to Toju and add translation
Some checks failed
Build Android APK / build-android-apk (push) Has been cancelled
Deploy Web Apps / deploy (push) Has been cancelled
Queue Release Build / prepare (push) Has been cancelled
Queue Release Build / build-linux (push) Has been cancelled
Queue Release Build / build-windows (push) Has been cancelled
Queue Release Build / finalize (push) Has been cancelled
Some checks failed
Build Android APK / build-android-apk (push) Has been cancelled
Deploy Web Apps / deploy (push) Has been cancelled
Queue Release Build / prepare (push) Has been cancelled
Queue Release Build / build-linux (push) Has been cancelled
Queue Release Build / build-windows (push) Has been cancelled
Queue Release Build / finalize (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
const SYSTEM_ROLE_DISPLAY_I18N_KEYS: Readonly<Record<string, string>> = {
|
||||
Member: 'shared.leaveServer.roles.member',
|
||||
Owner: 'shared.leaveServer.roles.owner',
|
||||
'@everyone': 'shared.accessControl.roles.everyone',
|
||||
Moderator: 'shared.leaveServer.roles.moderator',
|
||||
Admin: 'shared.leaveServer.roles.admin'
|
||||
};
|
||||
|
||||
export function resolveSystemRoleDisplayI18nKey(displayName: string): string | null {
|
||||
return SYSTEM_ROLE_DISPLAY_I18N_KEYS[displayName] ?? null;
|
||||
}
|
||||
|
||||
export function localizeSystemRoleDisplayName(
|
||||
displayName: string,
|
||||
translate: (key: string) => string
|
||||
): string {
|
||||
const key = resolveSystemRoleDisplayI18nKey(displayName);
|
||||
|
||||
return key ? translate(key) : displayName;
|
||||
}
|
||||
Reference in New Issue
Block a user