-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(DatasetFiles): add internationalization
- Loading branch information
Showing
12 changed files
with
86 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,34 @@ | ||
{ | ||
"metadataReleased": "Metadata Released", | ||
"published": "Published", | ||
"deposited": "Deposited", | ||
"embargoedWillBeUntil": "Draft: will be embargoed until", | ||
"embargoedUntil": "Embargoed until", | ||
"embargoedWasThrough": "Was embargoed until" | ||
"filesLoading": "Files loading spinner symbol", | ||
"table": { | ||
"pagination": { | ||
"pageSize": "Files per page" | ||
}, | ||
"tabularData": { | ||
"variables": "Variables", | ||
"observations": "Observations" | ||
}, | ||
"embargoDate": { | ||
"embargoedWillBeUntil": "Draft: will be embargoed until", | ||
"embargoedUntil": "Embargoed until", | ||
"embargoedWasThrough": "Was embargoed until" | ||
}, | ||
"downloads": "Downloads", | ||
"date": { | ||
"metadataReleased": "Metadata Released", | ||
"published": "Published", | ||
"deposited": "Deposited" | ||
}, | ||
"thumbnail": { | ||
"restricted": { | ||
"locked": "Locked File Icon", | ||
"unlocked": "Unlocked File Icon" | ||
} | ||
}, | ||
"copyToClipboard": { | ||
"clickToCopy": "Click to copy", | ||
"correctlyCopiedIcon": "Correctly copied to clipboard icon", | ||
"copyToClipboardIcon": "Copy to clipboard icon" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
src/sections/dataset/dataset-files/files-table/file-info-cell/FileDownloads.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
import { FileStatus } from '../../../../../files/domain/models/File' | ||
import { useTranslation } from 'react-i18next' | ||
|
||
interface FileDownloadsProps { | ||
downloads: number | ||
status: FileStatus | ||
} | ||
export function FileDownloads({ downloads, status }: FileDownloadsProps) { | ||
const { t } = useTranslation('files') | ||
if (status !== FileStatus.RELEASED) { | ||
return <></> | ||
} | ||
|
||
return ( | ||
<div> | ||
<span>{downloads} Downloads</span> | ||
<span> | ||
{downloads} {t('table.downloads')} | ||
</span> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
src/sections/dataset/dataset-files/files-table/file-info-cell/FileTabularData.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,21 @@ | ||
import { FileTabularData as FileTabularDataModel } from '../../../../../files/domain/models/File' | ||
import { CopyToClipboardButton } from './copy-to-clipboard-button/CopyToClipboardButton' | ||
import { useTranslation } from 'react-i18next' | ||
|
||
export function FileTabularData({ | ||
tabularData | ||
}: { | ||
tabularData: FileTabularDataModel | undefined | ||
}) { | ||
const { t } = useTranslation('files') | ||
if (!tabularData) { | ||
return <></> | ||
} | ||
return ( | ||
<div> | ||
{tabularData.variablesCount} Variables, {tabularData.observationsCount} Observations{' '} | ||
{tabularData.unf} <CopyToClipboardButton text={tabularData.unf} /> | ||
{tabularData.variablesCount} {t('table.tabularData.variables')},{' '} | ||
{tabularData.observationsCount} {t('table.tabularData.observations')} {tabularData.unf}{' '} | ||
<CopyToClipboardButton text={tabularData.unf} /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 12 additions & 2 deletions
14
...t/dataset-files/files-table/file-info-cell/file-thumbnail/FileThumbnailRestrictedIcon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
import { Lock, Unlock } from 'react-bootstrap-icons' | ||
import styles from './FileThumbnail.module.scss' | ||
import { useTranslation } from 'react-i18next' | ||
|
||
export function FileThumbnailRestrictedIcon({ locked }: { locked: boolean }) { | ||
const { t } = useTranslation('files') | ||
if (locked) { | ||
return ( | ||
<div> | ||
<Lock className={styles.thumbnail__locked} role="img" title="Locked File Icon" /> | ||
<Lock | ||
className={styles.thumbnail__locked} | ||
role="img" | ||
title={t('table.thumbnail.restricted.locked')} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
return ( | ||
<div> | ||
<Unlock className={styles.thumbnail__unlocked} role="img" title="Unlocked File Icon" /> | ||
<Unlock | ||
className={styles.thumbnail__unlocked} | ||
role="img" | ||
title={t('table.thumbnail.restricted.unlocked')} | ||
/> | ||
</div> | ||
) | ||
} |
3 changes: 3 additions & 0 deletions
3
src/sections/dataset/dataset-files/files-table/spinner-symbol/SpinnerSymbol.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.container { | ||
justify-content: center; | ||
} |
7 changes: 5 additions & 2 deletions
7
...s/dataset/dataset-files/SpinnerSymbol.tsx → ...es-table/spinner-symbol/SpinnerSymbol.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters