Sort filters and add translations for servers (#5493)

* Translate and sort server filters

* Set team_members to unknown[]

* Additional fixes after merge

* Additional translations

* Replace "IP" with "server address"

* Prioritize English and user language
This commit is contained in:
Jerozgen
2026-03-17 22:56:01 +03:00
committed by GitHub
parent 900a4df1b7
commit 58c1e225c8
17 changed files with 666 additions and 244 deletions

View File

@@ -229,10 +229,6 @@ const messages = defineMessages({
id: 'create.project.create-project',
defaultMessage: 'Create project',
},
createServerProject: {
id: 'create.project.create-server-project',
defaultMessage: 'Create server',
},
visibilityPublic: {
id: 'create.project.visibility-public',
defaultMessage: 'Public',

View File

@@ -497,9 +497,6 @@
"create.project.create-project": {
"message": "Create project"
},
"create.project.create-server-project": {
"message": "Create server"
},
"create.project.missing-fields-tooltip": {
"message": "Missing fields: {fields}"
},

View File

@@ -169,12 +169,15 @@ import {
SERVER_REGIONS,
StyledInput,
UnsavedChangesPopup,
useVIntl,
} from '@modrinth/ui'
import CompatibilityCard from '~/components/ui/project-settings/CompatibilityCard.vue'
const PING_TIMEOUT_MS = 5000
const { formatMessage, locale } = useVIntl()
const client = injectModrinthClient()
const { addNotification } = injectNotificationManager()
const { projectV3, currentMember, patchProjectV3 } = injectProjectPageContext()
@@ -262,15 +265,31 @@ if (projectV3.value) {
)
}
const regionOptions = SERVER_REGIONS.map((region) => ({
value: region.code,
label: region.name,
}))
const regionOptions = computed(() =>
Object.entries(SERVER_REGIONS)
.sort(([_, a], [__, b]) => {
const aFormatted = formatMessage(a)
const bFormatted = formatMessage(b)
return aFormatted.localeCompare(bFormatted, locale.value)
})
.map(([code, name]) => ({
value: code,
label: formatMessage(name),
})),
)
const languageOptions = SERVER_LANGUAGES.map((language) => ({
value: language.code,
label: language.name,
}))
const languageOptions = computed(() =>
Object.entries(SERVER_LANGUAGES)
.sort(([_, a], [__, b]) => {
const aFormatted = formatMessage(a)
const bFormatted = formatMessage(b)
return aFormatted.localeCompare(bFormatted, locale.value)
})
.map(([code, name]) => ({
value: code,
label: formatMessage(name),
})),
)
const javaServerPatchData = computed(() => {
const addressChanged =