Bladeren bron

Extract strings

vishnukvmd 2 jaren geleden
bovenliggende
commit
84e7a592af

+ 3 - 0
lib/generated/intl/messages_en.dart

@@ -751,6 +751,9 @@ class MessageLookup extends MessageLookupByLibrary {
         "nothingToSeeHere":
         "nothingToSeeHere":
             MessageLookupByLibrary.simpleMessage("Nothing to see here! 👀"),
             MessageLookupByLibrary.simpleMessage("Nothing to see here! 👀"),
         "ok": MessageLookupByLibrary.simpleMessage("Ok"),
         "ok": MessageLookupByLibrary.simpleMessage("Ok"),
+        "onDevice": MessageLookupByLibrary.simpleMessage("On device"),
+        "onEnte": MessageLookupByLibrary.simpleMessage(
+            "On <branding>ente</branding>"),
         "oops": MessageLookupByLibrary.simpleMessage("Oops"),
         "oops": MessageLookupByLibrary.simpleMessage("Oops"),
         "oopsSomethingWentWrong":
         "oopsSomethingWentWrong":
             MessageLookupByLibrary.simpleMessage("Oops, something went wrong"),
             MessageLookupByLibrary.simpleMessage("Oops, something went wrong"),

+ 20 - 0
lib/generated/l10n.dart

@@ -4630,6 +4630,26 @@ class S {
     );
     );
   }
   }
 
 
+  /// `On device`
+  String get onDevice {
+    return Intl.message(
+      'On device',
+      name: 'onDevice',
+      desc: '',
+      args: [],
+    );
+  }
+
+  /// `On <branding>ente</branding>`
+  String get onEnte {
+    return Intl.message(
+      'On <branding>ente</branding>',
+      name: 'onEnte',
+      desc: '',
+      args: [],
+    );
+  }
+
   /// `Name`
   /// `Name`
   String get name {
   String get name {
     return Intl.message(
     return Intl.message(

+ 2 - 0
lib/l10n/intl_en.arb

@@ -625,6 +625,8 @@
   "collectEventPhotos": "Collect event photos",
   "collectEventPhotos": "Collect event photos",
   "sessionExpired": "Session expired",
   "sessionExpired": "Session expired",
   "loggingOut": "Logging out...",
   "loggingOut": "Logging out...",
+  "onDevice": "On device",
+  "onEnte": "On <branding>ente</branding>",
   "name": "Name",
   "name": "Name",
   "newest": "Newest",
   "newest": "Newest",
   "lastUpdated": "Last updated",
   "lastUpdated": "Last updated",

+ 17 - 16
lib/ui/collections/section_title.dart

@@ -1,10 +1,12 @@
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
+import "package:photos/generated/l10n.dart";
 import 'package:photos/theme/ente_theme.dart';
 import 'package:photos/theme/ente_theme.dart';
 import 'package:photos/theme/text_style.dart';
 import 'package:photos/theme/text_style.dart';
+import "package:styled_text/styled_text.dart";
 
 
 class SectionTitle extends StatelessWidget {
 class SectionTitle extends StatelessWidget {
   final String? title;
   final String? title;
-  final RichText? titleWithBrand;
+  final Widget? titleWithBrand;
 
 
   const SectionTitle({
   const SectionTitle({
     this.title,
     this.title,
@@ -40,22 +42,21 @@ class SectionTitle extends StatelessWidget {
   }
   }
 }
 }
 
 
-RichText getOnEnteSection(BuildContext context) {
+Widget getOnEnteSection(BuildContext context) {
   final EnteTextTheme textTheme = getEnteTextTheme(context);
   final EnteTextTheme textTheme = getEnteTextTheme(context);
-  return RichText(
-    text: TextSpan(
-      children: [
-        TextSpan(
-          text: "On ",
-          style: TextStyle(
-            fontWeight: FontWeight.w600,
-            fontFamily: 'Inter',
-            fontSize: 21,
-            color: textTheme.brandSmall.color,
-          ),
-        ),
-        TextSpan(text: "ente", style: textTheme.brandSmall),
-      ],
+
+  return StyledText(
+    text: S.of(context).onEnte,
+    style: TextStyle(
+      fontWeight: FontWeight.w600,
+      fontFamily: 'Inter',
+      fontSize: 21,
+      color: textTheme.brandSmall.color,
     ),
     ),
+    tags: {
+      'branding': StyledTextTag(
+        style: textTheme.brandSmall,
+      ),
+    },
   );
   );
 }
 }

+ 1 - 1
lib/ui/collections_gallery_widget.dart

@@ -147,7 +147,7 @@ class _CollectionsGalleryWidgetState extends State<CollectionsGalleryWidget>
         child: Column(
         child: Column(
           children: [
           children: [
             const SizedBox(height: 12),
             const SizedBox(height: 12),
-            const SectionTitle(title: "On device"),
+            SectionTitle(title: S.of(context).onDevice),
             const SizedBox(height: 12),
             const SizedBox(height: 12),
             const DeviceFoldersGridViewWidget(),
             const DeviceFoldersGridViewWidget(),
             Row(
             Row(