From 99011ebcf2cd3c4096520394537bb97b5ea08865 Mon Sep 17 00:00:00 2001 From: Konv Suu <2583695112@qq.com> Date: Mon, 6 Jan 2025 14:13:20 +0800 Subject: [PATCH] feat: enhance table with new translations and tooltip for descriptions (#2471) --- .../(main)/(layer)/(subview)/rsshub/index.tsx | 15 +++++++++------ locales/settings/en.json | 2 ++ locales/settings/zh-CN.json | 2 ++ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/apps/renderer/src/pages/(main)/(layer)/(subview)/rsshub/index.tsx b/apps/renderer/src/pages/(main)/(layer)/(subview)/rsshub/index.tsx index 42fc7940b..03a0a129d 100644 --- a/apps/renderer/src/pages/(main)/(layer)/(subview)/rsshub/index.tsx +++ b/apps/renderer/src/pages/(main)/(layer)/(subview)/rsshub/index.tsx @@ -8,6 +8,7 @@ import { TableHeader, TableRow, } from "@follow/components/ui/table/index.jsx" +import { EllipsisTextWithTooltip } from "@follow/components/ui/typography/index.js" import type { RSSHubModel } from "@follow/models" import { useTranslation } from "react-i18next" @@ -68,7 +69,7 @@ function List({ data }: { data?: RSSHubModel[] }) { - + {t("rsshub.table.owner")} @@ -89,7 +90,7 @@ function List({ data }: { data?: RSSHubModel[] }) { - Official + {t("rsshub.table.official")} @@ -120,14 +121,14 @@ function List({ data }: { data?: RSSHubModel[] }) { {data?.map((instance) => { return ( - + {(() => { const flag: string[] = [] if (status?.data?.usage?.rsshubId === instance.id) { - flag.push("In use") + flag.push(t("rsshub.table.inuse")) } if (instance.ownerUserId === me?.id) { - flag.push("Yours") + flag.push(t("rsshub.table.yours")) } return flag.join(" / ") })()} @@ -140,7 +141,9 @@ function List({ data }: { data?: RSSHubModel[] }) { /> -
{instance.description}
+ + {instance.description} +
diff --git a/locales/settings/en.json b/locales/settings/en.json index a7e190090..c377b5d8a 100644 --- a/locales/settings/en.json +++ b/locales/settings/en.json @@ -300,12 +300,14 @@ "rsshub.table.description": "Description", "rsshub.table.edit": "Edit", "rsshub.table.inuse": "In Use", + "rsshub.table.official": "Official", "rsshub.table.owner": "Owner", "rsshub.table.price": "Monthly Price", "rsshub.table.unlimited": "Unlimited", "rsshub.table.use": "Use", "rsshub.table.userCount": "User Count", "rsshub.table.userLimit": "User Limit", + "rsshub.table.yours": "Yours", "rsshub.useModal.about": "About this Instance", "rsshub.useModal.month": "month", "rsshub.useModal.months_label": "The number of months you want to purchase", diff --git a/locales/settings/zh-CN.json b/locales/settings/zh-CN.json index 21126bd64..d05bc109c 100644 --- a/locales/settings/zh-CN.json +++ b/locales/settings/zh-CN.json @@ -300,12 +300,14 @@ "rsshub.table.description": "描述", "rsshub.table.edit": "编辑", "rsshub.table.inuse": "使用中", + "rsshub.table.official": "官方", "rsshub.table.owner": "所有者", "rsshub.table.price": "月度价格", "rsshub.table.unlimited": "无限制", "rsshub.table.use": "使用", "rsshub.table.userCount": "用户数量", "rsshub.table.userLimit": "用户限制", + "rsshub.table.yours": "你的", "rsshub.useModal.about": "关于此实例", "rsshub.useModal.month": "个月", "rsshub.useModal.months_label": "你想购买的月份数量",