mirror of
https://github.com/modrinth/code.git
synced 2026-08-31 03:55:59 +00:00
add placeholder missing disclosure report type
This commit is contained in:
@@ -3848,6 +3848,24 @@
|
||||
"report.item-type.version": {
|
||||
"defaultMessage": "version"
|
||||
},
|
||||
"report.type.copyright": {
|
||||
"defaultMessage": "Reuploaded work"
|
||||
},
|
||||
"report.type.inappropriate": {
|
||||
"defaultMessage": "Inappropriate"
|
||||
},
|
||||
"report.type.malicious": {
|
||||
"defaultMessage": "Malicious"
|
||||
},
|
||||
"report.type.missing-disclosure": {
|
||||
"defaultMessage": "Missing or incorrect disclosure"
|
||||
},
|
||||
"report.type.name-squatting": {
|
||||
"defaultMessage": "Name squatting"
|
||||
},
|
||||
"report.type.spam": {
|
||||
"defaultMessage": "Spam"
|
||||
},
|
||||
"s.bg": {
|
||||
"defaultMessage": "Background task running"
|
||||
},
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { Labrinth } from '@modrinth/api-client'
|
||||
import { capitalizeString } from '@modrinth/utils'
|
||||
|
||||
import { defineMessage, defineMessages, type MessageDescriptor } from '../composables/i18n'
|
||||
|
||||
@@ -1015,6 +1016,43 @@ export function formatReportItemType(
|
||||
return formatMessage(reportItemTypeMessages[key])
|
||||
}
|
||||
|
||||
export const reportTypeMessages = defineMessages({
|
||||
spam: {
|
||||
id: 'report.type.spam',
|
||||
defaultMessage: 'Spam',
|
||||
},
|
||||
copyright: {
|
||||
id: 'report.type.copyright',
|
||||
defaultMessage: 'Reuploaded work',
|
||||
},
|
||||
inappropriate: {
|
||||
id: 'report.type.inappropriate',
|
||||
defaultMessage: 'Inappropriate',
|
||||
},
|
||||
malicious: {
|
||||
id: 'report.type.malicious',
|
||||
defaultMessage: 'Malicious',
|
||||
},
|
||||
'name-squatting': {
|
||||
id: 'report.type.name-squatting',
|
||||
defaultMessage: 'Name squatting',
|
||||
},
|
||||
'missing-disclosure': {
|
||||
id: 'report.type.missing-disclosure',
|
||||
defaultMessage: 'Missing or incorrect disclosure',
|
||||
},
|
||||
})
|
||||
|
||||
export function formatReportType(formatMessage: FormatMessage, type: string | undefined): string {
|
||||
if (!type) return ''
|
||||
|
||||
if (type in reportTypeMessages) {
|
||||
return formatMessage(reportTypeMessages[type as keyof typeof reportTypeMessages])
|
||||
}
|
||||
|
||||
return capitalizeString(type.replace('-', ' '))
|
||||
}
|
||||
|
||||
export const fileItemTypeMessages = defineMessages({
|
||||
file: {
|
||||
id: 'files.item-type.file',
|
||||
|
||||
Reference in New Issue
Block a user