mirror of
https://github.com/tiennm99/ccs.git
synced 2026-08-17 10:25:02 +00:00
feat: add missing i18n keys for analytics chart empty states
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
|||||||
AreaChart,
|
AreaChart,
|
||||||
} from 'recharts';
|
} from 'recharts';
|
||||||
import { format } from 'date-fns';
|
import { format } from 'date-fns';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Skeleton } from '@/components/ui/skeleton';
|
import { Skeleton } from '@/components/ui/skeleton';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
import type { DailyUsage, HourlyUsage } from '@/hooks/use-usage';
|
import type { DailyUsage, HourlyUsage } from '@/hooks/use-usage';
|
||||||
@@ -39,8 +40,7 @@ export function UsageTrendChart({
|
|||||||
className,
|
className,
|
||||||
}: UsageTrendChartProps) {
|
}: UsageTrendChartProps) {
|
||||||
const { privacyMode } = usePrivacy();
|
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(() => {
|
const chartData = useMemo(() => {
|
||||||
if (!data || data.length === 0) return [];
|
if (!data || data.length === 0) return [];
|
||||||
@@ -67,8 +67,7 @@ export function UsageTrendChart({
|
|||||||
return (
|
return (
|
||||||
<div className={cn('h-full flex items-center justify-center', className)}>
|
<div className={cn('h-full flex items-center justify-center', className)}>
|
||||||
<p className="text-muted-foreground">
|
<p className="text-muted-foreground">
|
||||||
{/* TODO i18n: missing keys for "No usage data for today" / "No usage data available" */}
|
{granularity === 'hourly' ? t('analytics.noDailyUsage') : t('analytics.noUsageData')}
|
||||||
{granularity === 'hourly' ? 'No usage data for today' : 'No usage data available'}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1063,6 +1063,8 @@ const resources = {
|
|||||||
},
|
},
|
||||||
analytics: {
|
analytics: {
|
||||||
title: 'Analytics',
|
title: 'Analytics',
|
||||||
|
noDailyUsage: 'No usage data for today',
|
||||||
|
noUsageData: 'No usage data available',
|
||||||
subtitle: 'Track usage and insights',
|
subtitle: 'Track usage and insights',
|
||||||
month: 'Month',
|
month: 'Month',
|
||||||
allTime: 'All Time',
|
allTime: 'All Time',
|
||||||
@@ -3463,6 +3465,8 @@ const resources = {
|
|||||||
},
|
},
|
||||||
analytics: {
|
analytics: {
|
||||||
title: '分析',
|
title: '分析',
|
||||||
|
noDailyUsage: '今日无使用数据',
|
||||||
|
noUsageData: '无可用使用数据',
|
||||||
subtitle: '追踪使用情况与洞察',
|
subtitle: '追踪使用情况与洞察',
|
||||||
month: '本月',
|
month: '本月',
|
||||||
allTime: '全部时间',
|
allTime: '全部时间',
|
||||||
@@ -5902,6 +5906,8 @@ const resources = {
|
|||||||
},
|
},
|
||||||
analytics: {
|
analytics: {
|
||||||
title: 'Phân tích',
|
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',
|
subtitle: 'Theo dõi việc sử dụng và thông tin chi tiết',
|
||||||
month: 'Tháng',
|
month: 'Tháng',
|
||||||
allTime: 'Tất cả thời gian',
|
allTime: 'Tất cả thời gian',
|
||||||
@@ -8370,6 +8376,8 @@ const resources = {
|
|||||||
},
|
},
|
||||||
analytics: {
|
analytics: {
|
||||||
title: '分析',
|
title: '分析',
|
||||||
|
noDailyUsage: '本日の使用データはありません',
|
||||||
|
noUsageData: '利用可能な使用データはありません',
|
||||||
subtitle: '利用状況とインサイトを確認',
|
subtitle: '利用状況とインサイトを確認',
|
||||||
month: '月',
|
month: '月',
|
||||||
allTime: '全期間',
|
allTime: '全期間',
|
||||||
|
|||||||
Reference in New Issue
Block a user