From 5fdc528ac81419348b5d370f324df89b1fd0d1d8 Mon Sep 17 00:00:00 2001 From: Francis Terrero Date: Mon, 23 Mar 2026 14:58:28 -0400 Subject: [PATCH] fix: show approximate file count with '+' suffix when exact count is unavailable --- .../ItemDetailsDialog/ItemDetailsDialog.tsx | 12 +++++------- src/app/i18n/locales/de.json | 2 +- src/app/i18n/locales/en.json | 2 +- src/app/i18n/locales/es.json | 2 +- src/app/i18n/locales/fr.json | 2 +- src/app/i18n/locales/it.json | 2 +- src/app/i18n/locales/ru.json | 2 +- src/app/i18n/locales/tw.json | 2 +- src/app/i18n/locales/zh.json | 2 +- 9 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/app/drive/components/ItemDetailsDialog/ItemDetailsDialog.tsx b/src/app/drive/components/ItemDetailsDialog/ItemDetailsDialog.tsx index 531ab76d9..1c8686421 100644 --- a/src/app/drive/components/ItemDetailsDialog/ItemDetailsDialog.tsx +++ b/src/app/drive/components/ItemDetailsDialog/ItemDetailsDialog.tsx @@ -142,12 +142,10 @@ const ItemDetailsDialog = ({ onClose(); }; - const MAX_DISPLAYABLE_FILE_COUNT = 1000; - - const formatFileCount = (count: number | undefined) => { - if (count === undefined) return undefined; - if (count > MAX_DISPLAYABLE_FILE_COUNT) return translate('modals.itemDetailsModal.fileCountMoreThan1000'); - return translate('modals.itemDetailsModal.fileCount', { count }); + const formatFileCount = (folderStats?: FolderStatsResponse) => { + if (folderStats?.fileCount === undefined) return undefined; + const key = folderStats.isFileCountExact ? 'fileCount' : 'fileCountMoreThan'; + return translate(`modals.itemDetailsModal.${key}`, { count: folderStats.fileCount }); }; const getFolderStats = (item: DriveItemDetails, itemUuid: string) => { @@ -205,7 +203,7 @@ const ItemDetailsDialog = ({ name: item.name, shared: isShared, type: item.isFolder ? undefined : item.type, - numberOfFiles: item.isFolder ? formatFileCount(folderStats?.fileCount) : undefined, + numberOfFiles: item.isFolder ? formatFileCount(folderStats) : undefined, size, uploaded, modified, diff --git a/src/app/i18n/locales/de.json b/src/app/i18n/locales/de.json index 66c5aaada..18f3ec5dd 100644 --- a/src/app/i18n/locales/de.json +++ b/src/app/i18n/locales/de.json @@ -798,7 +798,7 @@ }, "fileCount_one": "{{count}} Datei", "fileCount_other": "{{count}} Dateien", - "fileCountMoreThan1000": "Mehr als 1000 Dateien" + "fileCountMoreThan": "{{count}}+ Dateien" }, "versionHistory": { "title": "Versionsverlauf", diff --git a/src/app/i18n/locales/en.json b/src/app/i18n/locales/en.json index 89bcd522a..a6f536cf1 100644 --- a/src/app/i18n/locales/en.json +++ b/src/app/i18n/locales/en.json @@ -895,7 +895,7 @@ }, "fileCount_one": "{{count}} file", "fileCount_other": "{{count}} files", - "fileCountMoreThan1000": "1000+ files" + "fileCountMoreThan": "{{count}}+ files" }, "versionHistory": { "title": "Version history", diff --git a/src/app/i18n/locales/es.json b/src/app/i18n/locales/es.json index 834472e05..c9803606e 100644 --- a/src/app/i18n/locales/es.json +++ b/src/app/i18n/locales/es.json @@ -877,7 +877,7 @@ }, "fileCount_one": "{{count}} archivo", "fileCount_other": "{{count}} archivos", - "fileCountMoreThan1000": "Más de 1000 archivos" + "fileCountMoreThan": "{{count}}+ archivos" }, "versionHistory": { "title": "Historial de versiones", diff --git a/src/app/i18n/locales/fr.json b/src/app/i18n/locales/fr.json index a9f6368d4..ebf806c13 100644 --- a/src/app/i18n/locales/fr.json +++ b/src/app/i18n/locales/fr.json @@ -819,7 +819,7 @@ }, "fileCount_one": "{{count}} fichier", "fileCount_other": "{{count}} fichiers", - "fileCountMoreThan1000": "Plus de 1000 fichiers" + "fileCountMoreThan": "{{count}}+ fichiers" }, "versionHistory": { "title": "Historique des versions", diff --git a/src/app/i18n/locales/it.json b/src/app/i18n/locales/it.json index d8ba68ecc..9c6f46421 100644 --- a/src/app/i18n/locales/it.json +++ b/src/app/i18n/locales/it.json @@ -931,7 +931,7 @@ }, "fileCount_one": "{{count}} file", "fileCount_other": "{{count}} file", - "fileCountMoreThan1000": "Più di 1000 file" + "fileCountMoreThan": "{{count}}+ file" }, "versionHistory": { "title": "Cronologia versioni", diff --git a/src/app/i18n/locales/ru.json b/src/app/i18n/locales/ru.json index 7520b6809..7214ce240 100644 --- a/src/app/i18n/locales/ru.json +++ b/src/app/i18n/locales/ru.json @@ -840,7 +840,7 @@ "fileCount_few": "{{count}} файла", "fileCount_many": "{{count}} файлов", "fileCount_other": "{{count}} файлов", - "fileCountMoreThan1000": "Более 1000 файлов" + "fileCountMoreThan": "{{count}}+ файлов" }, "versionHistory": { "title": "История версий", diff --git a/src/app/i18n/locales/tw.json b/src/app/i18n/locales/tw.json index 80f751afb..c1948e7be 100644 --- a/src/app/i18n/locales/tw.json +++ b/src/app/i18n/locales/tw.json @@ -825,7 +825,7 @@ }, "fileCount_one": "{{count}} 個文件", "fileCount_other": "{{count}} 個文件", - "fileCountMoreThan1000": "超過 1000 個文件" + "fileCountMoreThan": "{{count}}+ 個文件" }, "versionHistory": { "title": "版本歷史", diff --git a/src/app/i18n/locales/zh.json b/src/app/i18n/locales/zh.json index c62191324..bc938c6a1 100644 --- a/src/app/i18n/locales/zh.json +++ b/src/app/i18n/locales/zh.json @@ -861,7 +861,7 @@ }, "fileCount_one": "{{count}} 个文件", "fileCount_other": "{{count}} 个文件", - "fileCountMoreThan1000": "超过 1000 个文件" + "fileCountMoreThan": "{{count}}+ 个文件" }, "versionHistory": { "title": "版本历史",