Enhance farm dashboard localization by adding Persian translations for various UI elements, including subheaders, option menus, labels, and fallback text. Refactor components to utilize the new translations, improving the overall user experience for Persian-speaking users.
This commit is contained in:
@@ -39,7 +39,9 @@ const EconomicOverview = ({ data }: EconomicOverviewProps) => {
|
||||
const t = useTranslations('farmDashboard')
|
||||
const economicData = (data?.economicData as EconomicItem[] | undefined) ?? []
|
||||
const chartSeries = (data?.chartSeries as Array<{ name: string; data: number[] }>) ?? []
|
||||
const chartCategories = (data?.chartCategories as string[]) ?? ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
|
||||
const chartCategories =
|
||||
(data?.chartCategories as string[]) ??
|
||||
[t('fallback.monthJan'), t('fallback.monthFeb'), t('fallback.monthMar'), t('fallback.monthApr'), t('fallback.monthMay'), t('fallback.monthJun')]
|
||||
const theme = useTheme()
|
||||
|
||||
const options: ApexOptions = {
|
||||
@@ -77,8 +79,8 @@ const EconomicOverview = ({ data }: EconomicOverviewProps) => {
|
||||
<Card>
|
||||
<CardHeader
|
||||
title={t('cards.economicOverview')}
|
||||
subheader='Costs & ROI'
|
||||
action={<OptionMenu options={['Export PDF', 'Export Excel', 'Details']} />}
|
||||
subheader={t('subheaders.costsAndRoi')}
|
||||
action={<OptionMenu options={[t('optionMenu.exportPdf'), t('optionMenu.exportExcel'), t('optionMenu.details')]} />}
|
||||
/>
|
||||
<CardContent className='flex flex-col gap-4'>
|
||||
{economicData.length > 0 && (
|
||||
|
||||
Reference in New Issue
Block a user