From f96680fcc965b3de5186801370fc20981d17cf84 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 6 Jul 2025 16:14:14 +0000 Subject: fix: Fix i18n in the new stats page --- apps/web/app/settings/stats/page.tsx | 94 ++++++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 35 deletions(-) (limited to 'apps/web/app/settings/stats') diff --git a/apps/web/app/settings/stats/page.tsx b/apps/web/app/settings/stats/page.tsx index 15608a34..ab4fb22c 100644 --- a/apps/web/app/settings/stats/page.tsx +++ b/apps/web/app/settings/stats/page.tsx @@ -5,6 +5,7 @@ import { Badge } from "@/components/ui/badge"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Progress } from "@/components/ui/progress"; import { Skeleton } from "@/components/ui/skeleton"; +import { useTranslation } from "@/lib/i18n/client"; import { api } from "@/lib/trpc"; import { Archive, @@ -107,6 +108,7 @@ function StatCard({ } export default function StatsPage() { + const { t } = useTranslation(); const { data: stats, isLoading } = api.users.stats.useQuery(); const maxHourlyActivity = useMemo(() => { @@ -131,9 +133,11 @@ export default function StatsPage() { return (
-

Usage Statistics

+

+ {t("settings.stats.usage_statistics")} +

- Insights into your bookmarking habits and collection + {t("settings.stats.insights_description")}

@@ -157,7 +161,9 @@ export default function StatsPage() { if (!stats) { return (
-

Failed to load statistics

+

+ {t("settings.stats.failed_to_load")} +

); } @@ -165,7 +171,9 @@ export default function StatsPage() { return (
-

Usage Statistics

+

+ {t("settings.stats.usage_statistics")} +

Insights into your bookmarking habits and collection

@@ -174,52 +182,52 @@ export default function StatsPage() { {/* Overview Stats */}
} - description="All saved items" + description={t("settings.stats.overview.all_saved_items")} /> } - description="Starred bookmarks" + description={t("settings.stats.overview.starred_bookmarks")} /> } - description="Archived items" + description={t("settings.stats.overview.archived_items")} /> } - description="Unique tags created" + description={t("settings.stats.overview.unique_tags_created")} /> } - description="Bookmark collections" + description={t("settings.stats.overview.bookmark_collections")} /> } - description="Text highlights" + description={t("settings.stats.overview.text_highlights")} /> } - description="Total asset storage" + description={t("settings.stats.overview.total_asset_storage")} /> } - description="Bookmarks added" + description={t("settings.stats.overview.bookmarks_added")} />
@@ -229,7 +237,7 @@ export default function StatsPage() { - Bookmark Types + {t("settings.stats.bookmark_types.title")} @@ -237,7 +245,9 @@ export default function StatsPage() {
- Links + + {t("settings.stats.bookmark_types.links")} +
{stats.bookmarksByType.link} @@ -256,7 +266,9 @@ export default function StatsPage() {
- Text Notes + + {t("settings.stats.bookmark_types.text_notes")} +
{stats.bookmarksByType.text} @@ -275,7 +287,9 @@ export default function StatsPage() {
- Assets + + {t("settings.stats.bookmark_types.assets")} +
{stats.bookmarksByType.asset} @@ -298,7 +312,7 @@ export default function StatsPage() { - Recent Activity + {t("settings.stats.recent_activity.title")} @@ -307,19 +321,25 @@ export default function StatsPage() {
{stats.bookmarkingActivity.thisWeek}
-
This Week
+
+ {t("settings.stats.recent_activity.this_week")} +
{stats.bookmarkingActivity.thisMonth}
-
This Month
+
+ {t("settings.stats.recent_activity.this_month")} +
{stats.bookmarkingActivity.thisYear}
-
This Year
+
+ {t("settings.stats.recent_activity.this_year")} +
@@ -330,7 +350,7 @@ export default function StatsPage() { - Top Domains + {t("settings.stats.top_domains.title")} @@ -364,7 +384,9 @@ export default function StatsPage() { )}
) : ( -

No domains found

+

+ {t("settings.stats.top_domains.no_domains_found")} +

)}
@@ -374,7 +396,7 @@ export default function StatsPage() { - Most Used Tags + {t("settings.stats.most_used_tags.title")} @@ -405,7 +427,9 @@ export default function StatsPage() { )}
) : ( -

No tags found

+

+ {t("settings.stats.most_used_tags.no_tags_found")} +

)} @@ -418,7 +442,7 @@ export default function StatsPage() { - Activity by Hour + {t("settings.stats.activity_patterns.activity_by_hour")} @@ -437,7 +461,7 @@ export default function StatsPage() { - Activity by Day + {t("settings.stats.activity_patterns.activity_by_day")} @@ -458,7 +482,7 @@ export default function StatsPage() { - Storage Breakdown + {t("settings.stats.storage_breakdown.title")} -- cgit v1.2.3-70-g09d2