feat(desktop): unify with trending component (#3767)

* feat(desktop): unify with trending component

* resolve conflict

* update
This commit is contained in:
Konv Suu
2025-05-21 20:28:00 +08:00
committed by GitHub
parent f1f163e543
commit 04cc13bef7
4 changed files with 14 additions and 8 deletions
@@ -8,23 +8,24 @@ import { setUISetting, useUISettingKey } from "~/atoms/settings/ui"
const LanguageOptions = [
{
label: "All",
label: "words.all",
value: "all",
},
{
label: "English",
label: "words.english",
value: "eng",
},
{
label: "中文",
label: "words.chinese",
value: "cmn",
},
] as const
]
type Language = (typeof LanguageOptions)[number]["value"]
type Language = "all" | "eng" | "cmn"
export function Recommendations() {
const { t } = useTranslation()
const { t: tCommon } = useTranslation("common")
const lang = useUISettingKey("discoverLanguage")
@@ -47,7 +48,8 @@ export function Recommendations() {
onValueChange={handleLangChange}
triggerClassName="h-8 rounded border-0"
size="sm"
items={LanguageOptions as any}
items={LanguageOptions}
renderItem={(item) => <>{tCommon(item.label as any)}</>}
/>
</div>
</div>
@@ -17,11 +17,11 @@ const LanguageOptions = [
value: "all",
},
{
label: "English",
label: "words.english",
value: "eng",
},
{
label: "中文",
label: "words.chinese",
value: "cmn",
},
]
+2
View File
@@ -43,6 +43,7 @@
"words.all": "All",
"words.back": "Back",
"words.cancel": "Cancel",
"words.chinese": "Chinese",
"words.close": "Close",
"words.confirm": "Confirm",
"words.copy": "Copy",
@@ -52,6 +53,7 @@
"words.documentation": "Documentation",
"words.download": "Download",
"words.edit": "Edit",
"words.english": "English",
"words.entry": "Entry",
"words.expand": "Expand",
"words.feeds": "Feeds",
+2
View File
@@ -43,6 +43,7 @@
"words.all": "全部",
"words.back": "返回",
"words.cancel": "取消",
"words.chinese": "中文",
"words.close": "关闭",
"words.confirm": "确认",
"words.copy": "复制",
@@ -52,6 +53,7 @@
"words.documentation": "文档",
"words.download": "下载",
"words.edit": "编辑",
"words.english": "英语",
"words.entry": "条目",
"words.expand": "展开",
"words.feeds": "订阅源",