Browse Source

[mob][photos] Extract strings

Neeraj Gupta 1 year ago
parent
commit
f777bdba1b

+ 4 - 0
mobile/lib/generated/intl/messages_en.dart

@@ -358,6 +358,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "authenticationSuccessful":
         "authenticationSuccessful":
             MessageLookupByLibrary.simpleMessage("Authentication successful!"),
             MessageLookupByLibrary.simpleMessage("Authentication successful!"),
         "autoPair": MessageLookupByLibrary.simpleMessage("Auto pair"),
         "autoPair": MessageLookupByLibrary.simpleMessage("Auto pair"),
+        "autoPairGoogle": MessageLookupByLibrary.simpleMessage(
+            "Auto Pair requires connecting to Google servers and only works with Chromecast supported devices. Google will not receive sensitive data, such as your photos."),
         "available": MessageLookupByLibrary.simpleMessage("Available"),
         "available": MessageLookupByLibrary.simpleMessage("Available"),
         "backedUpFolders":
         "backedUpFolders":
             MessageLookupByLibrary.simpleMessage("Backed up folders"),
             MessageLookupByLibrary.simpleMessage("Backed up folders"),
@@ -903,6 +905,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "manageParticipants": MessageLookupByLibrary.simpleMessage("Manage"),
         "manageParticipants": MessageLookupByLibrary.simpleMessage("Manage"),
         "manageSubscription":
         "manageSubscription":
             MessageLookupByLibrary.simpleMessage("Manage subscription"),
             MessageLookupByLibrary.simpleMessage("Manage subscription"),
+        "manualPairDesc": MessageLookupByLibrary.simpleMessage(
+            "Pair with PIN works for any large screen device you want to play your album on."),
         "map": MessageLookupByLibrary.simpleMessage("Map"),
         "map": MessageLookupByLibrary.simpleMessage("Map"),
         "maps": MessageLookupByLibrary.simpleMessage("Maps"),
         "maps": MessageLookupByLibrary.simpleMessage("Maps"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),
         "mastodon": MessageLookupByLibrary.simpleMessage("Mastodon"),

+ 20 - 0
mobile/lib/generated/l10n.dart

@@ -8583,6 +8583,26 @@ class S {
       args: [],
       args: [],
     );
     );
   }
   }
+
+  /// `Auto Pair requires connecting to Google servers and only works with Chromecast supported devices. Google will not receive sensitive data, such as your photos.`
+  String get autoPairGoogle {
+    return Intl.message(
+      'Auto Pair requires connecting to Google servers and only works with Chromecast supported devices. Google will not receive sensitive data, such as your photos.',
+      name: 'autoPairGoogle',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `Pair with PIN works for any large screen device you want to play your album on.`
+  String get manualPairDesc {
+    return Intl.message(
+      'Pair with PIN works for any large screen device you want to play your album on.',
+      name: 'manualPairDesc',
+      desc: '',
+      args: [],
+    );
+  }
 }
 }
 
 
 class AppLocalizationDelegate extends LocalizationsDelegate<S> {
 class AppLocalizationDelegate extends LocalizationsDelegate<S> {

+ 3 - 1
mobile/lib/l10n/intl_en.arb

@@ -1214,5 +1214,7 @@
   "endpointUpdatedMessage": "Endpoint updated successfully",
   "endpointUpdatedMessage": "Endpoint updated successfully",
   "customEndpoint": "Connected to {endpoint}",
   "customEndpoint": "Connected to {endpoint}",
   "createCollaborativeLink": "Create collaborative link",
   "createCollaborativeLink": "Create collaborative link",
-  "search": "Search"
+  "search": "Search",
+  "autoPairGoogle": "Auto Pair requires connecting to Google servers and only works with Chromecast supported devices. Google will not receive sensitive data, such as your photos.",
+  "manualPairDesc": "Pair with PIN works for any large screen device you want to play your album on."
 }
 }

+ 6 - 13
mobile/lib/ui/cast/choose.dart

@@ -1,6 +1,6 @@
 import "package:flutter/material.dart";
 import "package:flutter/material.dart";
 import "package:photos/generated/l10n.dart";
 import "package:photos/generated/l10n.dart";
-import "package:photos/service_locator.dart";
+import "package:photos/l10n/l10n.dart";
 import "package:photos/theme/ente_theme.dart";
 import "package:photos/theme/ente_theme.dart";
 import "package:photos/ui/components/buttons/button_widget.dart";
 import "package:photos/ui/components/buttons/button_widget.dart";
 import "package:photos/ui/components/models/button_type.dart";
 import "package:photos/ui/components/models/button_type.dart";
@@ -11,10 +11,10 @@ class CastChooseDialog extends StatefulWidget {
   }) : super(key: key) {}
   }) : super(key: key) {}
 
 
   @override
   @override
-  State<CastChooseDialog> createState() => _AutoCastDialogState();
+  State<CastChooseDialog> createState() => _CastChooseDialogState();
 }
 }
 
 
-class _AutoCastDialogState extends State<CastChooseDialog> {
+class _CastChooseDialogState extends State<CastChooseDialog> {
   final bool doesUserExist = true;
   final bool doesUserExist = true;
 
 
   @override
   @override
@@ -22,7 +22,7 @@ class _AutoCastDialogState extends State<CastChooseDialog> {
     final textStyle = getEnteTextTheme(context);
     final textStyle = getEnteTextTheme(context);
     final AlertDialog alert = AlertDialog(
     final AlertDialog alert = AlertDialog(
       title: Text(
       title: Text(
-        "Play album on TV",
+        context.l10n.playOnTv,
         style: textStyle.largeBold,
         style: textStyle.largeBold,
       ),
       ),
       content: Column(
       content: Column(
@@ -31,7 +31,7 @@ class _AutoCastDialogState extends State<CastChooseDialog> {
         children: [
         children: [
           const SizedBox(height: 8),
           const SizedBox(height: 8),
           Text(
           Text(
-            "Auto Pair requires connecting to Google servers and only works with Chromecast supported devices. Google will not receive sensitive data, such as your photos.",
+            S.of(context).autoPairGoogle,
             style: textStyle.bodyMuted,
             style: textStyle.bodyMuted,
           ),
           ),
           const SizedBox(height: 12),
           const SizedBox(height: 12),
@@ -50,7 +50,7 @@ class _AutoCastDialogState extends State<CastChooseDialog> {
           ),
           ),
           const SizedBox(height: 36),
           const SizedBox(height: 36),
           Text(
           Text(
-            "Pair with PIN works for any large screen device you want to play your album on.",
+            S.of(context).manualPairDesc,
             style: textStyle.bodyMuted,
             style: textStyle.bodyMuted,
           ),
           ),
           const SizedBox(height: 12),
           const SizedBox(height: 12),
@@ -73,11 +73,4 @@ class _AutoCastDialogState extends State<CastChooseDialog> {
     );
     );
     return alert;
     return alert;
   }
   }
-
-  Future<void> _connectToYourApp(
-    BuildContext context,
-    Object castDevice,
-  ) async {
-    await castService.connectDevice(context, castDevice);
-  }
 }
 }