diff --git a/src/i18n/langs/en.ts b/src/i18n/langs/en.ts index 868768f..e7ad39c 100644 --- a/src/i18n/langs/en.ts +++ b/src/i18n/langs/en.ts @@ -39,6 +39,8 @@ const enTranslation = { }, dashboard: { + goal: 'Goal: {{value}}', + of_teacher: 'Of teacher', filters: { region: 'Select region', district: 'Select district', diff --git a/src/i18n/langs/np.ts b/src/i18n/langs/np.ts index ef50021..7a99d0c 100644 --- a/src/i18n/langs/np.ts +++ b/src/i18n/langs/np.ts @@ -37,6 +37,8 @@ const npTranslation = { schools: 'विद्यालयहरू', }, dashboard: { + goal: 'लक्ष्य: {{value}}', + of_teacher: 'शिक्षकको', filters: { region: 'क्षेत्र चयन गर्नुहोस्', district: 'जिल्ला चयन गर्नुहोस्', diff --git a/src/pages/Dashboard/components/SpeedometerGraph/index.tsx b/src/pages/Dashboard/components/SpeedometerGraph/index.tsx index 72231cc..5bf7fdb 100644 --- a/src/pages/Dashboard/components/SpeedometerGraph/index.tsx +++ b/src/pages/Dashboard/components/SpeedometerGraph/index.tsx @@ -1,6 +1,7 @@ import { Center, Text, VStack } from '@chakra-ui/react'; import { ChartData } from 'chart.js'; import { Doughnut } from 'react-chartjs-2'; +import { useTranslation } from 'react-i18next'; type Props = { label: string; @@ -9,6 +10,7 @@ type Props = { }; export const SpeedometerGraph: React.FC = ({ maxValue, value, label }) => { + const { t } = useTranslation(); const coachingSessionPerTeacher: ChartData<'doughnut', number[], string> = { datasets: [ { @@ -35,7 +37,7 @@ export const SpeedometerGraph: React.FC = ({ maxValue, value, label }) => {value} - Goal: {maxValue} + {t('dashboard.goal', { value: maxValue })} diff --git a/src/pages/Dashboard/index.tsx b/src/pages/Dashboard/index.tsx index 11eaf8a..52aa558 100644 --- a/src/pages/Dashboard/index.tsx +++ b/src/pages/Dashboard/index.tsx @@ -125,7 +125,7 @@ const DashboardPage: React.FC = () => { : 0 ).toFixed(0) + '%' } - subTitle="Of teachers" + subTitle={t('dashboard.of_teacher') || ''} />