Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/app/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@
},
"fileCount_one": "{{count}} Datei",
"fileCount_other": "{{count}} Dateien",
"fileCountMoreThan1000": "Mehr als 1000 Dateien"
"fileCountMoreThan": "{{count}}+ Dateien"
},
"versionHistory": {
"title": "Versionsverlauf",
Expand Down
2 changes: 1 addition & 1 deletion src/app/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@
},
"fileCount_one": "{{count}} file",
"fileCount_other": "{{count}} files",
"fileCountMoreThan1000": "1000+ files"
"fileCountMoreThan": "{{count}}+ files"
},
"versionHistory": {
"title": "Version history",
Expand Down
2 changes: 1 addition & 1 deletion src/app/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@
},
"fileCount_one": "{{count}} archivo",
"fileCount_other": "{{count}} archivos",
"fileCountMoreThan1000": "Más de 1000 archivos"
"fileCountMoreThan": "{{count}}+ archivos"
},
"versionHistory": {
"title": "Historial de versiones",
Expand Down
2 changes: 1 addition & 1 deletion src/app/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@
},
"fileCount_one": "{{count}} fichier",
"fileCount_other": "{{count}} fichiers",
"fileCountMoreThan1000": "Plus de 1000 fichiers"
"fileCountMoreThan": "{{count}}+ fichiers"
},
"versionHistory": {
"title": "Historique des versions",
Expand Down
2 changes: 1 addition & 1 deletion src/app/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@
},
"fileCount_one": "{{count}} file",
"fileCount_other": "{{count}} file",
"fileCountMoreThan1000": "Più di 1000 file"
"fileCountMoreThan": "{{count}}+ file"
},
"versionHistory": {
"title": "Cronologia versioni",
Expand Down
2 changes: 1 addition & 1 deletion src/app/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@
"fileCount_few": "{{count}} файла",
"fileCount_many": "{{count}} файлов",
"fileCount_other": "{{count}} файлов",
"fileCountMoreThan1000": "Более 1000 файлов"
"fileCountMoreThan": "{{count}}+ файлов"
},
"versionHistory": {
"title": "История версий",
Expand Down
2 changes: 1 addition & 1 deletion src/app/i18n/locales/tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@
},
"fileCount_one": "{{count}} 個文件",
"fileCount_other": "{{count}} 個文件",
"fileCountMoreThan1000": "超過 1000 個文件"
"fileCountMoreThan": "{{count}}+ 個文件"
},
"versionHistory": {
"title": "版本歷史",
Expand Down
2 changes: 1 addition & 1 deletion src/app/i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@
},
"fileCount_one": "{{count}} 个文件",
"fileCount_other": "{{count}} 个文件",
"fileCountMoreThan1000": "超过 1000 个文件"
"fileCountMoreThan": "{{count}}+ 个文件"
},
"versionHistory": {
"title": "版本历史",
Expand Down
Loading