Neeraj Gupta преди 2 години
родител
ревизия
6b10c3d315
променени са 5 файла, в които са добавени 22 реда и са изтрити 6 реда
  1. 0 1
      lib/core/constants.dart
  2. 2 0
      lib/generated/intl/messages_en.dart
  3. 10 0
      lib/generated/l10n.dart
  4. 2 1
      lib/l10n/intl_en.arb
  5. 8 4
      lib/ui/viewer/file/file_caption_widget.dart

+ 0 - 1
lib/core/constants.dart

@@ -27,7 +27,6 @@ const String sharedMediaIdentifier = 'ente-shared-media://';
 
 const int maxLivePhotoToastCount = 2;
 const String livePhotoToastCounterKey = "show_live_photo_toast";
-const String fileCaptionDefaultHint = "Add a description...";
 
 const thumbnailDiskLoadDeferDuration = Duration(milliseconds: 40);
 const thumbnailServerLoadDeferDuration = Duration(milliseconds: 80);

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

@@ -590,6 +590,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "faqs": MessageLookupByLibrary.simpleMessage("FAQs"),
         "favorite": MessageLookupByLibrary.simpleMessage("Favorite"),
         "feedback": MessageLookupByLibrary.simpleMessage("Feedback"),
+        "fileInfoAddDescHint":
+            MessageLookupByLibrary.simpleMessage("Add a description..."),
         "fileSavedToGallery":
             MessageLookupByLibrary.simpleMessage("File saved to gallery"),
         "filesBackedUpFromDevice": m50,

+ 10 - 0
lib/generated/l10n.dart

@@ -6914,6 +6914,16 @@ class S {
       args: [],
     );
   }
+
+  /// `Add a description...`
+  String get fileInfoAddDescHint {
+    return Intl.message(
+      'Add a description...',
+      name: 'fileInfoAddDescHint',
+      desc: '',
+      args: [],
+    );
+  }
 }
 
 class AppLocalizationDelegate extends LocalizationsDelegate<S> {

+ 2 - 1
lib/l10n/intl_en.arb

@@ -968,5 +968,6 @@
   },
   "freeStorageSpace" : "{freeAmount} {storageUnit} free",
   "appVersion": "Version: {versionValue}",
-  "verifyIDLabel" : "Verify"
+  "verifyIDLabel" : "Verify",
+  "fileInfoAddDescHint": "Add a description..."
 }

+ 8 - 4
lib/ui/viewer/file/file_caption_widget.dart

@@ -1,5 +1,5 @@
 import 'package:flutter/material.dart';
-import 'package:photos/core/constants.dart';
+import "package:photos/generated/l10n.dart";
 import 'package:photos/models/file.dart';
 import 'package:photos/theme/ente_theme.dart';
 import 'package:photos/ui/components/keyboard/keybiard_oveylay.dart';
@@ -65,7 +65,8 @@ class _FileCaptionWidgetState extends State<FileCaptionWidget> {
   final _textController = TextEditingController();
   final _focusNode = FocusNode();
   String? editedCaption;
-  String hintText = fileCaptionDefaultHint;
+  late String defaultHintText = S.of(context).fileInfoAddDescHint;
+  String hintText = '';
   Widget? keyboardTopButtons;
 
   @override
@@ -90,6 +91,9 @@ class _FileCaptionWidgetState extends State<FileCaptionWidget> {
 
   @override
   Widget build(BuildContext context) {
+    if (hintText.isEmpty) {
+      hintText = defaultHintText;
+    }
     final colorScheme = getEnteColorScheme(context);
     final textTheme = getEnteTextTheme(context);
     return TextField(
@@ -121,7 +125,7 @@ class _FileCaptionWidgetState extends State<FileCaptionWidget> {
         filled: true,
         fillColor: colorScheme.fillFaint,
         hintText: hintText,
-        hintStyle: hintText == fileCaptionDefaultHint
+        hintStyle: hintText == defaultHintText
             ? textTheme.small.copyWith(color: colorScheme.textMuted)
             : textTheme.small,
       ),
@@ -134,7 +138,7 @@ class _FileCaptionWidgetState extends State<FileCaptionWidget> {
       keyboardType: TextInputType.multiline,
       onChanged: (value) {
         setState(() {
-          hintText = fileCaptionDefaultHint;
+          hintText = defaultHintText;
           currentLength = value.length;
           editedCaption = value;
         });