From 5fb86ed4ac795a9774be77c13d44cbe89febebcd Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 16 Oct 2024 04:04:46 +0200 Subject: [PATCH 1/5] Add support for Akkoma's `move` notification type --- src/components/ICONS.jsx | 1 + src/components/notification.jsx | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/components/ICONS.jsx b/src/components/ICONS.jsx index cac8190bf..e540ff523 100644 --- a/src/components/ICONS.jsx +++ b/src/components/ICONS.jsx @@ -174,4 +174,5 @@ export const ICONS = { 'heart-break': () => import('@iconify-icons/mingcute/heart-crack-line'), 'user-x': () => import('@iconify-icons/mingcute/user-x-line'), minimize: () => import('@iconify-icons/mingcute/arrows-down-line'), + suitcase: () => import('@iconify-icons/mingcute/suitcase-line'), }; diff --git a/src/components/notification.jsx b/src/components/notification.jsx index dc864bbf8..f86c582a4 100644 --- a/src/components/notification.jsx +++ b/src/components/notification.jsx @@ -33,6 +33,7 @@ const NOTIFICATION_ICONS = { moderation_warning: 'alert', emoji_reaction: 'emoji2', 'pleroma:emoji_reaction': 'emoji2', + move: 'suitcase', }; /* @@ -261,6 +262,13 @@ const contentText = { ), emoji_reaction: emojiText, 'pleroma:emoji_reaction': emojiText, + move: ({ account, targetAccount }) => { + return ( + + {account} moved to {targetAccount}. + + ); + }, }; // account_suspension, domain_block, user_domain_block @@ -309,6 +317,7 @@ function Notification({ id, status, account, + target, // Pleroma move event report, event, moderation_warning, @@ -324,6 +333,10 @@ function Notification({ } = notification; let { type } = notification; + if (type === 'move') { + console.debug('NOTIFS', notification); + } + if (type === 'mention' && !status) { // Could be deleted return null; @@ -409,6 +422,11 @@ function Notification({ emoji: notification.emoji, emojiURL, }); + } else if (type === 'move') { + text = text({ + account: , + targetAccount: , + }); } else { text = text({ account: account ? ( From 1afc2cecaed13ac132f01e78fc3e2b517b64123f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 16 Oct 2024 04:19:35 +0200 Subject: [PATCH 2/5] Po files as usual --- src/locales/en.po | 112 ++++++++++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 54 deletions(-) diff --git a/src/locales/en.po b/src/locales/en.po index 38a3e8953..8f49ce9fa 100644 --- a/src/locales/en.po +++ b/src/locales/en.po @@ -144,7 +144,7 @@ msgstr "" #: src/components/account-info.jsx:599 msgid "Go to original profile page" -msgstr "" +msgstr "Go to original profile page" #: src/components/account-info.jsx:606 msgid "View profile image" @@ -224,7 +224,7 @@ msgstr "" #: src/components/account-info.jsx:1151 msgid "Mention <0>@{username}" -msgstr "" +msgstr "Mention <0>@{username}" #: src/components/account-info.jsx:1163 msgid "Translate bio" @@ -248,27 +248,27 @@ msgstr "" #: src/components/account-info.jsx:1207 msgid "Disable notifications" -msgstr "" +msgstr "Disable notifications" #: src/components/account-info.jsx:1208 msgid "Enable notifications" -msgstr "" +msgstr "Enable notifications" #: src/components/account-info.jsx:1225 msgid "Boosts from @{username} enabled." -msgstr "" +msgstr "Boosts from @{username} enabled." #: src/components/account-info.jsx:1226 msgid "Boosts from @{username} disabled." -msgstr "" +msgstr "Boosts from @{username} disabled." #: src/components/account-info.jsx:1237 msgid "Disable boosts" -msgstr "" +msgstr "Disable boosts" #: src/components/account-info.jsx:1237 msgid "Enable boosts" -msgstr "" +msgstr "Enable boosts" #: src/components/account-info.jsx:1253 #: src/components/account-info.jsx:1263 @@ -279,12 +279,12 @@ msgstr "" #: src/components/account-info.jsx:1302 #: src/components/status.jsx:1143 msgid "Link copied" -msgstr "" +msgstr "Link copied" #: src/components/account-info.jsx:1305 #: src/components/status.jsx:1146 msgid "Unable to copy link" -msgstr "" +msgstr "Unable to copy link" #: src/components/account-info.jsx:1311 #: src/components/shortcuts-settings.jsx:1059 @@ -302,7 +302,7 @@ msgstr "" #: src/components/account-info.jsx:1332 #: src/components/status.jsx:1174 msgid "Share…" -msgstr "" +msgstr "Share…" #: src/components/account-info.jsx:1352 msgid "Unmuted @{username}" @@ -955,7 +955,7 @@ msgid "Nothing to show" msgstr "" #: src/components/generic-accounts.jsx:145 -#: src/components/notification.jsx:438 +#: src/components/notification.jsx:456 #: src/pages/accounts.jsx:41 #: src/pages/search.jsx:227 #: src/pages/search.jsx:260 @@ -1396,134 +1396,138 @@ msgstr "" msgid "View all notifications" msgstr "" -#: src/components/notification.jsx:70 +#: src/components/notification.jsx:71 msgid "{account} reacted to your post with {emojiObject}" msgstr "" -#: src/components/notification.jsx:77 +#: src/components/notification.jsx:78 msgid "{account} published a post." msgstr "" -#: src/components/notification.jsx:85 +#: src/components/notification.jsx:86 msgid "{count, plural, =1 {{postsCount, plural, =1 {{postType, select, reply {{account} boosted your reply.} other {{account} boosted your post.}}} other {{account} boosted {postsCount} of your posts.}}} other {{postType, select, reply {<0><1>{0} people boosted your reply.} other {<2><3>{1} people boosted your post.}}}}" msgstr "" -#: src/components/notification.jsx:128 +#: src/components/notification.jsx:129 msgid "{count, plural, =1 {{account} followed you.} other {<0><1>{0} people followed you.}}" msgstr "" -#: src/components/notification.jsx:142 +#: src/components/notification.jsx:143 msgid "{account} requested to follow you." msgstr "" -#: src/components/notification.jsx:151 +#: src/components/notification.jsx:152 msgid "{count, plural, =1 {{postsCount, plural, =1 {{postType, select, reply {{account} liked your reply.} other {{account} liked your post.}}} other {{account} liked {postsCount} of your posts.}}} other {{postType, select, reply {<0><1>{0} people liked your reply.} other {<2><3>{1} people liked your post.}}}}" msgstr "" -#: src/components/notification.jsx:193 +#: src/components/notification.jsx:194 msgid "A poll you have voted in or created has ended." msgstr "" -#: src/components/notification.jsx:194 +#: src/components/notification.jsx:195 msgid "A poll you have created has ended." msgstr "" -#: src/components/notification.jsx:195 +#: src/components/notification.jsx:196 msgid "A poll you have voted in has ended." msgstr "" -#: src/components/notification.jsx:196 +#: src/components/notification.jsx:197 msgid "A post you interacted with has been edited." msgstr "" -#: src/components/notification.jsx:204 +#: src/components/notification.jsx:205 msgid "{count, plural, =1 {{postsCount, plural, =1 {{postType, select, reply {{account} boosted & liked your reply.} other {{account} boosted & liked your post.}}} other {{account} boosted & liked {postsCount} of your posts.}}} other {{postType, select, reply {<0><1>{0} people boosted & liked your reply.} other {<2><3>{1} people boosted & liked your post.}}}}" msgstr "" -#: src/components/notification.jsx:246 +#: src/components/notification.jsx:247 msgid "{account} signed up." msgstr "" -#: src/components/notification.jsx:248 +#: src/components/notification.jsx:249 msgid "{account} reported {targetAccount}" msgstr "" -#: src/components/notification.jsx:253 +#: src/components/notification.jsx:254 msgid "Lost connections with <0>{name}." msgstr "" -#: src/components/notification.jsx:259 +#: src/components/notification.jsx:260 msgid "Moderation warning" msgstr "" -#: src/components/notification.jsx:269 +#: src/components/notification.jsx:267 +msgid "{account} moved to {targetAccount}." +msgstr "{account} moved to {targetAccount}." + +#: src/components/notification.jsx:277 msgid "An admin from <0>{from} has suspended <1>{targetName}, which means you can no longer receive updates from them or interact with them." msgstr "" -#: src/components/notification.jsx:275 +#: src/components/notification.jsx:283 msgid "An admin from <0>{from} has blocked <1>{targetName}. Affected followers: {followersCount}, followings: {followingCount}." msgstr "" -#: src/components/notification.jsx:281 +#: src/components/notification.jsx:289 msgid "You have blocked <0>{targetName}. Removed followers: {followersCount}, followings: {followingCount}." msgstr "" -#: src/components/notification.jsx:289 +#: src/components/notification.jsx:297 msgid "Your account has received a moderation warning." msgstr "" -#: src/components/notification.jsx:290 +#: src/components/notification.jsx:298 msgid "Your account has been disabled." msgstr "" -#: src/components/notification.jsx:291 +#: src/components/notification.jsx:299 msgid "Some of your posts have been marked as sensitive." msgstr "" -#: src/components/notification.jsx:292 +#: src/components/notification.jsx:300 msgid "Some of your posts have been deleted." msgstr "" -#: src/components/notification.jsx:293 +#: src/components/notification.jsx:301 msgid "Your posts will be marked as sensitive from now on." msgstr "" -#: src/components/notification.jsx:294 +#: src/components/notification.jsx:302 msgid "Your account has been limited." msgstr "" -#: src/components/notification.jsx:295 +#: src/components/notification.jsx:303 msgid "Your account has been suspended." msgstr "" -#: src/components/notification.jsx:369 +#: src/components/notification.jsx:382 msgid "[Unknown notification type: {type}]" msgstr "" -#: src/components/notification.jsx:434 +#: src/components/notification.jsx:452 #: src/components/status.jsx:1002 #: src/components/status.jsx:1012 msgid "Boosted/Liked by…" msgstr "" -#: src/components/notification.jsx:435 +#: src/components/notification.jsx:453 msgid "Liked by…" msgstr "" -#: src/components/notification.jsx:436 +#: src/components/notification.jsx:454 msgid "Boosted by…" msgstr "" -#: src/components/notification.jsx:437 +#: src/components/notification.jsx:455 msgid "Followed by…" msgstr "" -#: src/components/notification.jsx:508 -#: src/components/notification.jsx:524 +#: src/components/notification.jsx:526 +#: src/components/notification.jsx:542 msgid "Learn more <0/>" msgstr "" -#: src/components/notification.jsx:756 +#: src/components/notification.jsx:774 #: src/components/status.jsx:211 msgid "Read more →" msgstr "" @@ -1731,11 +1735,11 @@ msgstr "" #: src/components/shortcuts-settings.jsx:51 msgid "Public (Local / Federated)" -msgstr "" +msgstr "Public (Local / Federated)" #: src/components/shortcuts-settings.jsx:53 msgid "Account" -msgstr "" +msgstr "Account" #: src/components/shortcuts-settings.jsx:56 msgid "Hashtag" @@ -1747,7 +1751,7 @@ msgstr "" #: src/components/shortcuts-settings.jsx:70 msgid "Local only" -msgstr "" +msgstr "Local only" #: src/components/shortcuts-settings.jsx:75 #: src/components/shortcuts-settings.jsx:84 @@ -2025,11 +2029,11 @@ msgstr "" #: src/components/status.jsx:756 msgid "Unliked @{0}'s post" -msgstr "" +msgstr "Unliked @{0}'s post" #: src/components/status.jsx:757 msgid "Liked @{0}'s post" -msgstr "" +msgstr "Liked @{0}'s post" #: src/components/status.jsx:796 msgid "Unbookmarked @{0}'s post" @@ -2095,7 +2099,7 @@ msgstr "" #: src/components/status.jsx:1096 msgid "View post by <0>@{0}" -msgstr "" +msgstr "View post by <0>@{0}" #: src/components/status.jsx:1117 msgid "Show Edit History" @@ -2205,7 +2209,7 @@ msgstr "" #: src/components/status.jsx:1916 msgid "Thread{0}" -msgstr "" +msgstr "Thread{0}" #: src/components/status.jsx:1992 #: src/components/status.jsx:2054 @@ -2338,7 +2342,7 @@ msgstr "" #: src/components/timeline.jsx:968 msgid "<0>Filtered: <1>{0}" -msgstr "" +msgstr "<0>Filtered: <1>{0}" #: src/components/translation-block.jsx:152 msgid "Auto-translated from {sourceLangText}" @@ -3486,7 +3490,7 @@ msgstr "" #: src/pages/settings.jsx:783 msgid "Privacy Policy" -msgstr "" +msgstr "Privacy Policy" #: src/pages/settings.jsx:790 msgid "<0>Site: {0}" From 568160e8d5dca18c7e927f7b95fe07dd012b31be Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 16 Oct 2024 04:22:59 +0200 Subject: [PATCH 3/5] Remove debug log call --- src/components/notification.jsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/components/notification.jsx b/src/components/notification.jsx index f86c582a4..c90ebd169 100644 --- a/src/components/notification.jsx +++ b/src/components/notification.jsx @@ -333,10 +333,6 @@ function Notification({ } = notification; let { type } = notification; - if (type === 'move') { - console.debug('NOTIFS', notification); - } - if (type === 'mention' && !status) { // Could be deleted return null; From 1b6d8ab99030cce69a0378ca8cba0dffa4d0df2d Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 6 Nov 2024 01:37:51 +0100 Subject: [PATCH 4/5] Force username display in move activities and prevent line wrapping --- src/components/name-text.jsx | 2 +- src/components/notification.jsx | 4 ++-- src/locales/en.po | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/name-text.jsx b/src/components/name-text.jsx index 82fa8c073..218e369e8 100644 --- a/src/components/name-text.jsx +++ b/src/components/name-text.jsx @@ -123,7 +123,7 @@ function NameText({ )} {showAcct && ( <> -
+ {' '} {acct2 ? '' : '@'} {acct1} diff --git a/src/components/notification.jsx b/src/components/notification.jsx index c90ebd169..9ed2cbe12 100644 --- a/src/components/notification.jsx +++ b/src/components/notification.jsx @@ -420,8 +420,8 @@ function Notification({ }); } else if (type === 'move') { text = text({ - account: , - targetAccount: , + account: , + targetAccount: , }); } else { text = text({ diff --git a/src/locales/en.po b/src/locales/en.po index 8f49ce9fa..7857c31d7 100644 --- a/src/locales/en.po +++ b/src/locales/en.po @@ -955,7 +955,7 @@ msgid "Nothing to show" msgstr "" #: src/components/generic-accounts.jsx:145 -#: src/components/notification.jsx:456 +#: src/components/notification.jsx:452 #: src/pages/accounts.jsx:41 #: src/pages/search.jsx:227 #: src/pages/search.jsx:260 @@ -1500,34 +1500,34 @@ msgstr "" msgid "Your account has been suspended." msgstr "" -#: src/components/notification.jsx:382 +#: src/components/notification.jsx:378 msgid "[Unknown notification type: {type}]" msgstr "" -#: src/components/notification.jsx:452 +#: src/components/notification.jsx:448 #: src/components/status.jsx:1002 #: src/components/status.jsx:1012 msgid "Boosted/Liked by…" msgstr "" -#: src/components/notification.jsx:453 +#: src/components/notification.jsx:449 msgid "Liked by…" msgstr "" -#: src/components/notification.jsx:454 +#: src/components/notification.jsx:450 msgid "Boosted by…" msgstr "" -#: src/components/notification.jsx:455 +#: src/components/notification.jsx:451 msgid "Followed by…" msgstr "" -#: src/components/notification.jsx:526 -#: src/components/notification.jsx:542 +#: src/components/notification.jsx:522 +#: src/components/notification.jsx:538 msgid "Learn more <0/>" msgstr "" -#: src/components/notification.jsx:774 +#: src/components/notification.jsx:770 #: src/components/status.jsx:211 msgid "Read more →" msgstr "" From f2b345bf9b6e26f4c4548ecf9c929390ceaa111c Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 9 Dec 2024 05:54:13 +0100 Subject: [PATCH 5/5] Localization --- src/locales/en.po | 76 +++++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/src/locales/en.po b/src/locales/en.po index 34b2b02bc..24deb9d8e 100644 --- a/src/locales/en.po +++ b/src/locales/en.po @@ -963,7 +963,7 @@ msgid "Nothing to show" msgstr "" #: src/components/generic-accounts.jsx:145 -#: src/components/notification.jsx:445 +#: src/components/notification.jsx:459 #: src/pages/accounts.jsx:41 #: src/pages/search.jsx:317 #: src/pages/search.jsx:350 @@ -1412,142 +1412,146 @@ msgstr "" msgid "View all notifications" msgstr "" -#: src/components/notification.jsx:71 +#: src/components/notification.jsx:72 msgid "{account} reacted to your post with {emojiObject}" msgstr "" -#: src/components/notification.jsx:78 +#: src/components/notification.jsx:79 msgid "{account} published a post." msgstr "" -#: src/components/notification.jsx:86 +#: src/components/notification.jsx:87 msgid "{count, plural, =1 {{postsCount, plural, =1 {{postType, select, reply {{account} boosted your reply.} other {{account} boosted your post.}}} other {{account} boosted {postsCount} of your posts.}}} other {{postType, select, reply {<0><1>{0} people boosted your reply.} other {<2><3>{1} people boosted your post.}}}}" msgstr "" -#: src/components/notification.jsx:129 +#: src/components/notification.jsx:130 msgid "{count, plural, =1 {{account} followed you.} other {<0><1>{0} people followed you.}}" msgstr "" -#: src/components/notification.jsx:143 +#: src/components/notification.jsx:144 msgid "{account} requested to follow you." msgstr "" -#: src/components/notification.jsx:152 +#: src/components/notification.jsx:153 msgid "{count, plural, =1 {{postsCount, plural, =1 {{postType, select, reply {{account} liked your reply.} other {{account} liked your post.}}} other {{account} liked {postsCount} of your posts.}}} other {{postType, select, reply {<0><1>{0} people liked your reply.} other {<2><3>{1} people liked your post.}}}}" msgstr "" -#: src/components/notification.jsx:194 +#: src/components/notification.jsx:195 msgid "A poll you have voted in or created has ended." msgstr "" -#: src/components/notification.jsx:195 +#: src/components/notification.jsx:196 msgid "A poll you have created has ended." msgstr "" -#: src/components/notification.jsx:196 +#: src/components/notification.jsx:197 msgid "A poll you have voted in has ended." msgstr "" -#: src/components/notification.jsx:197 +#: src/components/notification.jsx:198 msgid "A post you interacted with has been edited." msgstr "" -#: src/components/notification.jsx:205 +#: src/components/notification.jsx:206 msgid "{count, plural, =1 {{postsCount, plural, =1 {{postType, select, reply {{account} boosted & liked your reply.} other {{account} boosted & liked your post.}}} other {{account} boosted & liked {postsCount} of your posts.}}} other {{postType, select, reply {<0><1>{0} people boosted & liked your reply.} other {<2><3>{1} people boosted & liked your post.}}}}" msgstr "" -#: src/components/notification.jsx:247 +#: src/components/notification.jsx:248 msgid "{account} signed up." msgstr "" -#: src/components/notification.jsx:249 +#: src/components/notification.jsx:250 msgid "{account} reported {targetAccount}" msgstr "" -#: src/components/notification.jsx:254 +#: src/components/notification.jsx:255 msgid "Lost connections with <0>{name}." msgstr "" -#: src/components/notification.jsx:260 +#: src/components/notification.jsx:261 msgid "Moderation warning" msgstr "" -#: src/components/notification.jsx:265 +#: src/components/notification.jsx:266 msgid "Your {year} #Wrapstodon is here!" msgstr "Your {year} #Wrapstodon is here!" -#: src/components/notification.jsx:271 +#: src/components/notification.jsx:269 +msgid "{account} moved to {targetAccount}." +msgstr "{account} moved to {targetAccount}." + +#: src/components/notification.jsx:279 msgid "An admin from <0>{from} has suspended <1>{targetName}, which means you can no longer receive updates from them or interact with them." msgstr "" -#: src/components/notification.jsx:277 +#: src/components/notification.jsx:285 msgid "An admin from <0>{from} has blocked <1>{targetName}. Affected followers: {followersCount}, followings: {followingCount}." msgstr "" -#: src/components/notification.jsx:283 +#: src/components/notification.jsx:291 msgid "You have blocked <0>{targetName}. Removed followers: {followersCount}, followings: {followingCount}." msgstr "" -#: src/components/notification.jsx:291 +#: src/components/notification.jsx:299 msgid "Your account has received a moderation warning." msgstr "" -#: src/components/notification.jsx:292 +#: src/components/notification.jsx:300 msgid "Your account has been disabled." msgstr "" -#: src/components/notification.jsx:293 +#: src/components/notification.jsx:301 msgid "Some of your posts have been marked as sensitive." msgstr "" -#: src/components/notification.jsx:294 +#: src/components/notification.jsx:302 msgid "Some of your posts have been deleted." msgstr "" -#: src/components/notification.jsx:295 +#: src/components/notification.jsx:303 msgid "Your posts will be marked as sensitive from now on." msgstr "" -#: src/components/notification.jsx:296 +#: src/components/notification.jsx:304 msgid "Your account has been limited." msgstr "" -#: src/components/notification.jsx:297 +#: src/components/notification.jsx:305 msgid "Your account has been suspended." msgstr "" -#: src/components/notification.jsx:372 +#: src/components/notification.jsx:381 msgid "[Unknown notification type: {type}]" msgstr "" -#: src/components/notification.jsx:441 +#: src/components/notification.jsx:455 #: src/components/status.jsx:1036 #: src/components/status.jsx:1046 msgid "Boosted/Liked by…" msgstr "" -#: src/components/notification.jsx:442 +#: src/components/notification.jsx:456 msgid "Liked by…" msgstr "" -#: src/components/notification.jsx:443 +#: src/components/notification.jsx:457 msgid "Boosted by…" msgstr "" -#: src/components/notification.jsx:444 +#: src/components/notification.jsx:458 msgid "Followed by…" msgstr "" -#: src/components/notification.jsx:515 -#: src/components/notification.jsx:531 +#: src/components/notification.jsx:529 +#: src/components/notification.jsx:545 msgid "Learn more <0/>" msgstr "" -#: src/components/notification.jsx:540 +#: src/components/notification.jsx:554 msgid "View #Wrapstodon" msgstr "View #Wrapstodon" -#: src/components/notification.jsx:770 +#: src/components/notification.jsx:784 #: src/components/status.jsx:267 msgid "Read more →" msgstr ""