Skip to content

Commit e3e1350

Browse files
Davy-cRokt33r
authored andcommitted
attachments page
1 parent 19699c5 commit e3e1350

4 files changed

Lines changed: 39 additions & 14 deletions

File tree

src/cloud/lib/i18n/enUS.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,12 @@ const enTranslation: TranslationSource = {
324324
[lngKeys.OpenInBrowser]: 'Open in browser',
325325
[lngKeys.GeneralPickYourDestination]: 'Pick your destination',
326326

327+
[lngKeys.AttachmentsDeleteDisclaimer]:
328+
"Are you sure to delete this file? It won't be visible in your document anymore.",
329+
[lngKeys.AttachmentsLimitDisclaimer]: '{{current}} of {{limit}} used.',
330+
[lngKeys.AttachmentsPlanUpgradeDisclaimer]: 'If you need more space, please',
331+
[lngKeys.AttachmentsUpgradeLink]: 'upgrade your plan.',
332+
327333
[lngKeys.DocInfo]: 'Doc Info',
328334
[lngKeys.Assignees]: 'Assignees',
329335
[lngKeys.Unassigned]: 'Unassigned',

src/cloud/lib/i18n/fr.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,13 @@ const frTranslation: TranslationSource = {
276276
[lngKeys.ModalsSmartFolderPublicDisclaimer]:
277277
'Ce dossier intelligent va devenir publique. Tous les membres pourront le voir.',
278278

279+
[lngKeys.AttachmentsDeleteDisclaimer]:
280+
'Êtes vous certain de vouloir supprimer ce fichier? Il ne sera plus visible dans les documents où il a été inclus.',
281+
[lngKeys.AttachmentsLimitDisclaimer]: '{{current}} sur {{limit}} utilisé.',
282+
[lngKeys.AttachmentsPlanUpgradeDisclaimer]:
283+
"Si vous voulez plus d'espace de stockage, veuillez ",
284+
[lngKeys.AttachmentsUpgradeLink]: 'upgrader votre plan.',
285+
279286
[lngKeys.EditorToolbarTooltipHeader]: 'Ajouter un entête',
280287
[lngKeys.EditorToolbarTooltipAdmonition]: 'Ajouter une admonition',
281288
[lngKeys.EditorToolbarTooltipCodefence]: 'Insérér une codefence',

src/cloud/lib/i18n/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,11 @@ export enum lngKeys {
307307
ModalsWorkspacesWhoHasAcess = 'modals.workspaces.access.who',
308308
ModalsWorkspacesNonOwnerDisclaimer = 'modals.workspaces.access.nonowner',
309309

310+
AttachmentsDeleteDisclaimer = 'attachments.delete.disclaimer',
311+
AttachmentsLimitDisclaimer = 'attachments.limit.disclaimer',
312+
AttachmentsPlanUpgradeDisclaimer = 'attachments.upgrade.disclaimer',
313+
AttachmentsUpgradeLink = 'attachments.upgrade.link',
314+
310315
ModalsImportDestinationTitle = 'modals.import.destination.title',
311316
ModalsImportDestinationDisclaimer = 'modals.import.destination.disclaimer',
312317
ModalsImportDisclaimer = 'modals.import.disclaimer',

src/cloud/pages/[teamId]/uploads.tsx

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import {
2222
proPlanStorageMb,
2323
standardPlanStorageMb,
2424
} from '../../lib/subscription'
25+
import { useI18n } from '../../lib/hooks/useI18n'
26+
import { lngKeys } from '../../lib/i18n/types'
2527

2628
const UploadListPage = ({
2729
files,
@@ -34,6 +36,7 @@ const UploadListPage = ({
3436
const { pushApiErrorMessage } = useToast()
3537
const { subscription, permissions, currentUserIsCoreMember } = usePage()
3638
const { openSettingsTab } = useSettings()
39+
const { translate } = useI18n()
3740

3841
const onDeleteHandler = useCallback(
3942
(team: SerializedTeam, file: SerializedFileInfo) => {
@@ -44,19 +47,19 @@ const UploadListPage = ({
4447
setSending(true)
4548

4649
messageBox({
47-
title: `Cancel?`,
48-
message: `Are you sure to delete this file? It won't be visible in your document anymore.`,
50+
title: translate(lngKeys.GeneralDelete),
51+
message: translate(lngKeys.AttachmentsDeleteDisclaimer),
4952
iconType: DialogIconTypes.Warning,
5053
buttons: [
5154
{
5255
variant: 'secondary',
53-
label: 'Cancel',
56+
label: translate(lngKeys.GeneralCancel),
5457
cancelButton: true,
5558
defaultButton: true,
5659
},
5760
{
5861
variant: 'danger',
59-
label: 'Delete',
62+
label: translate(lngKeys.GeneralDelete),
6063
onClick: async () => {
6164
deleteFile(team, file.name)
6265
.then(() => {
@@ -73,7 +76,7 @@ const UploadListPage = ({
7376
],
7477
})
7578
},
76-
[messageBox, setCurrentFiles, pushApiErrorMessage, sending]
79+
[messageBox, setCurrentFiles, pushApiErrorMessage, sending, translate]
7780
)
7881

7982
return (
@@ -88,17 +91,21 @@ const UploadListPage = ({
8891
{permissions != null && (
8992
<StorageDescription>
9093
<span>
91-
{sizeInMb}MB of{' '}
92-
{subscription == null
93-
? `${freePlanStorageMb}MB `
94-
: subscription.plan === 'standard'
95-
? `${(permissions.length * standardPlanStorageMb) / 1000}GB `
96-
: `${(permissions.length * proPlanStorageMb) / 1000}GB `}
97-
used.{' '}
94+
{translate(lngKeys.AttachmentsLimitDisclaimer, {
95+
current: `${sizeInMb}MB`,
96+
limit:
97+
subscription == null
98+
? `${freePlanStorageMb}MB `
99+
: subscription.plan === 'standard'
100+
? `${
101+
(permissions.length * standardPlanStorageMb) / 1000
102+
}GB `
103+
: `${(permissions.length * proPlanStorageMb) / 1000}GB `,
104+
})}
98105
</span>
99106
{(subscription == null || subscription.plan !== 'pro') && (
100107
<span>
101-
If you need more space, please{' '}
108+
{translate(lngKeys.AttachmentsPlanUpgradeDisclaimer)}{' '}
102109
<a
103110
className='upgrade-link'
104111
href='#'
@@ -107,7 +114,7 @@ const UploadListPage = ({
107114
openSettingsTab('teamUpgrade')
108115
}}
109116
>
110-
upgrade your plan.
117+
{translate(lngKeys.AttachmentsUpgradeLink)}
111118
</a>
112119
</span>
113120
)}

0 commit comments

Comments
 (0)