From 08c86ab70ac5e00563e7dbe1b79ab16be4ca5de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=87=91=E4=BC=9F=E5=BC=BA?= Date: Fri, 19 May 2023 19:33:27 +0800 Subject: [PATCH] chore: category i18n --- web/app/components/explore/category.tsx | 5 ++++- web/i18n/lang/explore.en.ts | 6 ++++++ web/i18n/lang/explore.zh.ts | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/web/app/components/explore/category.tsx b/web/app/components/explore/category.tsx index e291f3b772..3c77b2aa2c 100644 --- a/web/app/components/explore/category.tsx +++ b/web/app/components/explore/category.tsx @@ -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 = ({ style={itemStyle(name === value)} onClick={() => onChange(name)} > - {name} + {(categoryI18n as any)[name] ? t(`explore.category.${name}`) : name} ))} diff --git a/web/i18n/lang/explore.en.ts b/web/i18n/lang/explore.en.ts index b981a79fd2..43c4876f8b 100644 --- a/web/i18n/lang/explore.en.ts +++ b/web/i18n/lang/explore.en.ts @@ -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 diff --git a/web/i18n/lang/explore.zh.ts b/web/i18n/lang/explore.zh.ts index 3152b7730d..401f1e5f3f 100644 --- a/web/i18n/lang/explore.zh.ts +++ b/web/i18n/lang/explore.zh.ts @@ -26,6 +26,12 @@ const translation = { subTitle: '应用程序图标和名称', nameRequired: '应用程序名称不能为空', }, + category: { + 'News': '新闻', + 'Music': '音乐', + 'Games': '游戏', + 'Sports': '体育', + } } export default translation