translatable category headers (#5301)

This commit is contained in:
Prospector
2026-02-04 14:47:35 -08:00
committed by GitHub
parent 3f5e3b1d8b
commit ddb013e024
7 changed files with 58 additions and 14 deletions

View File

@@ -1,11 +1,11 @@
import type { Labrinth } from '@modrinth/api-client'
import { ClientIcon, getCategoryIcon, getLoaderIcon, ServerIcon } from '@modrinth/assets'
import { formatCategoryHeader, sortByNameOrNumber } from '@modrinth/utils'
import { sortByNameOrNumber } from '@modrinth/utils'
import { type Component, computed, readonly, type Ref, ref } from 'vue'
import { type LocationQueryRaw, type LocationQueryValue, useRoute } from 'vue-router'
import { defineMessage, useVIntl } from '../composables/i18n'
import { formatCategory, formatLoader } from './tag-messages.ts'
import { formatCategory, formatCategoryHeader, formatLoader } from './tag-messages.ts'
type BaseOption = {
id: string
@@ -132,7 +132,7 @@ export function useSearch(
if (!categoryFilters[filterTypeId]) {
categoryFilters[filterTypeId] = {
id: filterTypeId,
formatted_name: formatCategoryHeader(category.header),
formatted_name: formatCategoryHeader(formatMessage, category.header),
supported_project_types:
category.project_type === 'mod'
? ['mod', 'plugin', 'datapack']