浏览代码

Merge more strings

vishnukvmd 2 年之前
父节点
当前提交
16327cba15

+ 2 - 6
lib/generated/intl/messages_en.dart

@@ -418,12 +418,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "deleteAccountPermanentlyButton":
             MessageLookupByLibrary.simpleMessage("Delete Account Permanently"),
         "deleteAlbum": MessageLookupByLibrary.simpleMessage("Delete album"),
-        "deleteAlbumDialogPart1": MessageLookupByLibrary.simpleMessage(
-            "Also delete the photos (and videos) present in this album from "),
-        "deleteAlbumDialogPart2Bold":
-            MessageLookupByLibrary.simpleMessage("all"),
-        "deleteAlbumDialogPart3": MessageLookupByLibrary.simpleMessage(
-            " other albums they are part of?"),
+        "deleteAlbumDialog": MessageLookupByLibrary.simpleMessage(
+            "Also delete the photos (and videos) present in this album from <bold>all</bold> other albums they are part of?"),
         "deleteAlbumsDialogBody": MessageLookupByLibrary.simpleMessage(
             "This will delete all empty albums. This is useful when you want to reduce the clutter in your album list."),
         "deleteAll": MessageLookupByLibrary.simpleMessage("Delete All"),

+ 5 - 28
lib/generated/l10n.dart

@@ -2473,35 +2473,12 @@ class S {
     );
   }
 
-  /// `Also delete the photos (and videos) present in this album from `
-  String get deleteAlbumDialogPart1 {
+  /// `Also delete the photos (and videos) present in this album from <bold>all</bold> other albums they are part of?`
+  String get deleteAlbumDialog {
     return Intl.message(
-      'Also delete the photos (and videos) present in this album from ',
-      name: 'deleteAlbumDialogPart1',
-      desc:
-          'Part of this string \'Also delete the photos (and videos) present in this album from all other albums they are part of?\'',
-      args: [],
-    );
-  }
-
-  /// `all`
-  String get deleteAlbumDialogPart2Bold {
-    return Intl.message(
-      'all',
-      name: 'deleteAlbumDialogPart2Bold',
-      desc:
-          'Part of this string \'Also delete the photos (and videos) present in this album from all other albums they are part of?\'',
-      args: [],
-    );
-  }
-
-  /// ` other albums they are part of?`
-  String get deleteAlbumDialogPart3 {
-    return Intl.message(
-      ' other albums they are part of?',
-      name: 'deleteAlbumDialogPart3',
-      desc:
-          'Part of this string \'Also delete the photos (and videos) present in this album from all other albums they are part of?\'',
+      'Also delete the photos (and videos) present in this album from <bold>all</bold> other albums they are part of?',
+      name: 'deleteAlbumDialog',
+      desc: '',
       args: [],
     );
   }

+ 1 - 12
lib/l10n/intl_en.arb

@@ -326,18 +326,7 @@
   "canOnlyRemoveFilesOwnedByYou": "Can only remove files owned by you",
   "deleteSharedAlbum": "Delete shared album?",
   "deleteAlbum": "Delete album",
-  "deleteAlbumDialogPart1": "Also delete the photos (and videos) present in this album from ",
-  "@deleteAlbumDialogPart1": {
-    "description": "Part of this string 'Also delete the photos (and videos) present in this album from all other albums they are part of?'"
-  },
-  "deleteAlbumDialogPart2Bold": "all",
-  "@deleteAlbumDialogPart2Bold": {
-    "description": "Part of this string 'Also delete the photos (and videos) present in this album from all other albums they are part of?'"
-  },
-  "deleteAlbumDialogPart3": " other albums they are part of?",
-  "@deleteAlbumDialogPart3": {
-    "description": "Part of this string 'Also delete the photos (and videos) present in this album from all other albums they are part of?'"
-  },
+  "deleteAlbumDialog": "Also delete the photos (and videos) present in this album from <bold>all</bold> other albums they are part of?",
   "deleteSharedAlbumDialogBody": "The album will be deleted for everyone\n\nYou will lose access to shared photos in this album that are owned by others",
   "yesRemove": "Yes, remove",
   "creatingLink": "Creating link...",

+ 50 - 47
lib/ui/actions/collection/collection_sharing_actions.dart

@@ -25,6 +25,7 @@ import 'package:photos/utils/dialog_util.dart';
 import 'package:photos/utils/email_util.dart';
 import 'package:photos/utils/share_util.dart';
 import 'package:photos/utils/toast_util.dart';
+import "package:styled_text/styled_text.dart";
 
 class CollectionActions {
   final Logger logger = Logger((CollectionActions).toString());
@@ -96,8 +97,11 @@ class CollectionActions {
     BuildContext context,
     List<File> files,
   ) async {
-    final dialog = createProgressDialog(context, S.of(context).creatingLink,
-        isDismissible: true);
+    final dialog = createProgressDialog(
+      context,
+      S.of(context).creatingLink,
+      isDismissible: true,
+    );
     dialog.show();
     try {
       // create album with emptyName, use collectionCreationTime on UI to
@@ -143,31 +147,32 @@ class CollectionActions {
     User user,
   ) async {
     final actionResult = await showActionSheet(
-        context: context,
-        buttons: [
-          ButtonWidget(
-            buttonType: ButtonType.critical,
-            isInAlert: true,
-            shouldStickToDarkTheme: true,
-            buttonAction: ButtonAction.first,
-            shouldSurfaceExecutionStates: true,
-            labelText: S.of(context).yesRemove,
-            onTap: () async {
-              final newSharees = await CollectionsService.instance
-                  .unshare(collection.id, user.email);
-              collection.updateSharees(newSharees);
-            },
-          ),
-          ButtonWidget(
-            buttonType: ButtonType.secondary,
-            buttonAction: ButtonAction.cancel,
-            isInAlert: true,
-            shouldStickToDarkTheme: true,
-            labelText: S.of(context).cancel,
-          )
-        ],
-        title: S.of(context).removeWithQuestionMark,
-        body: S.of(context).removeParticipantBody(user.email));
+      context: context,
+      buttons: [
+        ButtonWidget(
+          buttonType: ButtonType.critical,
+          isInAlert: true,
+          shouldStickToDarkTheme: true,
+          buttonAction: ButtonAction.first,
+          shouldSurfaceExecutionStates: true,
+          labelText: S.of(context).yesRemove,
+          onTap: () async {
+            final newSharees = await CollectionsService.instance
+                .unshare(collection.id, user.email);
+            collection.updateSharees(newSharees);
+          },
+        ),
+        ButtonWidget(
+          buttonType: ButtonType.secondary,
+          buttonAction: ButtonAction.cancel,
+          isInAlert: true,
+          shouldStickToDarkTheme: true,
+          labelText: S.of(context).cancel,
+        )
+      ],
+      title: S.of(context).removeWithQuestionMark,
+      body: S.of(context).removeParticipantBody(user.email),
+    );
     if (actionResult?.action != null) {
       if (actionResult!.action == ButtonAction.error) {
         showGenericErrorDialog(context: context);
@@ -193,16 +198,22 @@ class CollectionActions {
       );
       return false;
     } else if (email.trim() == Configuration.instance.getEmail()) {
-      await showErrorDialog(context, S.of(context).oops,
-          S.of(context).youCannotShareWithYourself);
+      await showErrorDialog(
+        context,
+        S.of(context).oops,
+        S.of(context).youCannotShareWithYourself,
+      );
       return false;
     }
 
     ProgressDialog? dialog;
     String? publicKey;
     if (showProgress) {
-      dialog = createProgressDialog(context, S.of(context).sharing,
-          isDismissible: true);
+      dialog = createProgressDialog(
+        context,
+        S.of(context).sharing,
+        isDismissible: true,
+      );
       await dialog.show();
     }
 
@@ -325,22 +336,14 @@ class CollectionActions {
           isInAlert: true,
         ),
       ],
-      bodyWidget: RichText(
-        text: TextSpan(
-          style: textTheme.body.copyWith(color: textMutedDark),
-          children: <TextSpan>[
-            TextSpan(
-              text: S.of(bContext).deleteAlbumDialogPart1,
-            ),
-            TextSpan(
-              text: S.of(bContext).deleteAlbumDialogPart2Bold,
-              style: textTheme.body.copyWith(color: textBaseDark),
-            ),
-            TextSpan(
-              text: S.of(bContext).deleteAlbumDialogPart3,
-            ),
-          ],
-        ),
+      bodyWidget: StyledText(
+        text: S.of(bContext).deleteAlbumDialog,
+        style: textTheme.body.copyWith(color: textMutedDark),
+        tags: {
+          'bold': StyledTextTag(
+            style: textTheme.body.copyWith(color: textBaseDark),
+          ),
+        },
       ),
       actionSheetType: ActionSheetType.defaultActionSheet,
     );