Skip to content

Commit 99011eb

Browse files
authored
feat: enhance table with new translations and tooltip for descriptions (#2471)
1 parent b4edc42 commit 99011eb

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

apps/renderer/src/pages/(main)/(layer)/(subview)/rsshub/index.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
TableHeader,
99
TableRow,
1010
} from "@follow/components/ui/table/index.jsx"
11+
import { EllipsisTextWithTooltip } from "@follow/components/ui/typography/index.js"
1112
import type { RSSHubModel } from "@follow/models"
1213
import { useTranslation } from "react-i18next"
1314

@@ -68,7 +69,7 @@ function List({ data }: { data?: RSSHubModel[] }) {
6869
<Table containerClassName="mt-2 overflow-x-auto">
6970
<TableHeader>
7071
<TableRow>
71-
<TableHead className="w-[50px] font-bold" size="sm" />
72+
<TableHead className="font-bold" size="sm" />
7273
<TableHead className="w-[150px] font-bold" size="sm">
7374
{t("rsshub.table.owner")}
7475
</TableHead>
@@ -89,7 +90,7 @@ function List({ data }: { data?: RSSHubModel[] }) {
8990
</TableHeader>
9091
<TableBody className="border-t-[12px] border-transparent [&_td]:!px-3">
9192
<TableRow>
92-
<TableCell className="font-bold">Official</TableCell>
93+
<TableCell className="text-nowrap font-bold">{t("rsshub.table.official")}</TableCell>
9394
<TableCell>
9495
<span className="flex items-center gap-2">
9596
<Logo className="size-6" />
@@ -120,14 +121,14 @@ function List({ data }: { data?: RSSHubModel[] }) {
120121
{data?.map((instance) => {
121122
return (
122123
<TableRow key={instance.id}>
123-
<TableCell>
124+
<TableCell className="text-nowrap">
124125
{(() => {
125126
const flag: string[] = []
126127
if (status?.data?.usage?.rsshubId === instance.id) {
127-
flag.push("In use")
128+
flag.push(t("rsshub.table.inuse"))
128129
}
129130
if (instance.ownerUserId === me?.id) {
130-
flag.push("Yours")
131+
flag.push(t("rsshub.table.yours"))
131132
}
132133
return flag.join(" / ")
133134
})()}
@@ -140,7 +141,9 @@ function List({ data }: { data?: RSSHubModel[] }) {
140141
/>
141142
</TableCell>
142143
<TableCell>
143-
<div className="line-clamp-2">{instance.description}</div>
144+
<EllipsisTextWithTooltip className="line-clamp-2">
145+
{instance.description}
146+
</EllipsisTextWithTooltip>
144147
</TableCell>
145148
<TableCell>
146149
<span className="flex items-center justify-end gap-1">

locales/settings/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,14 @@
300300
"rsshub.table.description": "Description",
301301
"rsshub.table.edit": "Edit",
302302
"rsshub.table.inuse": "In Use",
303+
"rsshub.table.official": "Official",
303304
"rsshub.table.owner": "Owner",
304305
"rsshub.table.price": "Monthly Price",
305306
"rsshub.table.unlimited": "Unlimited",
306307
"rsshub.table.use": "Use",
307308
"rsshub.table.userCount": "User Count",
308309
"rsshub.table.userLimit": "User Limit",
310+
"rsshub.table.yours": "Yours",
309311
"rsshub.useModal.about": "About this Instance",
310312
"rsshub.useModal.month": "month",
311313
"rsshub.useModal.months_label": "The number of months you want to purchase",

locales/settings/zh-CN.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,14 @@
300300
"rsshub.table.description": "描述",
301301
"rsshub.table.edit": "编辑",
302302
"rsshub.table.inuse": "使用中",
303+
"rsshub.table.official": "官方",
303304
"rsshub.table.owner": "所有者",
304305
"rsshub.table.price": "月度价格",
305306
"rsshub.table.unlimited": "无限制",
306307
"rsshub.table.use": "使用",
307308
"rsshub.table.userCount": "用户数量",
308309
"rsshub.table.userLimit": "用户限制",
310+
"rsshub.table.yours": "你的",
309311
"rsshub.useModal.about": "关于此实例",
310312
"rsshub.useModal.month": "个月",
311313
"rsshub.useModal.months_label": "你想购买的月份数量",

0 commit comments

Comments
 (0)