diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index d89a78913..6a0b88499 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -47,34 +47,51 @@ class MessageLookup extends MessageLookupByLibrary { static String m7(maxValue) => "When set to the maximum (${maxValue}), the device limit will be relaxed to allow for temporary spikes of large number of viewers."; - static String m8(passwordStrengthValue) => + static String m8(count) => + "${Intl.plural(count, zero: 'no memories', one: '${count} memory', other: '${count} memories')}"; + + static String m9(passwordStrengthValue) => "Password strength: ${passwordStrengthValue}"; - static String m9(storageInGB) => "3. Both of you get ${storageInGB} GB* free"; + static String m10(storageInGB) => + "3. Both of you get ${storageInGB} GB* free"; - static String m10(userEmail) => + static String m11(userEmail) => "${userEmail} will be removed from this shared album\n\nAny photos added by them will also be removed from the album"; - static String m11(verificationID) => + static String m12(count) => "${count} selected"; + + static String m13(count, yourCount) => + "${count} selected (${yourCount} yours)"; + + static String m14(verificationID) => "Here\'s my verification ID: ${verificationID} for ente.io."; - static String m12(verificationID) => + static String m15(verificationID) => "Hey, can you confirm that this is your ente.io verification ID: ${verificationID}"; - static String m13(referralCode, referralStorageInGB) => + static String m16(referralCode, referralStorageInGB) => "ente referral code: ${referralCode} \n\nApply it in Settings → General → Referrals to get ${referralStorageInGB} GB free after you signup for a paid plan\n\nhttps://ente.io"; - static String m14(numberOfPeople) => + static String m17(numberOfPeople) => "${Intl.plural(numberOfPeople, zero: 'Share with specific people', one: 'Shared with 1 person', other: 'Shared with ${numberOfPeople} people')}"; - static String m15(storageAmountInGB) => "${storageAmountInGB} GB"; + static String m18(fileType) => + "This ${fileType} will be deleted from your device."; - static String m16(storageAmountInGB) => + static String m19(fileType) => + "This ${fileType} is in both ente and your device."; + + static String m20(fileType) => "This ${fileType} will be deleted from ente."; + + static String m21(storageAmountInGB) => "${storageAmountInGB} GB"; + + static String m22(storageAmountInGB) => "They also get ${storageAmountInGB} GB"; - static String m17(email) => "This is ${email}\'s Verification ID"; + static String m23(email) => "This is ${email}\'s Verification ID"; - static String m18(email) => "Verify ${email}"; + static String m24(email) => "Verify ${email}"; final messages = _notInlinedMessages(_notInlinedMessages); static Map _notInlinedMessages(_) => { @@ -101,6 +118,7 @@ class MessageLookup extends MessageLookupByLibrary { "after1Year": MessageLookupByLibrary.simpleMessage("After 1 year"), "albumOwner": MessageLookupByLibrary.simpleMessage("Owner"), "albumUpdated": MessageLookupByLibrary.simpleMessage("Album updated"), + "albums": MessageLookupByLibrary.simpleMessage("Albums"), "allowAddPhotosDescription": MessageLookupByLibrary.simpleMessage( "Allow people with the link to also add photos to the shared album."), "allowAddingPhotos": @@ -191,6 +209,12 @@ class MessageLookup extends MessageLookupByLibrary { " other albums they are part of?"), "deleteConfirmDialogBody": MessageLookupByLibrary.simpleMessage( "You are about to permanently delete your account and all its data.\nThis action is irreversible."), + "deleteFromBoth": + MessageLookupByLibrary.simpleMessage("Delete from both"), + "deleteFromDevice": + MessageLookupByLibrary.simpleMessage("Delete from device"), + "deleteFromEnte": + MessageLookupByLibrary.simpleMessage("Delete from ente"), "deletePhotos": MessageLookupByLibrary.simpleMessage("Delete photos"), "deleteReason1": MessageLookupByLibrary.simpleMessage( "It’s missing a key feature that I need"), @@ -307,8 +331,11 @@ class MessageLookup extends MessageLookupByLibrary { "manageLink": MessageLookupByLibrary.simpleMessage("Manage link"), "manageParticipants": MessageLookupByLibrary.simpleMessage("Manage"), "maxDeviceLimitSpikeHandling": m7, + "memoryCount": m8, "moderateStrength": MessageLookupByLibrary.simpleMessage("Moderate"), + "movedToTrash": MessageLookupByLibrary.simpleMessage("Moved to trash"), "never": MessageLookupByLibrary.simpleMessage("Never"), + "newAlbum": MessageLookupByLibrary.simpleMessage("New album"), "noPasswordWarningPart1": MessageLookupByLibrary.simpleMessage( "We don\'t store this password, so if you forget,"), "noPasswordWarningPart2": @@ -327,9 +354,10 @@ class MessageLookup extends MessageLookupByLibrary { "passwordChangedSuccessfully": MessageLookupByLibrary.simpleMessage( "Password changed successfully"), "passwordLock": MessageLookupByLibrary.simpleMessage("Password lock"), - "passwordStrength": m8, + "passwordStrength": m9, "peopleUsingYourCode": MessageLookupByLibrary.simpleMessage("People using your code"), + "photoSmallCase": MessageLookupByLibrary.simpleMessage("photo"), "pleaseSendAnEmailTo": MessageLookupByLibrary.simpleMessage("Please send an email to"), "pleaseTryAgain": @@ -367,7 +395,7 @@ class MessageLookup extends MessageLookupByLibrary { "1. Give this code to your friends"), "referralStep2": MessageLookupByLibrary.simpleMessage( "2. They sign up for a paid plan"), - "referralStep3": m9, + "referralStep3": m10, "referralsAreCurrentlyPaused": MessageLookupByLibrary.simpleMessage( "Referrals are currently paused"), "remove": MessageLookupByLibrary.simpleMessage("Remove"), @@ -376,7 +404,7 @@ class MessageLookup extends MessageLookupByLibrary { "removeLink": MessageLookupByLibrary.simpleMessage("Remove link"), "removeParticipant": MessageLookupByLibrary.simpleMessage("Remove participant"), - "removeParticipantBody": m10, + "removeParticipantBody": m11, "removePublicLink": MessageLookupByLibrary.simpleMessage("Remove public link"), "removeShareItemsWarning": MessageLookupByLibrary.simpleMessage( @@ -397,6 +425,8 @@ class MessageLookup extends MessageLookupByLibrary { MessageLookupByLibrary.simpleMessage( "Scan this barcode with\nyour authenticator app"), "selectReason": MessageLookupByLibrary.simpleMessage("Select reason"), + "selectedPhotos": m12, + "selectedPhotosWithYours": m13, "sendEmail": MessageLookupByLibrary.simpleMessage("Send email"), "sendInvite": MessageLookupByLibrary.simpleMessage("Send invite"), "sendLink": MessageLookupByLibrary.simpleMessage("Send link"), @@ -405,17 +435,22 @@ class MessageLookup extends MessageLookupByLibrary { MessageLookupByLibrary.simpleMessage("Set password"), "setupComplete": MessageLookupByLibrary.simpleMessage("Setup complete"), "shareALink": MessageLookupByLibrary.simpleMessage("Share a link"), - "shareMyVerificationID": m11, - "shareTextConfirmOthersVerificationID": m12, + "shareMyVerificationID": m14, + "shareTextConfirmOthersVerificationID": m15, "shareTextRecommendUsingEnte": MessageLookupByLibrary.simpleMessage( "Download ente so we can easily share original quality photos and videos\n\nhttps://ente.io/#download"), - "shareTextReferralCode": m13, + "shareTextReferralCode": m16, "shareWithNonenteUsers": MessageLookupByLibrary.simpleMessage("Share with non-ente users"), - "shareWithPeopleSectionTitle": m14, + "shareWithPeopleSectionTitle": m17, "sharedAlbumSectionDescription": MessageLookupByLibrary.simpleMessage( "Create shared and collaborative albums with other ente users, including users on free plans."), "sharing": MessageLookupByLibrary.simpleMessage("Sharing..."), + "singleFileDeleteFromDevice": m18, + "singleFileDeleteHighlight": MessageLookupByLibrary.simpleMessage( + "It will be deleted from all albums."), + "singleFileInBothLocalAndRemote": m19, + "singleFileInRemoteOnly": m20, "someoneSharingAlbumsWithYouShouldSeeTheSameId": MessageLookupByLibrary.simpleMessage( "Someone sharing albums with you should see the same ID on their device."), @@ -433,7 +468,7 @@ class MessageLookup extends MessageLookupByLibrary { "sorryWeCouldNotGenerateSecureKeysOnThisDevicennplease": MessageLookupByLibrary.simpleMessage( "Sorry, we could not generate secure keys on this device.\n\nplease sign up from a different device."), - "storageInGB": m15, + "storageInGB": m21, "strongStrength": MessageLookupByLibrary.simpleMessage("Strong"), "subscribe": MessageLookupByLibrary.simpleMessage("Subscribe"), "subscribeToEnableSharing": MessageLookupByLibrary.simpleMessage( @@ -449,12 +484,12 @@ class MessageLookup extends MessageLookupByLibrary { "termsOfService": MessageLookupByLibrary.simpleMessage("terms of service"), "termsOfServicesTitle": MessageLookupByLibrary.simpleMessage("Terms"), - "theyAlsoGetXGb": m16, + "theyAlsoGetXGb": m22, "thisCanBeUsedToRecoverYourAccountIfYou": MessageLookupByLibrary.simpleMessage( "This can be used to recover your account if you lose your second factor"), "thisDevice": MessageLookupByLibrary.simpleMessage("This device"), - "thisIsPersonVerificationId": m17, + "thisIsPersonVerificationId": m23, "thisIsYourVerificationId": MessageLookupByLibrary.simpleMessage( "This is your Verification ID"), "thisWillLogYouOutOfTheFollowingDevice": @@ -478,11 +513,12 @@ class MessageLookup extends MessageLookupByLibrary { MessageLookupByLibrary.simpleMessage("Verification ID"), "verify": MessageLookupByLibrary.simpleMessage("Verify"), "verifyEmail": MessageLookupByLibrary.simpleMessage("Verify email"), - "verifyEmailID": m18, + "verifyEmailID": m24, "verifyPassword": MessageLookupByLibrary.simpleMessage("Verify password"), "verifyingRecoveryKey": MessageLookupByLibrary.simpleMessage("Verifying recovery key..."), + "videoSmallCase": MessageLookupByLibrary.simpleMessage("video"), "viewRecoveryKey": MessageLookupByLibrary.simpleMessage("View recovery key"), "viewer": MessageLookupByLibrary.simpleMessage("Viewer"), @@ -492,6 +528,7 @@ class MessageLookup extends MessageLookupByLibrary { MessageLookupByLibrary.simpleMessage("We\'ve sent a mail to"), "yesConvertToViewer": MessageLookupByLibrary.simpleMessage("Yes, convert to viewer"), + "yesDelete": MessageLookupByLibrary.simpleMessage("Yes, delete"), "yesRemove": MessageLookupByLibrary.simpleMessage("Yes, remove"), "you": MessageLookupByLibrary.simpleMessage("You"), "youCanAtMaxDoubleYourStorage": MessageLookupByLibrary.simpleMessage( diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index ee9e11467..41c220e3b 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -2719,6 +2719,170 @@ class S { args: [], ); } + + /// `video` + String get videoSmallCase { + return Intl.message( + 'video', + name: 'videoSmallCase', + desc: '', + args: [], + ); + } + + /// `photo` + String get photoSmallCase { + return Intl.message( + 'photo', + name: 'photoSmallCase', + desc: '', + args: [], + ); + } + + /// `It will be deleted from all albums.` + String get singleFileDeleteHighlight { + return Intl.message( + 'It will be deleted from all albums.', + name: 'singleFileDeleteHighlight', + desc: '', + args: [], + ); + } + + /// `This {fileType} is in both ente and your device.` + String singleFileInBothLocalAndRemote(Object fileType) { + return Intl.message( + 'This $fileType is in both ente and your device.', + name: 'singleFileInBothLocalAndRemote', + desc: '', + args: [fileType], + ); + } + + /// `This {fileType} will be deleted from ente.` + String singleFileInRemoteOnly(Object fileType) { + return Intl.message( + 'This $fileType will be deleted from ente.', + name: 'singleFileInRemoteOnly', + desc: '', + args: [fileType], + ); + } + + /// `This {fileType} will be deleted from your device.` + String singleFileDeleteFromDevice(Object fileType) { + return Intl.message( + 'This $fileType will be deleted from your device.', + name: 'singleFileDeleteFromDevice', + desc: '', + args: [fileType], + ); + } + + /// `Delete from ente` + String get deleteFromEnte { + return Intl.message( + 'Delete from ente', + name: 'deleteFromEnte', + desc: '', + args: [], + ); + } + + /// `Yes, delete` + String get yesDelete { + return Intl.message( + 'Yes, delete', + name: 'yesDelete', + desc: '', + args: [], + ); + } + + /// `Moved to trash` + String get movedToTrash { + return Intl.message( + 'Moved to trash', + name: 'movedToTrash', + desc: '', + args: [], + ); + } + + /// `Delete from device` + String get deleteFromDevice { + return Intl.message( + 'Delete from device', + name: 'deleteFromDevice', + desc: '', + args: [], + ); + } + + /// `Delete from both` + String get deleteFromBoth { + return Intl.message( + 'Delete from both', + name: 'deleteFromBoth', + desc: '', + args: [], + ); + } + + /// `New album` + String get newAlbum { + return Intl.message( + 'New album', + name: 'newAlbum', + desc: '', + args: [], + ); + } + + /// `Albums` + String get albums { + return Intl.message( + 'Albums', + name: 'albums', + desc: '', + args: [], + ); + } + + /// `{count, plural, zero{no memories} one{{count} memory} other{{count} memories}}` + String memoryCount(int count) { + return Intl.plural( + count, + zero: 'no memories', + one: '$count memory', + other: '$count memories', + name: 'memoryCount', + desc: 'The text to display the number of memories', + args: [count], + ); + } + + /// `{count} selected` + String selectedPhotos(int count) { + return Intl.message( + '$count selected', + name: 'selectedPhotos', + desc: 'Display the number of selected photos', + args: [count], + ); + } + + /// `{count} selected ({yourCount} yours)` + String selectedPhotosWithYours(int count, int yourCount) { + return Intl.message( + '$count selected ($yourCount yours)', + name: 'selectedPhotosWithYours', + desc: + 'Display the number of selected photos, including the number of selected photos owned by the user', + args: [count, yourCount], + ); + } } class AppLocalizationDelegate extends LocalizationsDelegate { diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 123454768..8be2b5a09 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -370,5 +370,56 @@ "hidden": "Hidden", "authToViewYourHiddenFiles": "Please authenticate to view your hidden files", "trash": "Trash", - "uncategorized": "Uncategorized" + "uncategorized": "Uncategorized", + "videoSmallCase": "video", + "photoSmallCase": "photo", + "singleFileDeleteHighlight": "It will be deleted from all albums.", + "singleFileInBothLocalAndRemote": "This {fileType} is in both ente and your device.", + "singleFileInRemoteOnly": "This {fileType} will be deleted from ente.", + "singleFileDeleteFromDevice": "This {fileType} will be deleted from your device.", + "deleteFromEnte": "Delete from ente", + "yesDelete": "Yes, delete", + "movedToTrash": "Moved to trash", + "deleteFromDevice": "Delete from device", + "deleteFromBoth": "Delete from both", + "newAlbum": "New album", + "albums": "Albums", + "memoryCount": "{count, plural, zero{no memories} one{{count} memory} other{{count} memories}}", + "@memoryCount": { + "description": "The text to display the number of memories", + "type": "text", + "placeholders": { + "count": { + "example": "1", + "type": "int" + } + } + }, + "selectedPhotos": "{count} selected", + "@selectedPhotos": { + "description": "Display the number of selected photos", + "type": "text", + "placeholders": { + "count": { + "example": "5", + "type": "int" + } + } + }, + "selectedPhotosWithYours": "{count} selected ({yourCount} yours)", + "@selectedPhotosWithYours": { + "description": "Display the number of selected photos, including the number of selected photos owned by the user", + "type": "text", + "placeholders": { + "count": { + "example": "12", + "type": "int" + }, + "yourCount": { + "example": "2", + "type": "int" + } + } + } + } \ No newline at end of file diff --git a/lib/ui/actions/file/file_actions.dart b/lib/ui/actions/file/file_actions.dart index e289e8e6f..d5f14ed3d 100644 --- a/lib/ui/actions/file/file_actions.dart +++ b/lib/ui/actions/file/file_actions.dart @@ -1,5 +1,6 @@ import "package:flutter/cupertino.dart"; import "package:modal_bottom_sheet/modal_bottom_sheet.dart"; +import "package:photos/generated/l10n.dart"; import "package:photos/models/file.dart"; import "package:photos/models/file_type.dart"; import "package:photos/theme/colors.dart"; @@ -18,19 +19,21 @@ Future showSingleFileDeleteSheet( Function(File)? onFileRemoved, }) async { final List buttons = []; - final String fileType = file.fileType == FileType.video ? "video" : "photo"; + final String fileType = file.fileType == FileType.video + ? S.of(context).videoSmallCase + : S.of(context).photoSmallCase; final bool isBothLocalAndRemote = file.uploadedFileID != null && file.localID != null; final bool isLocalOnly = file.uploadedFileID == null && file.localID != null; final bool isRemoteOnly = file.uploadedFileID != null && file.localID == null; - const String bodyHighlight = "It will be deleted from all albums."; + String bodyHighlight = S.of(context).singleFileDeleteHighlight; String body = ""; if (isBothLocalAndRemote) { - body = "This $fileType is in both ente and your device."; + body = S.of(context).singleFileInBothLocalAndRemote(fileType); } else if (isRemoteOnly) { - body = "This $fileType will be deleted from ente."; + body = S.of(context).singleFileInRemoteOnly(fileType); } else if (isLocalOnly) { - body = "This $fileType will be deleted from your device."; + body = S.of(context).singleFileDeleteFromDevice(fileType); } else { throw AssertionError("Unexpected state"); } @@ -38,7 +41,9 @@ Future showSingleFileDeleteSheet( if (isBothLocalAndRemote || isRemoteOnly) { buttons.add( ButtonWidget( - labelText: isBothLocalAndRemote ? "Delete from ente" : "Yes, delete", + labelText: isBothLocalAndRemote + ? S.of(context).deleteFromEnte + : S.of(context).yesDelete, buttonType: ButtonType.neutral, buttonSize: ButtonSize.large, shouldStickToDarkTheme: true, @@ -47,7 +52,7 @@ Future showSingleFileDeleteSheet( isInAlert: true, onTap: () async { await deleteFilesFromRemoteOnly(context, [file]); - showShortToast(context, "Moved to trash"); + showShortToast(context, S.of(context).movedToTrash); if (isRemoteOnly) { Navigator.of(context, rootNavigator: true).pop(); if (onFileRemoved != null) { @@ -62,7 +67,9 @@ Future showSingleFileDeleteSheet( if (isBothLocalAndRemote || isLocalOnly) { buttons.add( ButtonWidget( - labelText: isBothLocalAndRemote ? "Delete from device" : "Yes, delete", + labelText: isBothLocalAndRemote + ? S.of(context).deleteFromDevice + : S.of(context).yesDelete, buttonType: ButtonType.neutral, buttonSize: ButtonSize.large, shouldStickToDarkTheme: true, @@ -84,7 +91,7 @@ Future showSingleFileDeleteSheet( if (isBothLocalAndRemote) { buttons.add( ButtonWidget( - labelText: "Delete from both", + labelText: S.of(context).deleteFromBoth, buttonType: ButtonType.neutral, buttonSize: ButtonSize.large, shouldStickToDarkTheme: true, @@ -102,8 +109,8 @@ Future showSingleFileDeleteSheet( ); } buttons.add( - const ButtonWidget( - labelText: "Cancel", + ButtonWidget( + labelText: S.of(context).cancel, buttonType: ButtonType.secondary, buttonSize: ButtonSize.large, shouldStickToDarkTheme: true, diff --git a/lib/ui/components/album_horizontal_list_widget.dart b/lib/ui/components/album_horizontal_list_widget.dart index 4a3a54163..6ab1f566f 100644 --- a/lib/ui/components/album_horizontal_list_widget.dart +++ b/lib/ui/components/album_horizontal_list_widget.dart @@ -4,6 +4,7 @@ import "package:flutter/cupertino.dart"; import "package:logging/logging.dart"; import "package:photos/core/event_bus.dart"; import "package:photos/events/collection_updated_event.dart"; +import "package:photos/generated/l10n.dart"; import "package:photos/models/collection_items.dart"; import "package:photos/theme/ente_theme.dart"; import "package:photos/ui/collections/collection_item_widget.dart"; @@ -52,7 +53,7 @@ class _AlbumHorizontalListWidgetState extends State { Padding( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), child: Text( - "Albums", + S.of(context).albums, style: getEnteTextTheme(context).large, ), ), diff --git a/lib/ui/components/album_list_item_widget.dart b/lib/ui/components/album_list_item_widget.dart index ba99a0883..acab1402f 100644 --- a/lib/ui/components/album_list_item_widget.dart +++ b/lib/ui/components/album_list_item_widget.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:logging/logging.dart'; import 'package:photos/db/files_db.dart'; +import "package:photos/generated/l10n.dart"; import 'package:photos/models/collection_items.dart'; import 'package:photos/theme/ente_theme.dart'; import 'package:photos/ui/viewer/file/no_thumbnail_widget.dart'; @@ -9,6 +10,7 @@ import 'package:photos/ui/viewer/file/thumbnail_widget.dart'; ///https://www.figma.com/file/SYtMyLBs5SAOkTbfMMzhqt/ente-Visual-Design?node-id=7480%3A33462&t=H5AvR79OYDnB9ekw-4 class AlbumListItemWidget extends StatelessWidget { final CollectionWithThumbnail item; + const AlbumListItemWidget( this.item, { super.key, @@ -56,10 +58,8 @@ class AlbumListItemWidget extends StatelessWidget { ), builder: (context, snapshot) { if (snapshot.hasData) { - final text = - snapshot.data == 1 ? " memory" : " memories"; return Text( - snapshot.data.toString() + text, + S.of(context).memoryCount(snapshot.data!), style: textTheme.small.copyWith( color: colorScheme.textMuted, ), diff --git a/lib/ui/components/bottom_action_bar/action_bar_widget.dart b/lib/ui/components/bottom_action_bar/action_bar_widget.dart index 416dfd71b..957790a04 100644 --- a/lib/ui/components/bottom_action_bar/action_bar_widget.dart +++ b/lib/ui/components/bottom_action_bar/action_bar_widget.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:photos/core/configuration.dart'; +import "package:photos/generated/l10n.dart"; import 'package:photos/models/gallery_type.dart'; import 'package:photos/models/selected_files.dart'; import 'package:photos/theme/ente_theme.dart'; @@ -78,12 +79,15 @@ class _ActionBarWidgetState extends State { valueListenable: _selectedFilesNotifier, builder: (context, value, child) { return Text( - "${_selectedFilesNotifier.value} selected" + - (_selectedOwnedFilesNotifier.value != - _selectedFilesNotifier.value - ? " (${_selectedOwnedFilesNotifier.value} " - "yours) " - : ""), + _selectedOwnedFilesNotifier.value != + _selectedFilesNotifier.value + ? S.of(context).selectedPhotosWithYours( + _selectedFilesNotifier.value, + _selectedOwnedFilesNotifier.value, + ) + : S.of(context).selectedPhotos( + _selectedFilesNotifier.value, + ), style: textTheme.body.copyWith( color: colorScheme.blurTextBase, ), diff --git a/lib/ui/components/bottom_action_bar/bottom_action_bar_widget.dart b/lib/ui/components/bottom_action_bar/bottom_action_bar_widget.dart index 4e03a182d..cf6d5c32d 100644 --- a/lib/ui/components/bottom_action_bar/bottom_action_bar_widget.dart +++ b/lib/ui/components/bottom_action_bar/bottom_action_bar_widget.dart @@ -3,6 +3,7 @@ import 'dart:ui'; import 'package:expandable/expandable.dart'; import 'package:flutter/material.dart'; import 'package:photos/core/constants.dart'; +import "package:photos/generated/l10n.dart"; import 'package:photos/models/gallery_type.dart'; import 'package:photos/models/selected_files.dart'; import 'package:photos/theme/effects.dart'; @@ -88,7 +89,7 @@ class BottomActionBarWidget extends StatelessWidget { }, child: Center( child: Text( - "Cancel", + S.of(context).cancel, style: textTheme.bodyBold .copyWith(color: colorScheme.blurTextBase), ), diff --git a/lib/ui/components/dialog_widget.dart b/lib/ui/components/dialog_widget.dart index 581567423..a99e0dc9f 100644 --- a/lib/ui/components/dialog_widget.dart +++ b/lib/ui/components/dialog_widget.dart @@ -2,6 +2,7 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:photos/core/constants.dart'; +import "package:photos/generated/l10n.dart"; import "package:photos/models/search/button_result.dart"; import 'package:photos/models/typedefs.dart'; import 'package:photos/theme/colors.dart'; @@ -256,11 +257,11 @@ class _TextInputDialogState extends State { Row( mainAxisSize: MainAxisSize.min, children: [ - const Expanded( + Expanded( child: ButtonWidget( buttonType: ButtonType.secondary, buttonSize: ButtonSize.small, - labelText: "Cancel", + labelText: S.of(context).cancel, isInAlert: true, ), ), diff --git a/lib/ui/components/keyboard/keyboard_top_button.dart b/lib/ui/components/keyboard/keyboard_top_button.dart index d3b663dcf..c26dcd379 100644 --- a/lib/ui/components/keyboard/keyboard_top_button.dart +++ b/lib/ui/components/keyboard/keyboard_top_button.dart @@ -1,16 +1,17 @@ import 'package:flutter/cupertino.dart'; +import "package:photos/generated/l10n.dart"; import 'package:photos/theme/ente_theme.dart'; class KeyboardTopButton extends StatelessWidget { final VoidCallback? onDoneTap; final VoidCallback? onCancelTap; - final String doneText; - final String cancelText; + final String? doneText; + final String? cancelText; const KeyboardTopButton({ super.key, - this.doneText = "Done", - this.cancelText = "Cancel", + this.doneText, + this.cancelText, this.onDoneTap, this.onCancelTap, }); @@ -36,12 +37,18 @@ class KeyboardTopButton extends StatelessWidget { CupertinoButton( padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 14), onPressed: onCancelTap, - child: Text(cancelText, style: enteTheme.bodyBold), + child: Text( + cancelText ?? S.of(context).cancel, + style: enteTheme.bodyBold, + ), ), CupertinoButton( padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 14), onPressed: onDoneTap, - child: Text(doneText, style: enteTheme.bodyBold), + child: Text( + doneText ?? S.of(context).done, + style: enteTheme.bodyBold, + ), ), ], ), diff --git a/lib/ui/components/new_album_list_widget.dart b/lib/ui/components/new_album_list_widget.dart index c089c8cbc..4274fafcc 100644 --- a/lib/ui/components/new_album_list_widget.dart +++ b/lib/ui/components/new_album_list_widget.dart @@ -1,5 +1,6 @@ import 'package:dotted_border/dotted_border.dart'; import 'package:flutter/material.dart'; +import "package:photos/generated/l10n.dart"; import 'package:photos/theme/ente_theme.dart'; ///https://www.figma.com/file/SYtMyLBs5SAOkTbfMMzhqt/ente-Visual-Design?node-id=10854%3A57947&t=H5AvR79OYDnB9ekw-4 @@ -36,7 +37,7 @@ class NewAlbumListItemWidget extends StatelessWidget { Padding( padding: const EdgeInsets.only(left: 12), child: Text( - "New album", + S.of(context).newAlbum, style: textTheme.body.copyWith(color: colorScheme.textMuted), ),