From d19a7499032e15a380e1f9f7f64974bf682f432f Mon Sep 17 00:00:00 2001 From: waclaw66 Date: Thu, 2 Jan 2025 17:19:55 +0100 Subject: [PATCH] fix(mobile): album tile translation and consolidation with card appereance (#15032) fix(mobile): album tile translation and consolidation with card Co-authored-by: Alex --- mobile/lib/pages/albums/albums.page.dart | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/mobile/lib/pages/albums/albums.page.dart b/mobile/lib/pages/albums/albums.page.dart index 6f7d99b727..ac6bd2f2fb 100644 --- a/mobile/lib/pages/albums/albums.page.dart +++ b/mobile/lib/pages/albums/albums.page.dart @@ -255,9 +255,13 @@ class AlbumsPage extends HookConsumerWidget { fontWeight: FontWeight.w600, ), ), - subtitle: sorted[index].ownerId == userId + subtitle: sorted[index].ownerId != null ? Text( - '${sorted[index].assetCount} items', + '${(sorted[index].assetCount == 1 ? 'album_thumbnail_card_item'.tr( + args: ['${sorted[index].assetCount}'], + ) : 'album_thumbnail_card_items'.tr( + args: ['${sorted[index].assetCount}'], + ))} • ${sorted[index].ownerId != userId ? 'album_thumbnail_shared_by'.tr(args: [sorted[index].ownerName!]) : 'album_thumbnail_owned'.tr()}', overflow: TextOverflow.ellipsis, style: context.textTheme.bodyMedium?.copyWith( @@ -265,21 +269,7 @@ class AlbumsPage extends HookConsumerWidget { .colorScheme.onSurfaceSecondary, ), ) - : sorted[index].ownerName != null - ? Text( - '${sorted[index].assetCount} items • ${'album_thumbnail_shared_by'.tr( - args: [ - sorted[index].ownerName!, - ], - )}', - overflow: TextOverflow.ellipsis, - style: context.textTheme.bodyMedium - ?.copyWith( - color: context - .colorScheme.onSurfaceSecondary, - ), - ) - : null, + : null, onTap: () => context.pushRoute( AlbumViewerRoute(albumId: sorted[index].id), ),