feat: add missing i18n keys for analytics chart empty states

This commit is contained in:
Tam Nhu Tran
2026-04-15 21:40:56 -04:00
parent 0e8abed798
commit d3ef82cd60
2 changed files with 11 additions and 4 deletions
@@ -17,6 +17,7 @@ import {
AreaChart,
} from 'recharts';
import { format } from 'date-fns';
import { useTranslation } from 'react-i18next';
import { Skeleton } from '@/components/ui/skeleton';
import { cn } from '@/lib/utils';
import type { DailyUsage, HourlyUsage } from '@/hooks/use-usage';
@@ -39,8 +40,7 @@ export function UsageTrendChart({
className,
}: UsageTrendChartProps) {
const { privacyMode } = usePrivacy();
// TODO i18n: uncomment when keys for "No usage data for today" / "No usage data available" are added
// const { t } = useTranslation();
const { t } = useTranslation();
const chartData = useMemo(() => {
if (!data || data.length === 0) return [];
@@ -67,8 +67,7 @@ export function UsageTrendChart({
return (
<div className={cn('h-full flex items-center justify-center', className)}>
<p className="text-muted-foreground">
{/* TODO i18n: missing keys for "No usage data for today" / "No usage data available" */}
{granularity === 'hourly' ? 'No usage data for today' : 'No usage data available'}
{granularity === 'hourly' ? t('analytics.noDailyUsage') : t('analytics.noUsageData')}
</p>
</div>
);
+8
View File
@@ -1063,6 +1063,8 @@ const resources = {
},
analytics: {
title: 'Analytics',
noDailyUsage: 'No usage data for today',
noUsageData: 'No usage data available',
subtitle: 'Track usage and insights',
month: 'Month',
allTime: 'All Time',
@@ -3463,6 +3465,8 @@ const resources = {
},
analytics: {
title: '分析',
noDailyUsage: '今日无使用数据',
noUsageData: '无可用使用数据',
subtitle: '追踪使用情况与洞察',
month: '本月',
allTime: '全部时间',
@@ -5902,6 +5906,8 @@ const resources = {
},
analytics: {
title: 'Phân tích',
noDailyUsage: 'Không có dữ liệu sử dụng cho hôm nay',
noUsageData: 'Không có dữ liệu sử dụng',
subtitle: 'Theo dõi việc sử dụng và thông tin chi tiết',
month: 'Tháng',
allTime: 'Tất cả thời gian',
@@ -8370,6 +8376,8 @@ const resources = {
},
analytics: {
title: '分析',
noDailyUsage: '本日の使用データはありません',
noUsageData: '利用可能な使用データはありません',
subtitle: '利用状況とインサイトを確認',
month: '月',
allTime: '全期間',