Improved user interface translations and clarity in Simplified

This commit is contained in:
oiov
2025-06-09 17:40:21 +08:00
parent cc4515cc6d
commit 1640f263b1
6 changed files with 34 additions and 11 deletions
@@ -274,7 +274,7 @@ export function DailyPVUVChart({
value={e.value}
>
<span className="flex items-center gap-1">
{e.label}
{t(e.label)}
{e.key >
TeamPlanQuota[user.team!].SL_AnalyticsRetention && (
<Icons.crown className="size-3" />
+9 -6
View File
@@ -2,6 +2,7 @@
import { useState } from "react";
import { UrlMeta, User } from "@prisma/client";
import { useTranslations } from "next-intl";
import useSWR from "swr";
import { TeamPlanQuota } from "@/config/team";
@@ -28,6 +29,7 @@ export interface UrlMetaProps {
}
export default function UserUrlMetaInfo({ user, action, urlId }: UrlMetaProps) {
const t = useTranslations("Components");
const [timeRange, setTimeRange] = useState<string>("24h");
const { data, isLoading } = useSWR<UrlMeta[]>(
`${action}?id=${urlId}&range=${timeRange}`,
@@ -45,12 +47,13 @@ export default function UserUrlMetaInfo({ user, action, urlId }: UrlMetaProps) {
if (!data || data.length === 0) {
return (
<EmptyPlaceholder className="shadow-none">
<EmptyPlaceholder.Title>No Visits</EmptyPlaceholder.Title>
<EmptyPlaceholder.Title>{t("No Visits")}</EmptyPlaceholder.Title>
<EmptyPlaceholder.Description>
You don&apos;t have any visits yet in{" "}
{DATE_DIMENSION_ENUMS.find(
(e) => e.value === timeRange,
)?.label.toLowerCase()}
{t("You don't have any visits yet in")}{" "}
{t(
DATE_DIMENSION_ENUMS.find((e) => e.value === timeRange)?.label ||
"",
)}
.
<Select
onValueChange={(value: string) => {
@@ -72,7 +75,7 @@ export default function UserUrlMetaInfo({ user, action, urlId }: UrlMetaProps) {
value={e.value}
>
<span className="flex items-center gap-1">
{e.label}
{t(e.label)}
{e.key >
TeamPlanQuota[user.team!].SL_AnalyticsRetention && (
<Icons.crown className="size-3" />
+1 -1
View File
@@ -129,7 +129,7 @@ export function InteractiveBarChart() {
<SelectContent>
{DATE_DIMENSION_ENUMS.map((e, i) => (
<div key={e.value}>
<SelectItem value={e.value}>{e.label}</SelectItem>
<SelectItem value={e.value}>{t(e.label)}</SelectItem>
{i % 2 === 0 && i !== DATE_DIMENSION_ENUMS.length - 1 && (
<SelectSeparator />
)}
+11 -1
View File
@@ -244,7 +244,17 @@
"Incorrect password": "Incorrect password",
"Please try again": "Please try again",
"Unlock": "Unlock",
"Unlocking": "Unlocking..."
"Unlocking": "Unlocking...",
"Last 24 Hours": "Last 24 Hours",
"Last 7 Days": "Last 7 Days",
"Last 30 Days": "Last 30 Days",
"Last 2 Months": "Last 2 Months",
"Last 3 Months": "Last 3 Months",
"Last 6 Months": "Last 6 Months",
"Last 1 Year": "Last 1 Year",
"All the time": "All the time",
"No Visits": "No Visits",
"You don't have any visits yet in": "You don't have any visits yet in"
},
"Landing": {
"settings": "Settings",
+11 -1
View File
@@ -244,7 +244,17 @@
"Incorrect password": "密码错误",
"Please try again": "请重试",
"Unlock": "解锁",
"Unlocking": "解锁中..."
"Unlocking": "解锁中...",
"Last 24 Hours": "最近 24 小时",
"Last 7 Days": "最近 7 天",
"Last 30 Days": "最近 30 天",
"Last 2 Months": "最近 2 个月",
"Last 3 Months": "最近 3 个月",
"Last 6 Months": "最近 6 个月",
"Last 1 Year": "最近 1 年",
"All the time": "所有时间",
"No Visits": "无访问记录",
"You don't have any visits yet in": "您还没有任何访问记录于"
},
"Landing": {
"settings": "设置",
+1 -1
View File
File diff suppressed because one or more lines are too long