chore: category i18n

This commit is contained in:
金伟强 2023-05-19 19:33:27 +08:00
parent 41a069f86b
commit 08c86ab70a
3 changed files with 16 additions and 1 deletions

View File

@ -1,8 +1,11 @@
'use client'
import React, { FC } from 'react'
import { useTranslation } from 'react-i18next'
import exploreI18n from '@/i18n/lang/explore.en'
import cn from 'classnames'
const categoryI18n = exploreI18n.category
export interface ICategoryProps {
className?: string
list: string[]
@ -36,7 +39,7 @@ const Category: FC<ICategoryProps> = ({
style={itemStyle(name === value)}
onClick={() => onChange(name)}
>
{name}
{(categoryI18n as any)[name] ? t(`explore.category.${name}`) : name}
</div>
))}
</div>

View File

@ -26,6 +26,12 @@ const translation = {
subTitle: 'App icon & name',
nameRequired: 'App name is required',
},
category: {
'News': 'News',
'Music': 'Music',
'Games': 'Games',
'Sports': 'Sports',
}
}
export default translation

View File

@ -26,6 +26,12 @@ const translation = {
subTitle: '应用程序图标和名称',
nameRequired: '应用程序名称不能为空',
},
category: {
'News': '新闻',
'Music': '音乐',
'Games': '游戏',
'Sports': '体育',
}
}
export default translation