diff --git a/src/lib/components/admin/Analytics/Dashboard.svelte b/src/lib/components/admin/Analytics/Dashboard.svelte index 277cb5339..471285c2d 100644 --- a/src/lib/components/admin/Analytics/Dashboard.svelte +++ b/src/lib/components/admin/Analytics/Dashboard.svelte @@ -24,12 +24,12 @@ // Time period - persist in localStorage let selectedPeriod = (typeof localStorage !== 'undefined' && localStorage.getItem('analyticsPeriod')) || '7d'; - const periods = [ - { value: '24h', label: 'Last 24 hours' }, - { value: '7d', label: 'Last 7 days' }, - { value: '30d', label: 'Last 30 days' }, - { value: '90d', label: 'Last 90 days' }, - { value: 'all', label: 'All time' } + $: periods = [ + { value: '24h', label: $i18n.t('Last 24 hours') }, + { value: '7d', label: $i18n.t('Last 7 days') }, + { value: '30d', label: $i18n.t('Last 30 days') }, + { value: '90d', label: $i18n.t('Last 90 days') }, + { value: 'all', label: $i18n.t('All time') } ]; // User group filter @@ -214,7 +214,7 @@ class="w-fit pr-8 rounded-sm px-2 text-xs bg-transparent outline-none text-right" > {#each periods as period} - + {/each} @@ -274,7 +274,7 @@ {@const periodMap = { '24h': 'hour', '7d': 'week', '30d': 'month', '90d': 'year', all: 'all' }}
- {$i18n.t(selectedPeriod === '24h' ? 'Hourly Messages' : 'Daily Messages')} + {selectedPeriod === '24h' ? $i18n.t('Hourly Messages') : $i18n.t('Daily Messages')}
0) return `${years}y`; - if (weeks > 0) return `${weeks}w`; - if (days > 0) return `${days}d`; - if (hours > 0) return `${hours}h`; - if (minutes > 0) return `${minutes}m`; - return '1m'; + if (years > 0) return $i18n.t('{{count}}y', { count: years, context: 'time_ago' }); + if (weeks > 0) return $i18n.t('{{count}}w', { count: weeks, context: 'time_ago' }); + if (days > 0) return $i18n.t('{{count}}d', { count: days, context: 'time_ago' }); + if (hours > 0) return $i18n.t('{{count}}h', { count: hours, context: 'time_ago' }); + if (minutes > 0) return $i18n.t('{{count}}m', { count: minutes, context: 'time_ago' }); + return $i18n.t('1m', { context: 'time_ago' }); } let chat = null;