Skip to content

armgit / ente

Public Imported from GitHub
0

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

Remove anonymous string from localization

ashilkn0654f903be47
diff --git a/mobile/apps/photos/lib/l10n/intl_en.arb b/mobile/apps/photos/lib/l10n/intl_en.arb
index 7a772c043a..64617bb986 100644
--- a/mobile/apps/photos/lib/l10n/intl_en.arb
+++ b/mobile/apps/photos/lib/l10n/intl_en.arb
@@ -2388,10 +2388,6 @@
}
}
},
- "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",
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 63ee17d09e..493a6075af 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
@@ -81,12 +81,11 @@ class _CommentLikesBottomSheetState extends State<CommentLikesBottomSheet> {
}
}
- User _getUserForReaction(Reaction reaction, String anonymousLabel) {
+ User _getUserForReaction(Reaction reaction) {
if (reaction.isAnonymous) {
final anonID = reaction.anonUserID;
- final displayName = anonID != null
- ? (_anonDisplayNames[anonID] ?? anonID)
- : anonymousLabel;
+ final displayName =
+ anonID != null ? (_anonDisplayNames[anonID] ?? anonID) : "Anonymous";
return User(
id: reaction.userID,
email: "${anonID ?? "anonymous"}@unknown.com",
@@ -160,7 +159,7 @@ class _CommentLikesBottomSheetState extends State<CommentLikesBottomSheet> {
itemCount: _likes.length,
itemBuilder: (context, index) {
final reaction = _likes[index];
- final user = _getUserForReaction(reaction, l10n.anonymous);
+ final user = _getUserForReaction(reaction);
return _CommentLikeListItem(
user: user,
currentUserID: widget.currentUserID,
diff --git a/mobile/apps/photos/lib/ui/social/comments_screen.dart b/mobile/apps/photos/lib/ui/social/comments_screen.dart
index f9439f0aec..8b83718a05 100644
--- a/mobile/apps/photos/lib/ui/social/comments_screen.dart
+++ b/mobile/apps/photos/lib/ui/social/comments_screen.dart
@@ -389,16 +389,15 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
_inputFocusNode.requestFocus();
}
- User _getUserForComment(Comment comment, {String? anonymousLabel}) {
+ User _getUserForComment(Comment comment) {
if (_userCache.containsKey(comment.userID)) {
return _userCache[comment.userID]!;
}
if (comment.isAnonymous) {
final anonID = comment.anonUserID;
- final displayName = anonID != null
- ? (_anonDisplayNames[anonID] ?? anonID)
- : (anonymousLabel ?? "Anonymous");
+ final displayName =
+ anonID != null ? (_anonDisplayNames[anonID] ?? anonID) : "Anonymous";
final user = User(
id: comment.userID,
email: "${anonID ?? "anonymous"}@unknown.com",
@@ -555,7 +554,6 @@ 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;
@@ -564,9 +562,6 @@ 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
@@ -618,7 +613,7 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
return CommentBubbleWidget(
key: key,
comment: comment,
- user: userResolver(comment),
+ user: _getUserForComment(comment),
isOwnComment: comment.userID == _currentUserID,
canModerateAnonComments: canModerateAnonComments,
currentUserID: _currentUserID,
@@ -632,7 +627,7 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
onFetchReactions: () =>
_getReactionsForComment(comment.id),
onReplyTap: () => _onReplyTap(comment),
- userResolver: userResolver,
+ userResolver: _getUserForComment,
onCommentDeleted: () =>
_handleCommentDeleted(comment.id),
onAutoHighlightDismissed: () {
@@ -648,8 +643,9 @@ class _FileCommentsBottomSheetState extends State<FileCommentsBottomSheet> {
),
CommentInputWidget(
replyingTo: _replyingTo,
- replyingToUser:
- _replyingTo != null ? userResolver(_replyingTo!) : null,
+ replyingToUser: _replyingTo != null
+ ? _getUserForComment(_replyingTo!)
+ : null,
currentUserID: _currentUserID,
onDismissReply: _dismissReply,
controller: _textController,
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 555a995e26..998a986cbe 100644
--- a/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
+++ b/mobile/apps/photos/lib/ui/social/likes_bottom_sheet.dart
@@ -366,12 +366,11 @@ class _LikesList extends StatelessWidget {
required this.anonDisplayNames,
});
- User _getUserForReaction(Reaction reaction, String anonymousLabel) {
+ User _getUserForReaction(Reaction reaction) {
if (reaction.isAnonymous) {
final anonID = reaction.anonUserID;
- final displayName = anonID != null
- ? (anonDisplayNames[anonID] ?? anonID)
- : anonymousLabel;
+ final displayName =
+ anonID != null ? (anonDisplayNames[anonID] ?? anonID) : "Anonymous";
return User(
id: reaction.userID,
email: "${anonID ?? "anonymous"}@unknown.com",
@@ -393,7 +392,7 @@ class _LikesList extends StatelessWidget {
itemCount: likes.length,
itemBuilder: (context, index) {
final reaction = likes[index];
- final user = _getUserForReaction(reaction, l10n.anonymous);
+ final user = _getUserForReaction(reaction);
return _LikeListItem(
user: user,
currentUserID: currentUserID,