Skip to content

Commit

Permalink
i18n: missing translations for chart management
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Dec 6, 2024
1 parent dc825bd commit 41dfda5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
12 changes: 8 additions & 4 deletions src/js/components/Overview/Drawer/ManageChartsDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ import ChartTree from './ChartTree';

import type { ChartDataField } from '@/types/data';
import { useAppSelector, useAppDispatch, useTranslationFn } from '@/hooks';
import { useSmallScreen } from '@/hooks/useResponsiveContext';
import { hideAllSectionCharts, setAllDisplayedCharts, resetLayout } from '@/features/data/data.store';

const ManageChartsDrawer = ({ onManageDrawerClose, manageDrawerVisible }: ManageChartsDrawerProps) => {
const t = useTranslationFn();

const dispatch = useAppDispatch();

const isSmallScreen = useSmallScreen();

const { sections } = useAppSelector((state) => state.data);

return (
Expand All @@ -21,6 +24,7 @@ const ManageChartsDrawer = ({ onManageDrawerClose, manageDrawerVisible }: Manage
placement="right"
onClose={onManageDrawerClose}
open={manageDrawerVisible}
width={isSmallScreen ? '100vw' : 400}
extra={
<Space>
<Button
Expand All @@ -29,15 +33,15 @@ const ManageChartsDrawer = ({ onManageDrawerClose, manageDrawerVisible }: Manage
dispatch(setAllDisplayedCharts({}));
}}
>
Show All
{t('Show All')}
</Button>
<Button
size="small"
onClick={() => {
dispatch(resetLayout());
}}
>
Reset
{t('Reset')}
</Button>
</Space>
}
Expand All @@ -55,15 +59,15 @@ const ManageChartsDrawer = ({ onManageDrawerClose, manageDrawerVisible }: Manage
dispatch(setAllDisplayedCharts({ section: sectionTitle }));
}}
>
Show All
{t('Show All')}
</Button>
<Button
size="small"
onClick={() => {
dispatch(hideAllSectionCharts({ section: sectionTitle }));
}}
>
Hide All
{t('Hide All')}
</Button>
</Space>
</Flex>
Expand Down
4 changes: 2 additions & 2 deletions src/js/components/Overview/PublicOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ABOUT_CARD_STYLE = { width: '100%', maxWidth: '1390px', borderRadius: '11p
const MANAGE_CHARTS_BUTTON_STYLE = { right: '5em', bottom: '1.5em', transform: 'scale(125%)' };

const PublicOverview = () => {
const { i18n } = useTranslation();
const { i18n, t } = useTranslation();

const [drawerVisible, setDrawerVisible] = useState(false);
const [aboutContent, setAboutContent] = useState('');
Expand Down Expand Up @@ -105,7 +105,7 @@ const PublicOverview = () => {
<FloatButton
type="primary"
icon={<AppstoreAddOutlined rotate={270} />}
tooltip="Manage Charts"
tooltip={t('Manage Charts')}
style={MANAGE_CHARTS_BUTTON_STYLE}
onClick={onManageChartsOpen}
/>
Expand Down
3 changes: 3 additions & 0 deletions src/public/locales/en/default_translation_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
"Download DATS File": "Download DATS File",
"Charts": "Charts",
"Manage Charts": "Manage Charts",
"Show All": "Show All",
"Reset": "Reset",
"Hide All": "Hide All",
"Remove this chart": "Remove this chart",
"Width": "Width",
"Insufficient data available.": "Insufficient data available.",
Expand Down
3 changes: 3 additions & 0 deletions src/public/locales/fr/default_translation_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
"Download DATS File": "Télécharcher le fichier DATS",
"Charts": "Tableaux",
"Manage Charts": "Gestion des tableaux",
"Show All": "Aff. tous",
"Reset": "Réinit.",
"Hide All": "Cacher tous",
"Remove this chart": "Supprimer ce tableau",
"Width": "Largeur",
"Insufficient data available.": "Pas suffisamment de données.",
Expand Down

0 comments on commit 41dfda5

Please sign in to comment.