feat(webui): translate formatCount in file-browser and add plural keys

This commit is contained in:
yiling
2026-06-27 14:45:30 +08:00
parent 7182c00c7d
commit fb63d8b7b6
13 changed files with 215 additions and 5 deletions
@@ -566,9 +566,13 @@ export function FileBrowser({
(c) => c.field === 'name' && c.operator === 'contains',
)
if (isNameFilter && count === 10001) {
return `10000+ ${isFile ? 'Asset' : 'Folder'}s`
return isFile ? m.count_overflow_assets() : m.count_overflow_folders()
}
if (isFile) {
return count === 1 ? m.n_assets_singular({ count }) : m.n_assets_plural({ count })
} else {
return count === 1 ? m.n_folders_singular({ count }) : m.n_folders_plural({ count })
}
return `${count} ${isFile ? 'Asset' : 'Folder'}${count !== 1 ? 's' : ''}`
}
const handleEmptyAreaClick = (e: React.MouseEvent) => {