From 5afd44ecaeec2d848c56774cf26ad869a3446315 Mon Sep 17 00:00:00 2001 From: "tangly1024.com" Date: Wed, 24 Jul 2024 10:42:13 +0800 Subject: [PATCH] fix medium lang --- themes/medium/components/CategoryGroup.js | 35 +++++++++++++++++------ themes/medium/components/TagGroups.js | 17 ++++++----- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/themes/medium/components/CategoryGroup.js b/themes/medium/components/CategoryGroup.js index d562cd1f9d4..3fd6b67d716 100644 --- a/themes/medium/components/CategoryGroup.js +++ b/themes/medium/components/CategoryGroup.js @@ -1,18 +1,37 @@ +import { useGlobal } from '@/lib/global' import CategoryItem from './CategoryItem' +/** + * 分类 + * @param {*} param0 + * @returns + */ const CategoryGroup = ({ currentCategory, categoryOptions }) => { + const { locale } = useGlobal() if (!categoryOptions) { return <> } - return
-
分类
-
- {categoryOptions?.map(category => { - const selected = currentCategory === category.name - return - })} + return ( +
+
+ + {locale.COMMON.CATEGORY} +
+
+ {categoryOptions?.map(category => { + const selected = currentCategory === category.name + return ( + + ) + })} +
-
+ ) } export default CategoryGroup diff --git a/themes/medium/components/TagGroups.js b/themes/medium/components/TagGroups.js index 390a6306f3a..dc0895f88a9 100644 --- a/themes/medium/components/TagGroups.js +++ b/themes/medium/components/TagGroups.js @@ -1,3 +1,4 @@ +import { useGlobal } from '@/lib/global' import TagItemMini from './TagItemMini' /** @@ -8,17 +9,19 @@ import TagItemMini from './TagItemMini' * @constructor */ const TagGroups = ({ tagOptions, currentTag }) => { + const { locale } = useGlobal() if (!tagOptions) return <> return (
-
标签
+
+ + {locale.COMMON.TAGS} +
- { - tagOptions?.map(tag => { - const selected = tag.name === currentTag - return - }) - } + {tagOptions?.map(tag => { + const selected = tag.name === currentTag + return + })}
)