feat: update plugin category labels and improve internationalization support

This commit is contained in:
twwu
2024-11-13 18:30:38 +08:00
parent 6298332950
commit 61eb655823
25 changed files with 20 additions and 101 deletions

View File

@ -11,6 +11,7 @@ import Placeholder from './base/placeholder'
import cn from '@/utils/classnames'
import { useGetLanguage } from '@/context/i18n'
import { getLanguage } from '@/i18n/language'
import { useCategories } from '../hooks'
export type Props = {
className?: string
@ -41,6 +42,7 @@ const Card = ({
}: Props) => {
const defaultLocale = useGetLanguage()
const locale = localeFromProps ? getLanguage(localeFromProps) : defaultLocale
const { categoriesMap } = useCategories()
const { type, name, org, label, brief, icon, verified } = payload
@ -59,7 +61,7 @@ const Card = ({
return (
<div className={wrapClassName}>
{!hideCornerMark && <CornerMark text={type} />}
{!hideCornerMark && <CornerMark text={categoriesMap[type].label} />}
{/* Header */}
<div className="flex">
<Icon src={icon} installed={installed} installFailed={installFailed} />