Skip to content

Commit

Permalink
Merge pull request #3600 from ever-co/feat/i18n-team-stats-translations
Browse files Browse the repository at this point in the history
Feat(i18n): Add translations for team dashboard
  • Loading branch information
evereq authored Feb 9, 2025
2 parents 85a822d + 9a2cc06 commit 37ee335
Show file tree
Hide file tree
Showing 15 changed files with 215 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { secondsToTime } from '@/app/helpers';
import { ITimesheetStatisticsData } from '@/app/interfaces';
import { Card } from '@/components/ui/card';
import { Loader2 } from 'lucide-react';
import { useTranslations } from 'next-intl';
import { useMemo } from 'react';

function formatPercentage(value: number | undefined): number {
Expand Down Expand Up @@ -35,17 +36,18 @@ export function TeamStatsGrid({
const { h: hours, m: minutes, s: seconds } = secondsToTime(statisticsCounts?.weekDuration || 0);
const timeValue = formatTime(hours, minutes, seconds);
const progress = formatPercentage(statisticsCounts?.weekActivities);
const t = useTranslations();

const stats: StatItem[] = useMemo(
() => [
{
title: 'Members worked',
title: t('common.teamStats.MEMBERS_WORKED'),
value: statisticsCounts?.employeesCount?.toString() || '0',
type: 'number',
showProgress: false
},
{
title: 'Tracked',
title: t('common.teamStats.TRACKED'),
value: timeValue,
type: 'time',
color: 'text-blue-500',
Expand All @@ -54,7 +56,7 @@ export function TeamStatsGrid({
showProgress: true
},
{
title: 'Manual',
title: t('common.teamStats.MANUAL'),
value: timeValue,
type: 'time',
color: 'text-red-500',
Expand All @@ -63,7 +65,7 @@ export function TeamStatsGrid({
showProgress: true
},
{
title: 'Idle',
title: t('common.teamStats.IDLE'),
value: timeValue,
type: 'time',
color: 'text-yellow-500',
Expand All @@ -72,14 +74,14 @@ export function TeamStatsGrid({
showProgress: true
},
{
title: 'Total Hours',
title: t('common.teamStats.TOTAL_HOURS'),
value: timeValue,
type: 'time',
color: 'text-green-500',
showProgress: false
}
],
[timeValue, progress, statisticsCounts?.employeesCount]
[timeValue, progress, statisticsCounts?.employeesCount,t]
);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { Fragment, useState } from 'react';
import { ChartIcon } from './team-icon';
import { ActivityModal } from './activity-modal';
import { useModal } from '@/app/hooks';
import { useTranslations } from 'next-intl';

const getProgressColor = (activityLevel: number) => {
if (isNaN(activityLevel) || activityLevel < 0) return 'bg-gray-300';
Expand Down Expand Up @@ -43,7 +44,7 @@ export function TeamStatsTable({
isLoading?: boolean;
}) {


const t=useTranslations();
const [employeeLog, setEmployeeLog] = useState<ITimerEmployeeLog | undefined>(undefined);
const [currentPage, setCurrentPage] = useState(1);
const [pageSize, setPageSize] = useState(10);
Expand Down Expand Up @@ -73,7 +74,7 @@ export function TeamStatsTable({
if (!rapportDailyActivity?.length) {
return (
<div className="flex justify-center items-center min-h-[400px] text-gray-500 dark:text-white dark:bg-dark--theme-light">
No data available
{t('common.teamStats.NO_DATA_AVAILABLE')}
</div>
);
}
Expand All @@ -91,14 +92,14 @@ export function TeamStatsTable({
<Table className="w-full">
<TableHeader>
<TableRow className="font-normal text-gray-700 bg-gray-50 dark:bg-gray-800 dark:text-gray-200">
<TableHead className="w-[320px] py-3">Member</TableHead>
<TableHead className="w-[100px]">Total Time</TableHead>
<TableHead className="w-[80px]">Tracked</TableHead>
<TableHead className="w-[120px]">Manually Added</TableHead>
<TableHead className="w-[100px]">Active Time</TableHead>
<TableHead className="w-[80px]">Idle Time</TableHead>
<TableHead className="w-[120px]">Unknown Activity</TableHead>
<TableHead className="w-[200px]">Activity Level</TableHead>
<TableHead className="w-[320px] py-3">{t('common.teamStats.MEMBER')}</TableHead>
<TableHead className="w-[100px]">{t('common.teamStats.TOTAL_TIME')}</TableHead>
<TableHead className="w-[80px]">{t('common.teamStats.TRACKED')}</TableHead>
<TableHead className="w-[120px]">{t('common.teamStats.MANUALLY_ADDED')}</TableHead>
<TableHead className="w-[100px]">{t('common.teamStats.ACTIVE_TIME')}</TableHead>
<TableHead className="w-[80px]">{t('common.teamStats.IDLE_TIME')}</TableHead>
<TableHead className="w-[120px]">{t('common.teamStats.UNKNOWN_ACTIVITY')}</TableHead>
<TableHead className="w-[200px]">{t('common.teamStats.ACTIVITY_LEVEL')}</TableHead>
<TableHead className="w-[10px]"></TableHead>
</TableRow>
</TableHeader>
Expand Down
15 changes: 15 additions & 0 deletions apps/web/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,21 @@
"ADD_PLAN": "إضافة خطة",
"DELETE_THIS_PLAN": "احذف هذه الخطة"
},
"teamStats": {
"MEMBER": "عضو",
"MEMBERS_WORKED": "الأعضاء الذين عملوا",
"TOTAL_TIME": "الوقت الكلي",
"TOTAL_HOURS": "إجمالي الساعات",
"TRACKED": "متتبع",
"MANUALLY_ADDED": "مضاف يدويًا",
"MANUAL": "يدوي",
"ACTIVE_TIME": "الوقت النشط",
"IDLE_TIME": "وقت الخمول",
"IDLE": "خامل",
"UNKNOWN_ACTIVITY": "نشاط غير معروف",
"ACTIVITY_LEVEL": "مستوى النشاط",
"NO_DATA_AVAILABLE": "لا توجد بيانات متاحة"
},
"timesheets": {
"SINGULAR": "ورقة الحضور",
"PLURAL": "ورقات الحضور"
Expand Down
15 changes: 15 additions & 0 deletions apps/web/locales/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,21 @@
"ADD_PLAN": "Добави план",
"DELETE_THIS_PLAN": "Изтрийте този план"
},
"teamStats": {
"MEMBER": "Член",
"MEMBERS_WORKED": "Членове, които са работили",
"TOTAL_TIME": "Общо време",
"TOTAL_HOURS": "Общо часове",
"TRACKED": "Проследено",
"MANUALLY_ADDED": "Добавено ръчно",
"MANUAL": "Ръчно",
"ACTIVE_TIME": "Активно време",
"IDLE_TIME": "Време на бездействие",
"IDLE": "Неактивен",
"UNKNOWN_ACTIVITY": "Неизвестна дейност",
"ACTIVITY_LEVEL": "Ниво на активност",
"NO_DATA_AVAILABLE": "Няма налични данни"
},
"timesheets": {
"SINGULAR": "Работен лист",
"PLURAL": "Работни листове"
Expand Down
15 changes: 15 additions & 0 deletions apps/web/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,21 @@
"ADD_PLAN": "Plan hinzufügen",
"DELETE_THIS_PLAN": "Diesen Plan löschen"
},
"teamStats": {
"MEMBER": "Mitglied",
"MEMBERS_WORKED": "Mitglieder, die gearbeitet haben",
"TOTAL_TIME": "Gesamtzeit",
"TOTAL_HOURS": "Gesamtstunden",
"TRACKED": "Verfolgt",
"MANUALLY_ADDED": "Manuell hinzugefügt",
"MANUAL": "Manuell",
"ACTIVE_TIME": "Aktive Zeit",
"IDLE_TIME": "Leerlaufzeit",
"IDLE": "Inaktiv",
"UNKNOWN_ACTIVITY": "Unbekannte Aktivität",
"ACTIVITY_LEVEL": "Aktivitätsniveau",
"NO_DATA_AVAILABLE": "Keine Daten verfügbar"
},
"timesheets": {
"SINGULAR": "Stundenzettel",
"PLURAL": "Stundenzettel"
Expand Down
15 changes: 15 additions & 0 deletions apps/web/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,21 @@
"ADD_PLAN": "Add Plan",
"DELETE_THIS_PLAN": "Delete this plan"
},
"teamStats": {
"MEMBER": "Member",
"MEMBERS_WORKED": "Members Worked",
"TOTAL_TIME": "Total Time",
"TOTAL_HOURS": "Total Hours",
"TRACKED": "Tracked",
"MANUALLY_ADDED": "Manually Added",
"MANUAL": "Manual",
"ACTIVE_TIME": "Active Time",
"IDLE_TIME": "Idle Time",
"IDLE": "Idle",
"UNKNOWN_ACTIVITY": "Unknown Activity",
"ACTIVITY_LEVEL": "Activity Level",
"NO_DATA_AVAILABLE": "No Data Available"
},
"timesheets": {
"SINGULAR": "Timesheet",
"PLURAL": "Timesheets"
Expand Down
15 changes: 15 additions & 0 deletions apps/web/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,21 @@
"FOR_TOMORROW": "Plan de mañana",
"DELETE_THIS_PLAN": "Eliminar este plan"
},
"teamStats": {
"MEMBER": "Miembro",
"MEMBERS_WORKED": "Miembros que Trabajaron",
"TOTAL_TIME": "Tiempo Total",
"TOTAL_HOURS": "Horas Totales",
"TRACKED": "Rastreado",
"MANUALLY_ADDED": "Agregado Manualmente",
"MANUAL": "Manual",
"ACTIVE_TIME": "Tiempo Activo",
"IDLE_TIME": "Tiempo Inactivo",
"IDLE": "Inactivo",
"UNKNOWN_ACTIVITY": "Actividad Desconocida",
"ACTIVITY_LEVEL": "Nivel de Actividad",
"NO_DATA_AVAILABLE": "No hay datos disponibles"
},
"timesheets": {
"SINGULAR": "Hoja de horas",
"PLURAL": "Hojas de horas"
Expand Down
16 changes: 16 additions & 0 deletions apps/web/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,22 @@
"ADD_PLAN": "Ajouter un plan",
"DELETE_THIS_PLAN": "Supprimer ce plan"
},
"teamStats": {
"MEMBER": "Membre",
"MEMBERS_WORKED": "Membres Ayant Travaillé",
"TOTAL_TIME": "Temps Total",
"TOTAL_HOURS": "Heures Totales",
"TRACKED": "Suivi",
"MANUALLY_ADDED": "Ajouté Manuellement",
"MANUAL": "Manuel",
"ACTIVE_TIME": "Temps Actif",
"IDLE_TIME": "Temps Inactif",
"IDLE": "Inactif",
"UNKNOWN_ACTIVITY": "Activité Inconnue",
"ACTIVITY_LEVEL": "Niveau d’Activité",
"NO_DATA_AVAILABLE": "Aucune donnée disponible"

},
"timesheets": {
"SINGULAR": "Feuille de temps",
"PLURAL": "Feuilles de temps"
Expand Down
15 changes: 15 additions & 0 deletions apps/web/locales/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,21 @@
"ADD_PLAN": "הוסף תוכנית",
"DELETE_THIS_PLAN": "מחק את התוכנית הזו"
},
"teamStats": {
"MEMBER": "חבר",
"MEMBERS_WORKED": "חברים שעבדו",
"TOTAL_TIME": "זמן כולל",
"TOTAL_HOURS": "סך השעות",
"TRACKED": "נעקב",
"MANUALLY_ADDED": "נוסף ידנית",
"MANUAL": "ידני",
"ACTIVE_TIME": "זמן פעיל",
"IDLE_TIME": "זמן סרק",
"IDLE": "לא פעיל",
"UNKNOWN_ACTIVITY": "פעילות לא ידועה",
"ACTIVITY_LEVEL": "רמת פעילות",
"NO_DATA_AVAILABLE": "לא יוכל להציג נתונים"
},
"timesheets": {
"SINGULAR": "דוח שעות",
"PLURAL": "דוחות שעות"
Expand Down
15 changes: 15 additions & 0 deletions apps/web/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,21 @@
"ADD_PLAN": "Aggiungi Piano",
"DELETE_THIS_PLAN": "Elimina questo piano"
},
"teamStats": {
"MEMBER": "Membro",
"MEMBERS_WORKED": "Membri che Hanno Lavorato",
"TOTAL_TIME": "Tempo Totale",
"TOTAL_HOURS": "Ore Totali",
"TRACKED": "Tracciato",
"MANUALLY_ADDED": "Aggiunto Manualmente",
"MANUAL": "Manuale",
"ACTIVE_TIME": "Tempo Attivo",
"IDLE_TIME": "Tempo Inattivo",
"IDLE": "Inattivo",
"UNKNOWN_ACTIVITY": "Attività Sconosciuta",
"ACTIVITY_LEVEL": "Livello di Attività",
"NO_DATA_AVAILABLE": "Nessun Dato Disponibile"
},
"COPY_ISSUE_LINK": "Copia collegamento problema",
"MAKE_A_COPY": "Fai una copia",
"ASSIGNEE": "Assegnatario",
Expand Down
15 changes: 15 additions & 0 deletions apps/web/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,21 @@
"ADD_PLAN": "Plan toevoegen",
"DELETE_THIS_PLAN": "Verwijder dit plan"
},
"teamStats": {
"MEMBER": "Lid",
"MEMBERS_WORKED": "Leden die Hebben Gewerkt",
"TOTAL_TIME": "Totale Tijd",
"TOTAL_HOURS": "Totale Uren",
"TRACKED": "Bijgehouden",
"MANUALLY_ADDED": "Handmatig Toegevoegd",
"MANUAL": "Handmatig",
"ACTIVE_TIME": "Actieve Tijd",
"IDLE_TIME": "Inactieve Tijd",
"IDLE": "Inactief",
"UNKNOWN_ACTIVITY": "Onbekende Activiteit",
"ACTIVITY_LEVEL": "Activiteitsniveau",
"NO_DATA_AVAILABLE": "Geen gegevens beschikbaar"
},
"COPY_ISSUE_LINK": "Probleemlink kopiëren",
"MAKE_A_COPY": "Maak een kopie",
"ASSIGNEE": "Cessionaris",
Expand Down
15 changes: 15 additions & 0 deletions apps/web/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,21 @@
"ADD_PLAN": "Dodaj plan",
"DELETE_THIS_PLAN": "Usuń ten plan"
},
"teamStats": {
"MEMBER": "Członek",
"MEMBERS_WORKED": "Członkowie, Którzy Pracowali",
"TOTAL_TIME": "Łączny Czas",
"TOTAL_HOURS": "Łączne Godziny",
"TRACKED": "Śledzony",
"MANUALLY_ADDED": "Dodany Ręcznie",
"MANUAL": "Ręczny",
"ACTIVE_TIME": "Czas Aktywny",
"IDLE_TIME": "Czas Bezczynności",
"IDLE": "Bezczynny",
"UNKNOWN_ACTIVITY": "Nieznana Aktywność",
"ACTIVITY_LEVEL": "Poziom Aktywności",
"NO_DATA_AVAILABLE": "Brak dostępnych danych"
},
"COPY_ISSUE_LINK": "Skopiuj link do zgłoszenia",
"MAKE_A_COPY": "Zrób kopię",
"ASSIGNEE": "Cesjonariusz",
Expand Down
15 changes: 15 additions & 0 deletions apps/web/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,21 @@
"ADD_PLAN": "Adicionar Plano",
"DELETE_THIS_PLAN": "Excluir este plano"
},
"teamStats": {
"MEMBER": "Membro",
"MEMBERS_WORKED": "Membros que Trabalharam",
"TOTAL_TIME": "Tempo Total",
"TOTAL_HOURS": "Horas Totais",
"TRACKED": "Rastreado",
"MANUALLY_ADDED": "Adicionado Manualmente",
"MANUAL": "Manual",
"ACTIVE_TIME": "Tempo Ativo",
"IDLE_TIME": "Tempo Inativo",
"IDLE": "Inativo",
"UNKNOWN_ACTIVITY": "Atividade Desconhecida",
"ACTIVITY_LEVEL": "Nível de Atividade",
"NO_DATA_AVAILABLE": "Nenhum dado disponível"
},
"COPY_ISSUE_LINK": "Copiar link do problema",
"MAKE_A_COPY": "Fazer uma cópia",
"ASSIGNEE": "Cessionário",
Expand Down
15 changes: 15 additions & 0 deletions apps/web/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,21 @@
"ADD_PLAN": "Agregar Plan",
"DELETE_THIS_PLAN": "Удалить этот план"
},
"teamStats": {
"MEMBER": "Участник",
"MEMBERS_WORKED": "Участники, Которые Работали",
"TOTAL_TIME": "Общее Время",
"TOTAL_HOURS": "Общее Количество Часов",
"TRACKED": "Отслежено",
"MANUALLY_ADDED": "Добавлено Вручную",
"MANUAL": "Вручную",
"ACTIVE_TIME": "Активное Время",
"IDLE_TIME": "Время Бездействия",
"IDLE": "Бездействие",
"UNKNOWN_ACTIVITY": "Неизвестная Активность",
"ACTIVITY_LEVEL": "Уровень Активности",
"NO_DATA_AVAILABLE": "Нет доступных данных"
},
"COPY_ISSUE_LINK": "Скопировать ссылку на проблему",
"MAKE_A_COPY": "Сделать копию",
"ASSIGNEE": "Исполнитель",
Expand Down
15 changes: 15 additions & 0 deletions apps/web/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,21 @@
"ADD_PLAN": "添加计划",
"DELETE_THIS_PLAN": "删除此计划"
},
"teamStats": {
"MEMBER": "成员",
"MEMBERS_WORKED": "已工作的成员",
"TOTAL_TIME": "总时间",
"TOTAL_HOURS": "总小时数",
"TRACKED": "已跟踪",
"MANUALLY_ADDED": "手动添加",
"MANUAL": "手动",
"ACTIVE_TIME": "活动时间",
"IDLE_TIME": "空闲时间",
"IDLE": "空闲",
"UNKNOWN_ACTIVITY": "未知活动",
"ACTIVITY_LEVEL": "活动水平",
"NO_DATA_AVAILABLE": "没有可用数据"
},
"COPY_ISSUE_LINK": "复制问题链接",
"MAKE_A_COPY": "制作副本",
"ASSIGNEE": "受让人",
Expand Down

0 comments on commit 37ee335

Please sign in to comment.