diff --git a/core/i18n/resources/en.js b/core/i18n/resources/en.js index e1dd075989..9944b18c5b 100644 --- a/core/i18n/resources/en.js +++ b/core/i18n/resources/en.js @@ -385,6 +385,12 @@ Thank you and enjoy **$t(common.appNameFull)**!`, availableSpace: 'Available ({{size}})', usedSpace: 'Used ({{size}})', }, + samplingPointDataCompletion: 'Sampling Point Data Completion', + step: { + entry: 'Data Entry', + cleansing: 'Data Cleansing', + analysis: 'Data Analysis', + }, }, surveyDeleted: 'Survey {{surveyName}} has been deleted', surveyInfo: { diff --git a/webapp/views/App/views/Home/Dashboard/SamplingPointDataSummary/SamplingDataChart.js b/webapp/views/App/views/Home/Dashboard/SamplingPointDataSummary/SamplingDataChart.js index 8f2d1e95d3..4b38829183 100644 --- a/webapp/views/App/views/Home/Dashboard/SamplingPointDataSummary/SamplingDataChart.js +++ b/webapp/views/App/views/Home/Dashboard/SamplingPointDataSummary/SamplingDataChart.js @@ -1,11 +1,15 @@ import React, { useEffect, useRef, useContext } from 'react' import * as d3 from 'd3' + import { countSamplingPointData } from '@webapp/service/api/categories' +import { useI18n } from '@webapp/store/system' + import { RecordsSummaryContext } from '../RecordsSummaryContext' const SamplingDataChart = (surveyInfo) => { const ref = useRef() const { dataEntry, dataCleansing } = useContext(RecordsSummaryContext) + const i18n = useI18n() useEffect(() => { const fetchData = async () => { @@ -43,7 +47,9 @@ const SamplingDataChart = (surveyInfo) => { .attr('d', arcGenerator1) .attr('fill', (d, i) => color(i)) - d3.select('#tooltip1').style('visibility', 'visible').html(`Data Entry: ${dataEntry} / ${totalRows}`) + d3.select('#tooltip1') + .style('visibility', 'visible') + .html(`${i18n.t('homeView.dashboard.step.entry')}: ${dataEntry} / ${totalRows}`) // Create second pie const data_ready2 = pie(data2) @@ -56,14 +62,16 @@ const SamplingDataChart = (surveyInfo) => { .attr('d', arcGenerator2) .attr('fill', (d, i) => color2(i)) - d3.select('#tooltip2').style('visibility', 'visible').html(`Data Cleansing: ${dataCleansing} / ${totalRows}`) + d3.select('#tooltip2') + .style('visibility', 'visible') + .html(`${i18n.t('homeView.dashboard.step.cleansing')}: ${dataCleansing} / ${totalRows}`) } fetchData() }, []) return (