Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Extract social feature strings for localization

ashilkna0ebfa31ba25
diff --git a/mobile/apps/photos/lib/l10n/intl_en.arb b/mobile/apps/photos/lib/l10n/intl_en.arb
index 1c1b1e9b44..7a772c043a 100644
--- a/mobile/apps/photos/lib/l10n/intl_en.arb
+++ b/mobile/apps/photos/lib/l10n/intl_en.arb
@@ -2282,5 +2282,123 @@
},
"noActivityYet": "No activity yet",
"like": "Like",
- "comments": "Comments"
+ "comments": "Comments",
+ "commentHint": "Say something nice!",
+ "@commentHint": {
+ "description": "Placeholder text for comment input field"
+ },
+ "reply": "Reply",
+ "@reply": {
+ "description": "Reply action button label"
+ },
+ "areYouSure": "Are you sure?",
+ "@areYouSure": {
+ "description": "Confirmation dialog title"
+ },
+ "deleteComment": "Delete comment",
+ "@deleteComment": {
+ "description": "Delete comment button label"
+ },
+ "deleteCommentConfirmation": "Your comment \"{comment}\" will be deleted permanently",
+ "@deleteCommentConfirmation": {
+ "description": "Confirmation message when deleting a comment",
+ "placeholders": {
+ "comment": {
+ "type": "String"
+ }
+ }
+ },
+ "likesCount": "{count, plural, =1{1 like} other{{count} likes}}",
+ "@likesCount": {
+ "description": "Number of likes with pluralization",
+ "placeholders": {
+ "count": {
+ "type": "int"
+ }
+ }
+ },
+ "noLikesYet": "No likes yet",
+ "@noLikesYet": {
+ "description": "Empty state when no likes exist"
+ },
+ "couldNotLoadLikes": "Could not load likes",
+ "@couldNotLoadLikes": {
+ "description": "Error when likes fail to load"
+ },
+ "failedToUpdateLike": "Failed to update like",
+ "@failedToUpdateLike": {
+ "description": "Toast when like update fails"
+ },
+ "failedToLikeAlbums": "{count, plural, =1{Failed to like 1 album} other{Failed to like {count} albums}}",
+ "@failedToLikeAlbums": {
+ "description": "Error when liking albums fails",
+ "placeholders": {
+ "count": {
+ "type": "int"
+ }
+ }
+ },
+ "couldNotLoadAlbums": "Could not load albums",
+ "@couldNotLoadAlbums": {
+ "description": "Error when albums fail to load"
+ },
+ "albumsCount": "{count, plural, =1{1 album} other{{count} albums}}",
+ "@albumsCount": {
+ "description": "Number of albums with pluralization",
+ "placeholders": {
+ "count": {
+ "type": "int"
+ }
+ }
+ },
+ "likeAll": "Like all",
+ "@likeAll": {
+ "description": "Button to like in all shared albums"
+ },
+ "selectAlbumToLikeVideo": "Select the album to like this video",
+ "@selectAlbumToLikeVideo": {
+ "description": "Instruction for liking video"
+ },
+ "selectAlbumToLikePhoto": "Select the album to like this photo",
+ "@selectAlbumToLikePhoto": {
+ "description": "Instruction for liking photo"
+ },
+ "failedToLikeComment": "Failed to like comment",
+ "@failedToLikeComment": {
+ "description": "Toast when comment like fails"
+ },
+ "failedToDeleteComment": "Failed to delete comment",
+ "@failedToDeleteComment": {
+ "description": "Toast when comment deletion fails"
+ },
+ "deletedComment": "(deleted)",
+ "@deletedComment": {
+ "description": "Label for deleted comments"
+ },
+ "replyingToYou": "Replying to you",
+ "@replyingToYou": {
+ "description": "Label when replying to own comment"
+ },
+ "replyingTo": "Replying to {name}",
+ "@replyingTo": {
+ "description": "Label when replying to someone's comment",
+ "placeholders": {
+ "name": {
+ "type": "String"
+ }
+ }
+ },
+ "anonymous": "Anonymous",
+ "@anonymous": {
+ "description": "Fallback name for anonymous users"
+ },
+ "commentsCount": "{count, plural, =0{No comments} =1{1 comment} other{{count} comments}}",
+ "@commentsCount": {
+ "description": "Number of comments with pluralization",
+ "placeholders": {
+ "count": {
+ "type": "int"
+ }
+ }
+ }
}
diff --git a/mobile/apps/photos/lib/ui/social/comment_likes_bottom_sheet.dart b/mobile/apps/photos/lib/ui/social/comment_likes_bottom_sheet.dart
index d4094e22e6..63ee17d09e 100644
--- a/mobile/apps/photos/lib/ui/social/comment_likes_bottom_sheet.dart
+++ b/mobile/apps/photos/lib/ui/social/comment_likes_bottom_sheet.dart
@@ -1,6 +1,7 @@
import "package:ente_icons/ente_icons.dart";
import "package:flutter/material.dart";
import "package:photos/extensions/user_extension.dart";
+import "package:photos/generated/l10n.dart";
import "package:photos/models/api/collection/user.dart";
import "package:photos/models/social/reaction.dart";
import "package:photos/models/social/social_data_provider.dart";
@@ -80,11 +81,12 @@ class _CommentLikesBottomSheetState extends State<CommentLikesBottomSheet> {
}
}
- User _getUserForReaction(Reaction reaction) {
+ User _getUserForReaction(Reaction reaction, String anonymousLabel) {
if (reaction.isAnonymous) {
final anonID = reaction.anonUserID;
- final displayName =
- anonID != null ? (_anonDisplayNames[anonID] ?? anonID) : "Anonymous";
+ final displayName = anonID != null
+ ? (_anonDisplayNames[anonID] ?? anonID)
+ : anonymousLabel;
return User(
id: reaction.userID,
email: "${anonID ?? "anonymous"}@unknown.com",
@@ -98,6 +100,7 @@ class _CommentLikesBottomSheetState extends State<CommentLikesBottomSheet> {
@override
Widget build(BuildContext context) {
+ final l10n = AppLocalizations.of(context);
final colorScheme = getEnteColorScheme(context);
final textTheme = getEnteTextTheme(context);
final mediaQuery = MediaQuery.of(context);
@@ -123,7 +126,7 @@ class _CommentLikesBottomSheetState extends State<CommentLikesBottomSheet> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
- "${_likes.length} ${_likes.length == 1 ? 'like' : 'likes'}",
+ l10n.likesCount(count: _likes.length),
style: textTheme.bodyBold,
),
IconButtonWidget(
@@ -144,7 +147,7 @@ class _CommentLikesBottomSheetState extends State<CommentLikesBottomSheet> {
padding:
const EdgeInsets.symmetric(vertical: 48, horizontal: 24),
child: Text(
- "No likes yet",
+ l10n.noLikesYet,
style: textTheme.smallMuted,
textAlign: TextAlign.center,
),
@@ -157,10 +160,11 @@ class _CommentLikesBottomSheetState extends State<CommentLikesBottomSheet> {
itemCount: _likes.length,
itemBuilder: (context, index) {
final reaction = _likes[index];
- final user = _getUserForReaction(reaction);
+ final user = _getUserForReaction(reaction, l10n.anonymous);
return _CommentLikeListItem(
user: user,
currentUserID: widget.currentUserID,
+ youLabel: l10n.you,
);
},
),
@@ -175,10 +179,12 @@ class _CommentLikesBottomSheetState extends State<CommentLikesBottomSheet> {
class _CommentLikeListItem extends StatelessWidget {
final User user;
final int currentUserID;
+ final String youLabel;
const _CommentLikeListItem({
required this.user,
required this.currentUserID,
+ required this.youLabel,
});
@override
@@ -199,7 +205,7 @@ class _CommentLikeListItem extends StatelessWidget {
Expanded(
child: Text(
user.id == currentUserID
- ? "You"
+ ? youLabel
: (user.displayName ?? user.email),
style: TextStyle(
fontSize: 14,
diff --git a/mobile/apps/photos/lib/ui/social/comments_screen.dart b/mobile/apps/photos/lib/ui/social/comments_screen.dart
index 6d14439800..f9439f0aec 100644
--- a/mobile/apps/photos/lib/ui/social/comments_screen.dart
+++ b/mobile/apps/photos/lib/ui/social/comments_screen.dart
@@ -6,6 +6,7 @@ import "package:photos/core/configuration.dart";
import "package:photos/core/event_bus.dart";
import "package:photos/db/files_db.dart";
import "package:photos/events/comment_deleted_event.dart";
+import "package:photos/generated/l10n.dart";
import "package:photos/models/api/collection/user.dart";
import "package:photos/models/collection/collection.dart";
import "package:photos/models/social/comment.dart";
@@ -388,15 +389,16 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
_inputFocusNode.requestFocus();
}
- User _getUserForComment(Comment comment) {
+ User _getUserForComment(Comment comment, {String? anonymousLabel}) {
if (_userCache.containsKey(comment.userID)) {
return _userCache[comment.userID]!;
}
if (comment.isAnonymous) {
final anonID = comment.anonUserID;
- final displayName =
- anonID != null ? (_anonDisplayNames[anonID] ?? anonID) : "Anonymous";
+ final displayName = anonID != null
+ ? (_anonDisplayNames[anonID] ?? anonID)
+ : (anonymousLabel ?? "Anonymous");
final user = User(
id: comment.userID,
email: "${anonID ?? "anonymous"}@unknown.com",
@@ -518,6 +520,7 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
}
Widget _buildHeader(BuildContext context) {
+ final l10n = AppLocalizations.of(context);
final textTheme = getEnteTextTheme(context);
return SingleChildScrollView(
controller: widget.dragController,
@@ -535,7 +538,7 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
onCollectionSelected: _onCollectionSelected,
)
: Text(
- "${_comments.length} comments",
+ l10n.commentsCount(count: _comments.length),
style: textTheme.bodyBold,
),
),
@@ -552,6 +555,7 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
@override
Widget build(BuildContext context) {
+ final l10n = AppLocalizations.of(context);
final colorScheme = getEnteColorScheme(context);
final keyboardHeight = MediaQuery.of(context).viewInsets.bottom;
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
@@ -560,6 +564,9 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
(selectedCollection.isOwner(_currentUserID) ||
selectedCollection.isAdmin(_currentUserID));
+ User userResolver(Comment comment) =>
+ _getUserForComment(comment, anonymousLabel: l10n.anonymous);
+
return Container(
decoration: BoxDecoration(
color: isDarkMode
@@ -611,7 +618,7 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
return CommentBubbleWidget(
key: key,
comment: comment,
- user: _getUserForComment(comment),
+ user: userResolver(comment),
isOwnComment: comment.userID == _currentUserID,
canModerateAnonComments: canModerateAnonComments,
currentUserID: _currentUserID,
@@ -625,7 +632,7 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
onFetchReactions: () =>
_getReactionsForComment(comment.id),
onReplyTap: () => _onReplyTap(comment),
- userResolver: _getUserForComment,
+ userResolver: userResolver,
onCommentDeleted: () =>
_handleCommentDeleted(comment.id),
onAutoHighlightDismissed: () {
@@ -641,9 +648,8 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
),
CommentInputWidget(
replyingTo: _replyingTo,
- replyingToUser: _replyingTo != null
- ? _getUserForComment(_replyingTo!)
- : null,
+ replyingToUser:
+ _replyingTo != null ? userResolver(_replyingTo!) : null,
currentUserID: _currentUserID,
onDismissReply: _dismissReply,
controller: _textController,
diff --git a/mobile/apps/photos/lib/ui/social/like_collection_selector_sheet.dart b/mobile/apps/photos/lib/ui/social/like_collection_selector_sheet.dart
index 08c397e1af..06d68c57b3 100644
--- a/mobile/apps/photos/lib/ui/social/like_collection_selector_sheet.dart
+++ b/mobile/apps/photos/lib/ui/social/like_collection_selector_sheet.dart
@@ -3,6 +3,7 @@ import "package:flutter/material.dart";
import "package:logging/logging.dart";
import "package:photos/core/constants.dart";
import "package:photos/db/files_db.dart";
+import "package:photos/generated/l10n.dart";
import "package:photos/models/collection/collection.dart";
import "package:photos/models/file/extensions/file_props.dart";
import "package:photos/models/file/file.dart";
@@ -159,7 +160,10 @@ class _LikeCollectionSelectorSheetState
_logger.severe("Failed to toggle like", e);
if (mounted) {
setState(() => state.isLiked = previousState);
- showShortToast(context, "Failed to update like");
+ showShortToast(
+ context,
+ AppLocalizations.of(context).failedToUpdateLike,
+ );
}
}
}
@@ -209,10 +213,10 @@ class _LikeCollectionSelectorSheetState
c.isLiked = false;
}
});
- final msg = failed.length == 1
- ? "Failed to like 1 album"
- : "Failed to like ${failed.length} albums";
- showShortToast(context, msg);
+ showShortToast(
+ context,
+ AppLocalizations.of(context).failedToLikeAlbums(count: failed.length),
+ );
// Don't close sheet - let user retry
return;
}
@@ -325,12 +329,13 @@ class _LikeCollectionSelectorSheetState
}
Widget _buildErrorState() {
+ final l10n = AppLocalizations.of(context);
final textTheme = getEnteTextTheme(context);
return Padding(
padding: const EdgeInsets.symmetric(vertical: 48, horizontal: 24),
child: Text(
- "Could not load albums",
+ l10n.couldNotLoadAlbums,
style: textTheme.smallMuted,
textAlign: TextAlign.center,
),
@@ -351,6 +356,7 @@ class _AlbumsHeader extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final l10n = AppLocalizations.of(context);
final textTheme = getEnteTextTheme(context);
final colorScheme = getEnteColorScheme(context);
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
@@ -361,7 +367,7 @@ class _AlbumsHeader extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
- "$albumCount ${albumCount == 1 ? 'Album' : 'Albums'}",
+ l10n.albumsCount(count: albumCount),
style: textTheme.small,
),
GestureDetector(
@@ -377,7 +383,7 @@ class _AlbumsHeader extends StatelessWidget {
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
- Text("Like all", style: textTheme.small),
+ Text(l10n.likeAll, style: textTheme.small),
const SizedBox(width: 10),
Icon(
allLiked ? EnteIcons.likeFilled : EnteIcons.likeStroke,
@@ -399,23 +405,23 @@ class _TitleSection extends StatelessWidget {
const _TitleSection({required this.isVideo});
- String get _subtitle => isVideo
- ? "Select the album to like this video"
- : "Select the album to like this photo";
-
@override
Widget build(BuildContext context) {
+ final l10n = AppLocalizations.of(context);
final textTheme = getEnteTextTheme(context);
final colorScheme = getEnteColorScheme(context);
+ final subtitle =
+ isVideo ? l10n.selectAlbumToLikeVideo : l10n.selectAlbumToLikePhoto;
+
return Padding(
padding: const EdgeInsets.only(top: 27, bottom: 9),
child: Column(
children: [
- Text("Like", style: textTheme.h3Bold),
+ Text(l10n.like, style: textTheme.h3Bold),
const SizedBox(height: 9),
Text(
- _subtitle,
+ subtitle,
style: textTheme.small.copyWith(color: colorScheme.textMuted),
textAlign: TextAlign.center,
),
diff --git a/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart b/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
index ec747dbe7b..555a995e26 100644
--- a/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
+++ b/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
@@ -5,6 +5,7 @@ import "package:flutter/material.dart";
import "package:photos/core/configuration.dart";
import "package:photos/db/files_db.dart";
import "package:photos/extensions/user_extension.dart";
+import "package:photos/generated/l10n.dart";
import "package:photos/models/api/collection/user.dart";
import "package:photos/models/collection/collection.dart";
import "package:photos/models/social/reaction.dart";
@@ -283,6 +284,7 @@ class _LikesHeader extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final l10n = AppLocalizations.of(context);
final textTheme = getEnteTextTheme(context);
return Padding(
@@ -298,7 +300,7 @@ class _LikesHeader extends StatelessWidget {
onCollectionSelected: onCollectionSelected,
)
: Text(
- "$likesCount ${likesCount == 1 ? 'like' : 'likes'}",
+ l10n.likesCount(count: likesCount),
style: textTheme.bodyBold,
),
),
@@ -318,12 +320,13 @@ class _EmptyState extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final l10n = AppLocalizations.of(context);
final textTheme = getEnteTextTheme(context);
return Padding(
padding: const EdgeInsets.symmetric(vertical: 48, horizontal: 24),
child: Text(
- "No likes yet",
+ l10n.noLikesYet,
style: textTheme.smallMuted,
textAlign: TextAlign.center,
),
@@ -336,12 +339,13 @@ class _ErrorState extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final l10n = AppLocalizations.of(context);
final textTheme = getEnteTextTheme(context);
return Padding(
padding: const EdgeInsets.symmetric(vertical: 48, horizontal: 24),
child: Text(
- "Could not load likes",
+ l10n.couldNotLoadLikes,
style: textTheme.smallMuted,
textAlign: TextAlign.center,
),
@@ -362,11 +366,12 @@ class _LikesList extends StatelessWidget {
required this.anonDisplayNames,
});
- User _getUserForReaction(Reaction reaction) {
+ User _getUserForReaction(Reaction reaction, String anonymousLabel) {
if (reaction.isAnonymous) {
final anonID = reaction.anonUserID;
- final displayName =
- anonID != null ? (anonDisplayNames[anonID] ?? anonID) : "Anonymous";
+ final displayName = anonID != null
+ ? (anonDisplayNames[anonID] ?? anonID)
+ : anonymousLabel;
return User(
id: reaction.userID,
email: "${anonID ?? "anonymous"}@unknown.com",
@@ -380,16 +385,19 @@ class _LikesList extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final l10n = AppLocalizations.of(context);
+
return ListView.builder(
shrinkWrap: likes.length <= _shrinkWrapThreshold,
padding: const EdgeInsets.fromLTRB(16, 8, 16, 16),
itemCount: likes.length,
itemBuilder: (context, index) {
final reaction = likes[index];
- final user = _getUserForReaction(reaction);
+ final user = _getUserForReaction(reaction, l10n.anonymous);
return _LikeListItem(
user: user,
currentUserID: currentUserID,
+ youLabel: l10n.you,
);
},
);
@@ -399,10 +407,12 @@ class _LikesList extends StatelessWidget {
class _LikeListItem extends StatelessWidget {
final User user;
final int currentUserID;
+ final String youLabel;
const _LikeListItem({
required this.user,
required this.currentUserID,
+ required this.youLabel,
});
@override
@@ -423,7 +433,7 @@ class _LikeListItem extends StatelessWidget {
Expanded(
child: Text(
user.id == currentUserID
- ? "You"
+ ? youLabel
: (user.displayName ?? user.email),
style: TextStyle(
fontSize: 14,
diff --git a/mobile/apps/photos/lib/ui/social/widgets/comment_actions_popup.dart b/mobile/apps/photos/lib/ui/social/widgets/comment_actions_popup.dart
index 1f4cc9b97a..03b405a131 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/comment_actions_popup.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/comment_actions_popup.dart
@@ -1,5 +1,6 @@
import "package:ente_icons/ente_icons.dart";
import "package:flutter/material.dart";
+import "package:photos/generated/l10n.dart";
import "package:photos/theme/ente_theme.dart";
class CommentActionsPopup extends StatelessWidget {
@@ -20,6 +21,7 @@ class CommentActionsPopup extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final l10n = AppLocalizations.of(context);
final colorScheme = getEnteColorScheme(context);
final textTheme = getEnteTextTheme(context);
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
@@ -40,7 +42,7 @@ class CommentActionsPopup extends StatelessWidget {
_ActionItem(
icon: isLiked ? EnteIcons.likeFilled : EnteIcons.likeStroke,
iconColor: isLiked ? const Color(0xFFE25454) : null,
- label: "Like",
+ label: l10n.like,
onTap: onLikeTap,
textStyle: textTheme.mini.copyWith(
height: 19 / 12,
@@ -50,7 +52,7 @@ class CommentActionsPopup extends StatelessWidget {
),
_ActionItem(
icon: EnteIcons.reply,
- label: "Reply",
+ label: l10n.reply,
onTap: onReplyTap,
textStyle: textTheme.mini.copyWith(
height: 19 / 12,
@@ -61,7 +63,7 @@ class CommentActionsPopup extends StatelessWidget {
if (showDelete)
_ActionItem(
icon: Icons.delete_outline_rounded,
- label: "Delete",
+ label: l10n.delete,
onTap: onDeleteTap!,
textStyle: textTheme.mini.copyWith(
height: 19 / 12,
diff --git a/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
index 9716b9f9c5..3390e7f6ba 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/comment_bubble_widget.dart
@@ -7,6 +7,7 @@ import "package:logging/logging.dart";
import "package:photos/core/event_bus.dart";
import "package:photos/events/comment_deleted_event.dart";
import "package:photos/extensions/user_extension.dart";
+import "package:photos/generated/l10n.dart";
import "package:photos/models/api/collection/user.dart";
import "package:photos/models/social/comment.dart";
import "package:photos/models/social/reaction.dart";
@@ -220,7 +221,10 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget>
_isLiked = previousState;
_optimisticLikeDelta = previousDelta;
});
- showShortToast(context, "Failed to like comment");
+ showShortToast(
+ context,
+ AppLocalizations.of(context).failedToLikeComment,
+ );
}
return;
}
@@ -314,7 +318,10 @@ class _CommentBubbleWidgetState extends State<CommentBubbleWidget>
} catch (e) {
_logger.severe("Failed to delete comment", e);
if (mounted) {
- showShortToast(context, "Failed to delete comment");
+ showShortToast(
+ context,
+ AppLocalizations.of(context).failedToDeleteComment,
+ );
}
}
}
@@ -604,6 +611,7 @@ class _InlineParentQuote extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final l10n = AppLocalizations.of(context);
final textTheme = getEnteTextTheme(context);
if (isLoading) {
@@ -617,12 +625,13 @@ class _InlineParentQuote extends StatelessWidget {
}
final isParentDeleted = parentComment == null;
- final parentText = isParentDeleted ? "(deleted)" : parentComment!.data;
+ final parentText =
+ isParentDeleted ? l10n.deletedComment : parentComment!.data;
final parentUser =
parentComment != null ? userResolver(parentComment!) : null;
final parentAuthor = parentComment != null
? (parentUser!.id == currentUserID
- ? 'You'
+ ? l10n.you
: (parentUser.displayName ?? parentUser.email))
: null;
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
diff --git a/mobile/apps/photos/lib/ui/social/widgets/comment_input_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/comment_input_widget.dart
index e6dcedf283..295683100d 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/comment_input_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/comment_input_widget.dart
@@ -1,6 +1,7 @@
import "package:ente_icons/ente_icons.dart";
import "package:flutter/material.dart";
import "package:flutter/services.dart";
+import "package:photos/generated/l10n.dart";
import "package:photos/models/api/collection/user.dart";
import "package:photos/models/social/comment.dart";
import "package:photos/theme/ente_theme.dart";
@@ -84,6 +85,7 @@ class _CommentInputWidgetState extends State<CommentInputWidget>
@override
Widget build(BuildContext context) {
+ final l10n = AppLocalizations.of(context);
final colorScheme = getEnteColorScheme(context);
final textTheme = getEnteTextTheme(context);
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
@@ -147,7 +149,7 @@ class _CommentInputWidgetState extends State<CommentInputWidget>
color: colorScheme.textBase.withValues(alpha: 0.8),
),
decoration: InputDecoration(
- hintText: "Say something nice!",
+ hintText: l10n.commentHint,
hintStyle: textTheme.body.copyWith(
color: colorScheme.textMuted,
),
diff --git a/mobile/apps/photos/lib/ui/social/widgets/delete_comment_confirmation_dialog.dart b/mobile/apps/photos/lib/ui/social/widgets/delete_comment_confirmation_dialog.dart
index c3abd74c62..5ee335845a 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/delete_comment_confirmation_dialog.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/delete_comment_confirmation_dialog.dart
@@ -1,4 +1,5 @@
import "package:flutter/material.dart";
+import "package:photos/generated/l10n.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/common/gradient_button.dart";
import "package:photos/ui/components/buttons/icon_button_widget.dart";
@@ -34,6 +35,7 @@ class _DeleteCommentConfirmationSheet extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final l10n = AppLocalizations.of(context);
final textTheme = getEnteTextTheme(context);
final colorScheme = getEnteColorScheme(context);
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
@@ -78,13 +80,13 @@ class _DeleteCommentConfirmationSheet extends StatelessWidget {
],
),
Text(
- "Are you sure?",
+ l10n.areYouSure,
style: textTheme.h3Bold,
textAlign: TextAlign.center,
),
const SizedBox(height: 12),
Text(
- 'Your comment "$truncatedComment" will be deleted permanently',
+ l10n.deleteCommentConfirmation(comment: truncatedComment),
style: textTheme.body.copyWith(color: colorScheme.textMuted),
textAlign: TextAlign.center,
),
@@ -93,7 +95,7 @@ class _DeleteCommentConfirmationSheet extends StatelessWidget {
width: double.infinity,
child: GradientButton(
onTap: () => Navigator.of(context).pop(true),
- text: "Delete comment",
+ text: l10n.deleteComment,
linearGradientColors: const [
Color(0xFFF63A3A),
Color(0xFFF63A3A),
diff --git a/mobile/apps/photos/lib/ui/social/widgets/reply_preview_widget.dart b/mobile/apps/photos/lib/ui/social/widgets/reply_preview_widget.dart
index ceb663583e..32248aec8b 100644
--- a/mobile/apps/photos/lib/ui/social/widgets/reply_preview_widget.dart
+++ b/mobile/apps/photos/lib/ui/social/widgets/reply_preview_widget.dart
@@ -1,5 +1,6 @@
import "package:flutter/material.dart";
import "package:photos/extensions/user_extension.dart";
+import "package:photos/generated/l10n.dart";
import "package:photos/models/api/collection/user.dart";
import "package:photos/models/social/comment.dart";
import "package:photos/theme/ente_theme.dart";
@@ -20,6 +21,7 @@ class ReplyPreviewWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
+ final l10n = AppLocalizations.of(context);
final colorScheme = getEnteColorScheme(context);
final textTheme = getEnteTextTheme(context);
@@ -50,8 +52,11 @@ class ReplyPreviewWidget extends StatelessWidget {
children: [
Text(
replyingToUser.id == currentUserID
- ? 'Replying to you'
- : 'Replying to ${replyingToUser.displayName ?? replyingToUser.email}',
+ ? l10n.replyingToYou
+ : l10n.replyingTo(
+ name: replyingToUser.displayName ??
+ replyingToUser.email,
+ ),
style: textTheme.tiny.copyWith(
color: colorScheme.textBase,
height: 14 / 10.0,
diff --git a/mobile/apps/photos/plugins/ente_feature_flag/lib/src/service.dart b/mobile/apps/photos/plugins/ente_feature_flag/lib/src/service.dart
index 195e3cc225..866b2d21b1 100644
--- a/mobile/apps/photos/plugins/ente_feature_flag/lib/src/service.dart
+++ b/mobile/apps/photos/plugins/ente_feature_flag/lib/src/service.dart
@@ -13,7 +13,8 @@ import "model.dart";
class FlagService {
static const int _uploadV2Flag = 1 << 0;
- static const int _commentsFlag = 1 << 1; // Keep in sync with server/ente/remotestore.go
+ static const int _commentsFlag =
+ 1 << 1; // Keep in sync with server/ente/remotestore.go
static const int _backupOptionsFlag = 1 << 2;
final SharedPreferences _prefs;
@@ -96,7 +97,8 @@ class FlagService {
bool get enableShareePin => true;
- bool get isSocialEnabled => internalUser || _isServerFlagEnabled(_commentsFlag);
+ bool get isSocialEnabled =>
+ internalUser || _isServerFlagEnabled(_commentsFlag);
Future<void> tryRefreshFlags() async {
try {