π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Replace favorite/unfavorite with important/unimportant
AmanRajSinghMourya6a449b260a1f
diff --git a/mobile/apps/locker/lib/l10n/app_en.arb b/mobile/apps/locker/lib/l10n/app_en.arbindex ac27710c82..19f33b3e76 100644--- a/mobile/apps/locker/lib/l10n/app_en.arb+++ b/mobile/apps/locker/lib/l10n/app_en.arb@@ -851,16 +851,16 @@}}},- "favorite": "Favorite",- "unfavorite": "Unfavorite",- "addingToFavorites": "Adding to Favorites...",- "removingFromFavorites": "Removing from Favorites...",- "markingAsFavorites": "Marking as Favorites...",- "fileMarkedAsFavorite": "Item marked as favorite",- "fileRemovedFromFavorites": "Item removed from favorites",- "filesMarkedAsFavorites": "{count, plural, =1{1 item marked as favorite} other{{count} items marked as favorites}}",- "@filesMarkedAsFavorites": {- "description": "Success message when items are marked as favorites",+ "important": "Important",+ "unimportant": "Unimportant",+ "addingToImportant": "Marking as important...",+ "removingFromImportant": "Removing from important...",+ "markingAsImportant": "Marking as important...",+ "fileMarkedAsImportant": "Item marked as important",+ "fileRemovedFromImportant": "Item removed from important",+ "filesMarkedAsImportant": "{count, plural, =1{1 item marked as important} other{{count} items marked as important}}",+ "@filesMarkedAsImportant": {+ "description": "Success message when items are marked as important","placeholders": {"count": {"type": "int",@@ -868,10 +868,10 @@}}},- "allFilesAlreadyMarkedAsFavorites": "All items are already marked as favorites",- "failedToMarkFilesAsFavorites": "Failed to mark items as favorites: {error}",- "@failedToMarkFilesAsFavorites": {- "description": "Error message when marking items as favorites fails",+ "allFilesAlreadyMarkedAsImportant": "All items are already marked as important",+ "failedToMarkFilesAsImportant": "Failed to mark items as important: {error}",+ "@failedToMarkFilesAsImportant": {+ "description": "Error message when marking items as important fails","placeholders": {"error": {"type": "String",@@ -879,14 +879,17 @@}}},- "failedToUpdateFavoriteStatus": "Failed to update favorite status: {error}",- "@failedToUpdateFavoriteStatus": {- "description": "Error message when updating favorite status fails",+ "failedToUpdateImportantStatus": "Failed to update important status: {error}",+ "@failedToUpdateImportantStatus": {+ "description": "Error message when updating important status fails","placeholders": {"error": {"type": "String","example": "Network error"}}- }+ },+ "sorry": "Sorry",+ "subscribe": "Subscribe",+ "subscriptionRequiredForSharing": "You need a paid subscription to share links"}diff --git a/mobile/apps/locker/lib/l10n/app_localizations.dart b/mobile/apps/locker/lib/l10n/app_localizations.dartindex f2548cf83f..0452dffd5b 100644--- a/mobile/apps/locker/lib/l10n/app_localizations.dart+++ b/mobile/apps/locker/lib/l10n/app_localizations.dart@@ -2518,71 +2518,89 @@ abstract class AppLocalizations {/// **'{used} / {max}'**String fileCount(String used, String max);- /// No description provided for @favorite.+ /// No description provided for @important.////// In en, this message translates to:- /// **'Favorite'**- String get favorite;+ /// **'Important'**+ String get important;- /// No description provided for @unfavorite.+ /// No description provided for @unimportant.////// In en, this message translates to:- /// **'Unfavorite'**- String get unfavorite;+ /// **'Unimportant'**+ String get unimportant;- /// No description provided for @addingToFavorites.+ /// No description provided for @addingToImportant.////// In en, this message translates to:- /// **'Adding to Favorites...'**- String get addingToFavorites;+ /// **'Marking as important...'**+ String get addingToImportant;- /// No description provided for @removingFromFavorites.+ /// No description provided for @removingFromImportant.////// In en, this message translates to:- /// **'Removing from Favorites...'**- String get removingFromFavorites;+ /// **'Removing from important...'**+ String get removingFromImportant;- /// No description provided for @markingAsFavorites.+ /// No description provided for @markingAsImportant.////// In en, this message translates to:- /// **'Marking as Favorites...'**- String get markingAsFavorites;+ /// **'Marking as important...'**+ String get markingAsImportant;- /// No description provided for @fileMarkedAsFavorite.+ /// No description provided for @fileMarkedAsImportant.////// In en, this message translates to:- /// **'Item marked as favorite'**- String get fileMarkedAsFavorite;+ /// **'Item marked as important'**+ String get fileMarkedAsImportant;- /// No description provided for @fileRemovedFromFavorites.+ /// No description provided for @fileRemovedFromImportant.////// In en, this message translates to:- /// **'Item removed from favorites'**- String get fileRemovedFromFavorites;+ /// **'Item removed from important'**+ String get fileRemovedFromImportant;- /// Success message when items are marked as favorites+ /// Success message when items are marked as important////// In en, this message translates to:- /// **'{count, plural, =1{1 item marked as favorite} other{{count} items marked as favorites}}'**- String filesMarkedAsFavorites(int count);+ /// **'{count, plural, =1{1 item marked as important} other{{count} items marked as important}}'**+ String filesMarkedAsImportant(int count);- /// No description provided for @allFilesAlreadyMarkedAsFavorites.+ /// No description provided for @allFilesAlreadyMarkedAsImportant.////// In en, this message translates to:- /// **'All items are already marked as favorites'**- String get allFilesAlreadyMarkedAsFavorites;+ /// **'All items are already marked as important'**+ String get allFilesAlreadyMarkedAsImportant;- /// Error message when marking items as favorites fails+ /// Error message when marking items as important fails////// In en, this message translates to:- /// **'Failed to mark items as favorites: {error}'**- String failedToMarkFilesAsFavorites(String error);+ /// **'Failed to mark items as important: {error}'**+ String failedToMarkFilesAsImportant(String error);- /// Error message when updating favorite status fails+ /// Error message when updating important status fails////// In en, this message translates to:- /// **'Failed to update favorite status: {error}'**- String failedToUpdateFavoriteStatus(String error);+ /// **'Failed to update important status: {error}'**+ String failedToUpdateImportantStatus(String error);++ /// No description provided for @sorry.+ ///+ /// In en, this message translates to:+ /// **'Sorry'**+ String get sorry;++ /// No description provided for @subscribe.+ ///+ /// In en, this message translates to:+ /// **'Subscribe'**+ String get subscribe;++ /// No description provided for @subscriptionRequiredForSharing.+ ///+ /// In en, this message translates to:+ /// **'You need a paid subscription to share links'**+ String get subscriptionRequiredForSharing;}class _AppLocalizationsDelegatediff --git a/mobile/apps/locker/lib/l10n/app_localizations_en.dart b/mobile/apps/locker/lib/l10n/app_localizations_en.dartindex df75585ed7..fa4227d157 100644--- a/mobile/apps/locker/lib/l10n/app_localizations_en.dart+++ b/mobile/apps/locker/lib/l10n/app_localizations_en.dart@@ -1466,48 +1466,58 @@ class AppLocalizationsEn extends AppLocalizations {}@override- String get favorite => 'Favorite';+ String get important => 'Important';@override- String get unfavorite => 'Unfavorite';+ String get unimportant => 'Unimportant';@override- String get addingToFavorites => 'Adding to Favorites...';+ String get addingToImportant => 'Marking as important...';@override- String get removingFromFavorites => 'Removing from Favorites...';+ String get removingFromImportant => 'Removing from important...';@override- String get markingAsFavorites => 'Marking as Favorites...';+ String get markingAsImportant => 'Marking as important...';@override- String get fileMarkedAsFavorite => 'Item marked as favorite';+ String get fileMarkedAsImportant => 'Item marked as important';@override- String get fileRemovedFromFavorites => 'Item removed from favorites';+ String get fileRemovedFromImportant => 'Item removed from important';@override- String filesMarkedAsFavorites(int count) {+ String filesMarkedAsImportant(int count) {String _temp0 = intl.Intl.pluralLogic(count,locale: localeName,- other: '$count items marked as favorites',- one: '1 item marked as favorite',+ other: '$count items marked as important',+ one: '1 item marked as important',);return '$_temp0';}@override- String get allFilesAlreadyMarkedAsFavorites =>- 'All items are already marked as favorites';+ String get allFilesAlreadyMarkedAsImportant =>+ 'All items are already marked as important';@override- String failedToMarkFilesAsFavorites(String error) {- return 'Failed to mark items as favorites: $error';+ String failedToMarkFilesAsImportant(String error) {+ return 'Failed to mark items as important: $error';}@override- String failedToUpdateFavoriteStatus(String error) {- return 'Failed to update favorite status: $error';+ String failedToUpdateImportantStatus(String error) {+ return 'Failed to update important status: $error';}++ @override+ String get sorry => 'Sorry';++ @override+ String get subscribe => 'Subscribe';++ @override+ String get subscriptionRequiredForSharing =>+ 'You need a paid subscription to share links';}diff --git a/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dart b/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dartindex 3366889ebc..95698b13e7 100644--- a/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dart+++ b/mobile/apps/locker/lib/ui/components/file_popup_menu_widget.dart@@ -91,21 +91,23 @@ class FilePopupMenuWidget extends StatelessWidget {),),PopupMenuItem<String>(- value: 'toggle_favorite',+ value: 'toggle_important',padding: EdgeInsets.zero,height: 0,child: FutureBuilder<bool>(future: FileActions.isFavorite(file),initialData: false,builder: (context, snapshot) {- final isFavorite = snapshot.data ?? false;+ final isImportant = snapshot.data ?? false;return PopupMenuItemWidget(icon: Icon(- isFavorite ? Icons.star_rounded : Icons.star_border_rounded,+ isImportant ? Icons.star_rounded : Icons.star_border_rounded,color: colorScheme.textBase,size: 20,),- label: isFavorite ? "Unimportant" : "Important",+ label: isImportant+ ? context.l10n.unimportant+ : context.l10n.important,isFirst: false,isLast: false,);@@ -175,8 +177,8 @@ class FilePopupMenuWidget extends StatelessWidget {case 'edit':_editFile(context);break;- case 'toggle_favorite':- _toggleFavorite(context);+ case 'toggle_important':+ _toggleImportant(context);break;case 'download':_downloadFile(context);@@ -212,8 +214,8 @@ class FilePopupMenuWidget extends StatelessWidget {await FileActions.editFile(context, file);}- Future<void> _toggleFavorite(BuildContext context) async {- await FileActions.toggleFavorite(+ Future<void> _toggleImportant(BuildContext context) async {+ await FileActions.toggleImportant(context,file,);diff --git a/mobile/apps/locker/lib/utils/file_actions.dart b/mobile/apps/locker/lib/utils/file_actions.dartindex 6d2496d36f..39d612a56b 100644--- a/mobile/apps/locker/lib/utils/file_actions.dart+++ b/mobile/apps/locker/lib/utils/file_actions.dart@@ -417,25 +417,25 @@ class FileActions {}}- /// Toggles favorite/important status of a single file- static Future<void> toggleFavorite(+ /// Toggles important status of a single file+ static Future<void> toggleImportant(BuildContext context,EnteFile file, {VoidCallback? onSuccess,}) async {- final isCurrentlyFavorite = await isFavorite(file);+ final isCurrentlyImportant = await isFavorite(file);final dialog = createProgressDialog(context,- isCurrentlyFavorite- ? context.l10n.removingFromFavorites- : context.l10n.addingToFavorites,+ isCurrentlyImportant+ ? context.l10n.removingFromImportant+ : context.l10n.addingToImportant,isDismissible: false,);try {await dialog.show();- if (isCurrentlyFavorite) {+ if (isCurrentlyImportant) {await FavoritesService.instance.removeFromFavorites(context, file);} else {await FavoritesService.instance.addToFavorites(context, file);@@ -444,27 +444,29 @@ class FileActions {await dialog.hide();if (context.mounted) {- final message = !isCurrentlyFavorite- ? context.l10n.fileMarkedAsFavorite- : context.l10n.fileRemovedFromFavorites;- SnackBarUtils.showInfoSnackBar(context, message);+ showToast(+ context,+ !isCurrentlyImportant+ ? context.l10n.fileMarkedAsImportant+ : context.l10n.fileRemovedFromImportant,+ );}onSuccess?.call();} catch (e, stackTrace) {- _logger.severe("Failed to toggle favorite status: $e", e, stackTrace);+ _logger.severe("Failed to toggle important status: $e", e, stackTrace);await dialog.hide();if (context.mounted) {- SnackBarUtils.showWarningSnackBar(+ showToast(context,- context.l10n.failedToUpdateFavoriteStatus(e.toString()),+ context.l10n.somethingWentWrong,);}}}- /// Marks multiple files as important/favorite+ /// Marks multiple files as importantstatic Future<void> markMultipleAsImportant(BuildContext context,List<EnteFile> files, {@@ -472,7 +474,7 @@ class FileActions {}) async {final dialog = createProgressDialog(context,- context.l10n.markingAsFavorites,+ context.l10n.markingAsImportant,isDismissible: false,);@@ -490,9 +492,9 @@ class FileActions {if (filesToMark.isEmpty) {await dialog.hide();if (context.mounted) {- SnackBarUtils.showInfoSnackBar(+ showToast(context,- context.l10n.allFilesAlreadyMarkedAsFavorites,+ context.l10n.allFilesAlreadyMarkedAsImportant,);}return;@@ -507,25 +509,25 @@ class FileActions {await dialog.hide();if (context.mounted) {- SnackBarUtils.showInfoSnackBar(+ showToast(context,- context.l10n.filesMarkedAsFavorites(filesToMark.length),+ context.l10n.filesMarkedAsImportant(filesToMark.length),);}onSuccess?.call();} catch (e, stackTrace) {_logger.severe(- "Failed to mark multiple files as favorites: $e",+ "Failed to mark multiple files as important: $e",e,stackTrace,);await dialog.hide();if (context.mounted) {- SnackBarUtils.showWarningSnackBar(+ showToast(context,- context.l10n.failedToMarkFilesAsFavorites(e.toString()),+ context.l10n.failedToMarkFilesAsImportant(e.toString()),);}}