chore: improve added to album messages (#29641)
This commit is contained in:
@@ -593,6 +593,7 @@
|
|||||||
"asset_viewer_settings_title": "Asset Viewer",
|
"asset_viewer_settings_title": "Asset Viewer",
|
||||||
"assets": "Assets",
|
"assets": "Assets",
|
||||||
"assets_added_to_album_count": "Added {count, plural, one {# asset} other {# assets}} to the album",
|
"assets_added_to_album_count": "Added {count, plural, one {# asset} other {# assets}} to the album",
|
||||||
|
"assets_added_to_album_partial_count": "Added {successCount} out of {totalCount} {totalCount, plural, one {asset} other {assets}} to the album",
|
||||||
"assets_added_to_albums_count": "Added {assetTotal, plural, one {# asset} other {# assets}} to {albumTotal, plural, one {# album} other {# albums}}",
|
"assets_added_to_albums_count": "Added {assetTotal, plural, one {# asset} other {# assets}} to {albumTotal, plural, one {# album} other {# albums}}",
|
||||||
"assets_cannot_be_added_to_album_count": "{count, plural, one {Asset} other {Assets}} cannot be added to the album",
|
"assets_cannot_be_added_to_album_count": "{count, plural, one {Asset} other {Assets}} cannot be added to the album",
|
||||||
"assets_cannot_be_added_to_albums": "{count, plural, one {Asset} other {Assets}} cannot be added to any of the albums",
|
"assets_cannot_be_added_to_albums": "{count, plural, one {Asset} other {Assets}} cannot be added to any of the albums",
|
||||||
|
|||||||
@@ -134,10 +134,13 @@ const notifyAddToAlbum = ($t: MessageFormatter, albumId: string, assetIds: strin
|
|||||||
const successCount = results.filter(({ success }) => success).length;
|
const successCount = results.filter(({ success }) => success).length;
|
||||||
const duplicateCount = results.filter(({ error }) => error === 'duplicate').length;
|
const duplicateCount = results.filter(({ error }) => error === 'duplicate').length;
|
||||||
let description = $t('assets_cannot_be_added_to_album_count', { values: { count: assetIds.length } });
|
let description = $t('assets_cannot_be_added_to_album_count', { values: { count: assetIds.length } });
|
||||||
if (successCount > 0) {
|
|
||||||
description = $t('assets_added_to_album_count', { values: { count: successCount } });
|
if (duplicateCount === assetIds.length) {
|
||||||
} else if (duplicateCount > 0) {
|
|
||||||
description = $t('assets_were_part_of_album_count', { values: { count: duplicateCount } });
|
description = $t('assets_were_part_of_album_count', { values: { count: duplicateCount } });
|
||||||
|
} else if (successCount === assetIds.length) {
|
||||||
|
description = $t('assets_added_to_album_count', { values: { count: successCount } });
|
||||||
|
} else if (successCount > 0) {
|
||||||
|
description = $t('assets_added_to_album_partial_count', { values: { successCount, totalCount: assetIds.length } });
|
||||||
}
|
}
|
||||||
|
|
||||||
toastManager.primary(
|
toastManager.primary(
|
||||||
|
|||||||
Reference in New Issue
Block a user