Improve nags translation strings (#4693)

This commit is contained in:
Jerozgen
2025-11-06 13:37:37 +03:00
committed by GitHub
parent 7437a833ef
commit 7674433f88
7 changed files with 29 additions and 38 deletions

View File

@@ -1,4 +1,3 @@
import { formatProjectType } from '@modrinth/utils'
import { defineMessage, useVIntl } from '@vintl/vintl'
import type { Nag, NagContext } from '../../types/nags'
@@ -8,7 +7,7 @@ export const coreNags: Nag[] = [
id: 'moderator-feedback',
title: defineMessage({
id: 'nags.moderator-feedback.title',
defaultMessage: 'Review moderator feedback',
defaultMessage: 'Review feedback',
}),
description: defineMessage({
id: 'nags.moderator-feedback.description',
@@ -100,23 +99,15 @@ export const coreNags: Nag[] = [
}),
description: (context: NagContext) => {
const { formatMessage } = useVIntl()
const projectType = formatProjectType(context.project.project_type).toLowerCase()
let msg = ''
if (context.project.project_type === 'resourcepack') {
msg =
', except for audio or localization packs. If this describes your pack, please select the appropriate tag'
}
const resourcepackMessage = msg
return formatMessage(
defineMessage({
id: 'nags.upload-gallery-image.description',
defaultMessage:
'At least one gallery image is required to showcase the content of your {type}{resourcepackMessage}.',
'At least one gallery image is required to showcase the content of your {type, select, resourcepack {resource pack, except for audio or localization packs. If this describes your pack, please select the appropriate tag} shader {shader} other {project}}.',
}),
{
type: projectType,
resourcepackMessage: resourcepackMessage,
type: context.project.project_type,
},
)
},
@@ -232,10 +223,10 @@ export const coreNags: Nag[] = [
return formatMessage(
defineMessage({
id: 'nags.select-environments.description',
defaultMessage: `Select the environments your {projectType} functions on.`,
defaultMessage: `Select the environments your {type, select, mod {mod} modpack {modpack} other {project}} functions on.`,
}),
{
projectType: formatProjectType(context.project.project_type).toLowerCase(),
type: context.project.project_type,
},
)
},
@@ -272,10 +263,11 @@ export const coreNags: Nag[] = [
return formatMessage(
defineMessage({
id: 'nags.select-license.description',
defaultMessage: 'Select the license your {projectType} is distributed under.',
defaultMessage:
'Select the license your {type, select, mod {mod} modpack {modpack} resourcepack {resource pack} shader {shader} plugin {plugin} datapack {data pack} other {project}} is distributed under.',
}),
{
projectType: formatProjectType(context.project.project_type).toLowerCase(),
type: context.project.project_type,
},
)
},