Moderation: server languages and description stage tweaks (#5515)

* Description button tweaks

* server languages

* pretty
This commit is contained in:
coolbot
2026-03-10 15:08:15 -07:00
committed by GitHub
parent 2b8175ad66
commit 8b04303eca
4 changed files with 64 additions and 44 deletions

View File

@@ -0,0 +1,5 @@
## Supported Languages
Currently, you've selected %PROJECT_LANGUAGE_COUNT% [Languages](%PROJECT_LANGUAGE_SETTINGS%), per section 5.1 of %RULES% we ask that you confirm all selected languages are accurate.
Selected languages should represent what players can expect to see on your server, and all players should be able to get the full experience out of your server even if they only understand one of the selected languages.

View File

@@ -10,11 +10,46 @@ const description: Stage = {
guidance_url: 'https://modrinth.com/legal/rules#general-expectations',
navigate: '/',
actions: [
{
id: 'description_insufficient_packs',
type: 'button',
label: 'Insufficient',
weight: 400,
suggestedStatus: 'flagged',
severity: 'medium',
shouldShow: (project, projectV3) =>
project.project_type === 'modpack' && !projectV3?.minecraft_server,
message: async () =>
(await import('../messages/description/insufficient/insufficient-packs.md?raw')).default,
} as ButtonAction,
{
id: 'description_insufficient_projects',
type: 'button',
label: 'Insufficient',
weight: 400,
suggestedStatus: 'flagged',
severity: 'medium',
shouldShow: (project, projectV3) =>
project.project_type !== 'modpack' && !projectV3?.minecraft_server,
message: async () =>
(await import('../messages/description/insufficient/insufficient-projects.md?raw')).default,
} as ButtonAction,
{
id: 'description_insufficient_servers',
type: 'button',
label: 'Insufficient',
weight: 400,
suggestedStatus: 'flagged',
severity: 'medium',
shouldShow: (project, projectV3) => !!projectV3?.minecraft_java_server,
message: async () =>
(await import('../messages/description/insufficient/insufficient-servers.md?raw')).default,
} as ButtonAction,
{
id: 'description_insufficient',
type: 'button',
label: 'Insufficient (custom)',
weight: 400,
weight: 401,
suggestedStatus: 'flagged',
severity: 'medium',
message: async () =>
@@ -27,49 +62,6 @@ const description: Stage = {
required: true,
},
],
disablesActions: [
'description_insufficient_packs',
'description_insufficient_projects',
'description_insufficient_servers',
],
} as ButtonAction,
{
id: 'description_insufficient_packs',
type: 'button',
label: 'Insufficient',
weight: 401,
suggestedStatus: 'flagged',
severity: 'medium',
shouldShow: (project, projectV3) =>
project.project_type === 'modpack' && !projectV3?.minecraft_server,
message: async () =>
(await import('../messages/description/insufficient/insufficient-packs.md?raw')).default,
disablesActions: ['description_insufficient'],
} as ButtonAction,
{
id: 'description_insufficient_projects',
type: 'button',
label: 'Insufficient',
weight: 401,
suggestedStatus: 'flagged',
severity: 'medium',
shouldShow: (project, projectV3) =>
project.project_type !== 'modpack' && !projectV3?.minecraft_server,
message: async () =>
(await import('../messages/description/insufficient/insufficient-projects.md?raw')).default,
disablesActions: ['description_insufficient'],
} as ButtonAction,
{
id: 'description_insufficient_servers',
type: 'button',
label: 'Insufficient',
weight: 401,
suggestedStatus: 'flagged',
severity: 'medium',
shouldShow: (project, projectV3) => !!projectV3?.minecraft_java_server,
message: async () =>
(await import('../messages/description/insufficient/insufficient-servers.md?raw')).default,
disablesActions: ['description_insufficient'],
} as ButtonAction,
{
id: 'description_non_english',

View File

@@ -35,8 +35,28 @@ const ruleFollowing: Stage = {
weight: 0,
suggestedStatus: 'rejected',
severity: 'critical',
shouldShow(project, projectV3) {
return !!projectV3?.minecraft_server
},
message: async () => (await import('../messages/paid-access-server.md?raw')).default,
},
{
id: 'excessive_languages',
type: 'button',
label: 'Excessive languages',
weight: 0,
suggestedStatus: 'flagged',
severity: 'low',
shouldShow(project, projectV3) {
return (
!!projectV3?.minecraft_server &&
!!projectV3?.minecraft_server?.languages?.length &&
projectV3?.minecraft_server?.languages?.length > 4
)
},
message: async () =>
(await import('../messages/misc-metadata/excessive_languages-server.md?raw')).default,
},
],
}

View File

@@ -412,5 +412,8 @@ export function flattenProjectV3Variables(
vars['PROJECT_SITE_URL'] = projectV3.link_urls?.site?.url || 'None'
vars['PROJECT_STORE_URL'] = projectV3.link_urls?.store?.url || 'None'
vars['PROJECT_LANGUAGES'] = projectV3.minecraft_server?.languages?.toString() || 'None'
vars['PROJECT_LANGUAGE_COUNT'] = (projectV3.minecraft_server?.languages?.length || 0).toString()
return vars
}