From ecae5f76f7f7fc895eff28f1363695858c6ff873 Mon Sep 17 00:00:00 2001 From: MellyGray Date: Thu, 26 Oct 2023 12:18:26 +0200 Subject: [PATCH] feat(DownloadFiles): add translations --- public/locales/en/files.json | 7 +++++++ .../download-files/DownloadFilesButton.tsx | 10 ++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/public/locales/en/files.json b/public/locales/en/files.json index 6c7e8dfa1..662cbbfb6 100644 --- a/public/locales/en/files.json +++ b/public/locales/en/files.json @@ -120,6 +120,13 @@ "provenance": "Provenance", "delete": "Delete" } + }, + "downloadFiles": { + "title": "Download", + "options": { + "original": "Original Format", + "archival": "Archival Format (.tab)" + } } }, "requestAccess": { diff --git a/src/sections/dataset/dataset-files/files-table/file-actions/download-files/DownloadFilesButton.tsx b/src/sections/dataset/dataset-files/files-table/file-actions/download-files/DownloadFilesButton.tsx index 68ae0dccd..e6595a578 100644 --- a/src/sections/dataset/dataset-files/files-table/file-actions/download-files/DownloadFilesButton.tsx +++ b/src/sections/dataset/dataset-files/files-table/file-actions/download-files/DownloadFilesButton.tsx @@ -3,6 +3,7 @@ import { useDataset } from '../../../../DatasetContext' import { Button, DropdownButton, DropdownButtonItem } from '@iqss/dataverse-design-system' import { Download } from 'react-bootstrap-icons' import styles from './DownloadFilesButton.module.scss' +import { useTranslation } from 'react-i18next' interface DownloadFilesButtonProps { files: File[] @@ -10,6 +11,7 @@ interface DownloadFilesButtonProps { const MINIMUM_FILES_COUNT_TO_SHOW_DOWNLOAD_FILES_BUTTON = 1 export function DownloadFilesButton({ files }: DownloadFilesButtonProps) { + const { t } = useTranslation('files') const { dataset } = useDataset() if ( @@ -24,18 +26,18 @@ export function DownloadFilesButton({ files }: DownloadFilesButtonProps) { } - title="Download" + title={t('actions.downloadFiles.title')} variant="secondary" withSpacing> - Original Format - Archival Format (.tab) + {t('actions.downloadFiles.options.original')} + {t('actions.downloadFiles.options.archival')} ) } return ( ) }