mirror of
https://github.com/gotson/komga.git
synced 2026-05-08 12:35:30 +02:00
i18n user roles
This commit is contained in:
parent
90d9c27982
commit
baf547d5a7
2 changed files with 38 additions and 2 deletions
|
|
@ -49,7 +49,7 @@
|
|||
v-for="role in value"
|
||||
:key="role"
|
||||
:color="getRoleColor(role)"
|
||||
:text="role"
|
||||
:text="$formatMessage(userRolesMessages[role as UserRoles])"
|
||||
size="x-small"
|
||||
rounded
|
||||
/>
|
||||
|
|
@ -105,7 +105,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { komgaClient } from '@/api/komga-client'
|
||||
import type { components } from '@/generated/openapi/komga'
|
||||
import { UserRoles } from '@/types/UserRoles'
|
||||
import { UserRoles, userRolesMessages } from '@/types/UserRoles'
|
||||
import { defineMessage, useIntl } from 'vue-intl'
|
||||
|
||||
import { useCurrentUser } from '@/colada/users'
|
||||
|
|
|
|||
|
|
@ -1,7 +1,43 @@
|
|||
import { defineMessages } from 'vue-intl'
|
||||
|
||||
export enum UserRoles {
|
||||
ADMIN = 'ADMIN',
|
||||
FILE_DOWNLOAD = 'FILE_DOWNLOAD',
|
||||
PAGE_STREAMING = 'PAGE_STREAMING',
|
||||
KOBO_SYNC = 'KOBO_SYNC',
|
||||
KOREADER_SYNC = 'KOREADER_SYNC',
|
||||
USER = 'USER',
|
||||
}
|
||||
|
||||
export const userRolesMessages = defineMessages({
|
||||
[UserRoles.ADMIN]: {
|
||||
description: 'User role: admin',
|
||||
defaultMessage: 'Administrator',
|
||||
id: '8N1oqm',
|
||||
},
|
||||
[UserRoles.FILE_DOWNLOAD]: {
|
||||
description: 'User role: file_download',
|
||||
defaultMessage: 'File download',
|
||||
id: 'c00+tT',
|
||||
},
|
||||
[UserRoles.PAGE_STREAMING]: {
|
||||
description: 'User role: page_streaming',
|
||||
defaultMessage: 'Page streaming',
|
||||
id: 'aa6dBv',
|
||||
},
|
||||
[UserRoles.KOBO_SYNC]: {
|
||||
description: 'User role: kobo_sync',
|
||||
defaultMessage: 'Kobo sync',
|
||||
id: 'Jm5RAA',
|
||||
},
|
||||
[UserRoles.KOREADER_SYNC]: {
|
||||
description: 'User role: koreader_sync',
|
||||
defaultMessage: 'KOReader sync',
|
||||
id: 'BwX4xr',
|
||||
},
|
||||
[UserRoles.USER]: {
|
||||
description: 'User role: user',
|
||||
defaultMessage: 'User',
|
||||
id: '2+oQ1g',
|
||||
},
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue