diff --git a/frontend/src/components/Common/ReportDialog/index.tsx b/frontend/src/components/Common/ReportDialog/index.tsx index d3ee6776c..0bbd16566 100644 --- a/frontend/src/components/Common/ReportDialog/index.tsx +++ b/frontend/src/components/Common/ReportDialog/index.tsx @@ -103,7 +103,6 @@ const ReportDialog = memo( showToolbar={false} > +// Register all the fonts necessary +Font.register({ + family: 'Roboto', + src: RobotoFont, +}); + +Font.register({ + family: 'Khmer', + src: KhmerFont, +}); + +const makeStyles = (theme: Theme, selectedLanguage: string) => StyleSheet.create({ page: { flexDirection: 'column', backgroundColor: '#FFF', paddingBottom: 25, paddingTop: '1vh', - fontFamily: 'Roboto', + fontFamily: getReportFontFamily(selectedLanguage), }, section: { width: '96vw', @@ -83,11 +98,12 @@ const ReportDoc = memo( reportTitle, reportConfig, exposureLegendDefinition, - t, tableData, columns, }: ReportDocProps) => { - const styles = makeStyles(theme); + const { t, i18n } = useSafeTranslation(); + + const styles = makeStyles(theme, i18n.language); const date = useMemo(() => { return new Date().toUTCString(); @@ -272,7 +288,6 @@ interface ReportDocProps { reportConfig: ReportType; tableShowTotal: boolean; exposureLegendDefinition: LegendDefinition; - t: TFunction; tableData: AnalysisTableRow[]; columns: Column[]; } diff --git a/frontend/src/components/Common/ReportDialog/utils.ts b/frontend/src/components/Common/ReportDialog/utils.ts new file mode 100644 index 000000000..c2b248d9b --- /dev/null +++ b/frontend/src/components/Common/ReportDialog/utils.ts @@ -0,0 +1,8 @@ +export const getReportFontFamily = (selectedLanguage: string): string => { + switch (selectedLanguage) { + case 'kh': + return 'Khmer'; + default: + return 'Roboto'; + } +}; diff --git a/frontend/src/components/MapView/FoldButton/index.tsx b/frontend/src/components/MapView/FoldButton/index.tsx index 224f5798a..a60fddecc 100644 --- a/frontend/src/components/MapView/FoldButton/index.tsx +++ b/frontend/src/components/MapView/FoldButton/index.tsx @@ -69,6 +69,7 @@ const FoldButton = ({ horizontal: 'right', vertical: 'top', }} + overlap="rectangular" badgeContent={badgeContent} color="secondary" > diff --git a/frontend/src/components/MapView/LeftPanel/AnalysisPanel/AnalysisTable/ExposureAnalysisTable/index.tsx b/frontend/src/components/MapView/LeftPanel/AnalysisPanel/AnalysisTable/ExposureAnalysisTable/index.tsx index 86c067f2d..2aba8dd91 100644 --- a/frontend/src/components/MapView/LeftPanel/AnalysisPanel/AnalysisTable/ExposureAnalysisTable/index.tsx +++ b/frontend/src/components/MapView/LeftPanel/AnalysisPanel/AnalysisTable/ExposureAnalysisTable/index.tsx @@ -197,7 +197,7 @@ const ExposureAnalysisTable = memo( rowsPerPage={rowsPerPage} page={page} onPageChange={handleChangePage} - onChangeRowsPerPage={handleChangeRowsPerPage} + onRowsPerPageChange={handleChangeRowsPerPage} labelRowsPerPage={t('Rows Per Page')} // Temporary manual translation before we upgrade to MUI 5. labelDisplayedRows={({ from, to, count }) => { diff --git a/frontend/src/components/MapView/LeftPanel/AnalysisPanel/AnalysisTable/index.tsx b/frontend/src/components/MapView/LeftPanel/AnalysisPanel/AnalysisTable/index.tsx index 408e7d1d5..1b2d25881 100644 --- a/frontend/src/components/MapView/LeftPanel/AnalysisPanel/AnalysisTable/index.tsx +++ b/frontend/src/components/MapView/LeftPanel/AnalysisPanel/AnalysisTable/index.tsx @@ -196,7 +196,7 @@ const AnalysisTable = memo( rowsPerPage={rowsPerPage} page={page} onPageChange={handleChangePage} - onChangeRowsPerPage={handleChangeRowsPerPage} + onRowsPerPageChange={handleChangeRowsPerPage} labelRowsPerPage={t('Rows Per Page')} // Temporary manual translation before we upgrade to MUI 5. labelDisplayedRows={({ from, to, count }) => { diff --git a/frontend/src/components/MapView/LeftPanel/LeftPanelTabs/index.tsx b/frontend/src/components/MapView/LeftPanel/LeftPanelTabs/index.tsx index 3420f6eaf..d4c639373 100644 --- a/frontend/src/components/MapView/LeftPanel/LeftPanelTabs/index.tsx +++ b/frontend/src/components/MapView/LeftPanel/LeftPanelTabs/index.tsx @@ -129,6 +129,7 @@ const LeftPanelTabs = memo( horizontal: 'left', vertical: 'top', }} + overlap="rectangular" badgeContent={layersBadgeContent} color="secondary" > diff --git a/frontend/src/components/MapView/LeftPanel/TablesPanel/DataTable/index.tsx b/frontend/src/components/MapView/LeftPanel/TablesPanel/DataTable/index.tsx index eb3ab13c7..e06cab61f 100644 --- a/frontend/src/components/MapView/LeftPanel/TablesPanel/DataTable/index.tsx +++ b/frontend/src/components/MapView/LeftPanel/TablesPanel/DataTable/index.tsx @@ -209,7 +209,7 @@ const DataTable = memo( rowsPerPage={rowsPerPage} page={page} onPageChange={handleChangePage} - onChangeRowsPerPage={handleChangeRowsPerPage} + onRowsPerPageChange={handleChangeRowsPerPage} labelRowsPerPage={t('Rows Per Page')} // Temporary manual translation before we upgrade to MUI 5. labelDisplayedRows={({ from, to, count }) => { diff --git a/frontend/src/fonts/Khmer-Regular.ttf b/frontend/src/fonts/Khmer-Regular.ttf new file mode 100644 index 000000000..32329239e Binary files /dev/null and b/frontend/src/fonts/Khmer-Regular.ttf differ diff --git a/frontend/src/fonts/Roboto-Regular.ttf b/frontend/src/fonts/Roboto-Regular.ttf new file mode 100644 index 000000000..ddf4bfacb Binary files /dev/null and b/frontend/src/fonts/Roboto-Regular.ttf differ diff --git a/frontend/src/types/custom.d.ts b/frontend/src/types/custom.d.ts index 01a611efc..4ce95f992 100644 --- a/frontend/src/types/custom.d.ts +++ b/frontend/src/types/custom.d.ts @@ -25,3 +25,5 @@ declare module 'prism-common'; declare module 'zonal'; declare module 'redux-async-initial-state'; + +declare module '*.ttf';