feat(desktop): unify with trending component (#3767)
* feat(desktop): unify with trending component * resolve conflict * update
This commit is contained in:
@@ -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",
|
||||
},
|
||||
]
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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": "订阅源",
|
||||
|
||||
Reference in New Issue
Block a user