From fdbd7875fcb44e49cca5f15eef4813a006f2e44e Mon Sep 17 00:00:00 2001 From: Minseo Lee Date: Fri, 10 May 2024 17:00:59 +0900 Subject: [PATCH 1/7] Update RepostButton.tsx --- src/view/com/util/post-ctrls/RepostButton.tsx | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/view/com/util/post-ctrls/RepostButton.tsx b/src/view/com/util/post-ctrls/RepostButton.tsx index c1af39a5dd..60654119c5 100644 --- a/src/view/com/util/post-ctrls/RepostButton.tsx +++ b/src/view/com/util/post-ctrls/RepostButton.tsx @@ -1,14 +1,15 @@ import React, {memo, useCallback} from 'react' import {StyleProp, StyleSheet, TouchableOpacity, ViewStyle} from 'react-native' +import {msg, plural} from '@lingui/macro' +import {useLingui} from '@lingui/react' + +import {useModalControls} from '#/state/modals' +import {useRequireAuth} from '#/state/session' +import {HITSLOP_10, HITSLOP_20} from 'lib/constants' import {RepostIcon} from 'lib/icons' -import {s, colors} from 'lib/styles' +import {colors, s} from 'lib/styles' import {useTheme} from 'lib/ThemeContext' import {Text} from '../text/Text' -import {HITSLOP_10, HITSLOP_20} from 'lib/constants' -import {useModalControls} from '#/state/modals' -import {useRequireAuth} from '#/state/session' -import {msg, plural} from '@lingui/macro' -import {useLingui} from '@lingui/react' interface Props { isReposted: boolean @@ -54,11 +55,21 @@ let RepostButton = ({ }} style={[styles.btn, !big && styles.btnPad]} accessibilityRole="button" - accessibilityLabel={`${ + accessibilityLabel={ isReposted - ? _(msg`Undo repost`) - : _(msg({message: 'Repost', context: 'action'})) - } (${plural(repostCount || 0, {one: '# repost', other: '# reposts'})})`} + ? _( + msg`Undo repost (${plural(repostCount || 0, { + one: '# repost', + other: '# reposts', + })})`, + ) + : _( + msg`Repost (${plural(repostCount || 0, { + one: '# repost', + other: '# reposts', + })})`, + ) + } accessibilityHint="" hitSlop={big ? HITSLOP_20 : HITSLOP_10}> Date: Fri, 10 May 2024 19:51:40 +0900 Subject: [PATCH 2/7] Improve plural marks --- src/components/LabelingServiceCard/index.tsx | 4 ++- src/components/moderation/LabelsOnMe.tsx | 20 ++++++------- .../Profile/Header/ProfileHeaderLabeler.tsx | 23 +++++++++------ src/view/com/feeds/FeedSourceCard.tsx | 13 +++++---- src/view/com/util/post-ctrls/PostCtrls.tsx | 28 +++++++++++-------- src/view/screens/PreferencesFollowingFeed.tsx | 15 ++++++---- src/view/screens/ProfileFeed.tsx | 8 ++---- 7 files changed, 62 insertions(+), 49 deletions(-) diff --git a/src/components/LabelingServiceCard/index.tsx b/src/components/LabelingServiceCard/index.tsx index 2bb7ed59ce..7c255a2ed0 100644 --- a/src/components/LabelingServiceCard/index.tsx +++ b/src/components/LabelingServiceCard/index.tsx @@ -68,7 +68,9 @@ export function LikeCount({count}: {count: number}) { t.atoms.text_contrast_medium, {fontWeight: '500'}, ]}> - + + Liked by + ) } diff --git a/src/components/moderation/LabelsOnMe.tsx b/src/components/moderation/LabelsOnMe.tsx index 46825d7617..02ad152f8f 100644 --- a/src/components/moderation/LabelsOnMe.tsx +++ b/src/components/moderation/LabelsOnMe.tsx @@ -1,7 +1,7 @@ import React from 'react' import {StyleProp, View, ViewStyle} from 'react-native' import {AppBskyFeedDefs, ComAtprotoLabelDefs} from '@atproto/api' -import {msg, Plural} from '@lingui/macro' +import {msg, Plural, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useSession} from '#/state/session' @@ -54,17 +54,15 @@ export function LabelsOnMe({ {isAccount ? ( - + + {' '} + has been placed on this account + ) : ( - + + {' '} + has been placed on this content + )} diff --git a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx index 459bd0d958..da0773e03f 100644 --- a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx +++ b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx @@ -282,10 +282,12 @@ let ProfileHeaderLabeler = ({ }, }} size="tiny" - label={plural(likeCount, { - one: 'Liked by # user', - other: 'Liked by # users', - })}> + label={_( + msg`Liked by ${plural(likeCount, { + one: '# user', + other: '# users', + })}`, + )}> {({hovered, focused, pressed}) => ( - + + Liked by{' '} + + )} diff --git a/src/view/com/feeds/FeedSourceCard.tsx b/src/view/com/feeds/FeedSourceCard.tsx index 8a21d86aef..4c176f6ea0 100644 --- a/src/view/com/feeds/FeedSourceCard.tsx +++ b/src/view/com/feeds/FeedSourceCard.tsx @@ -264,11 +264,14 @@ export function FeedSourceCardLoaded({ {showLikes && feed.type === 'feed' ? ( - + + Liked by{' '} + + ) : null} diff --git a/src/view/com/util/post-ctrls/PostCtrls.tsx b/src/view/com/util/post-ctrls/PostCtrls.tsx index b6c07d5735..460b98a7c3 100644 --- a/src/view/com/util/post-ctrls/PostCtrls.tsx +++ b/src/view/com/util/post-ctrls/PostCtrls.tsx @@ -201,10 +201,10 @@ let PostCtrls = ({ } }} accessibilityRole="button" - accessibilityLabel={plural(post.replyCount || 0, { - one: 'Reply (# reply)', - other: 'Reply (# replies)', - })} + accessibilityLabel={`Reply (${plural(post.replyCount || 0, { + one: '# reply', + other: '# replies', + })})`} accessibilityHint="" hitSlop={big ? HITSLOP_20 : HITSLOP_10}> diff --git a/src/view/screens/PreferencesFollowingFeed.tsx b/src/view/screens/PreferencesFollowingFeed.tsx index 724c3f2651..48e3fd45ef 100644 --- a/src/view/screens/PreferencesFollowingFeed.tsx +++ b/src/view/screens/PreferencesFollowingFeed.tsx @@ -63,12 +63,15 @@ function RepliesThresholdInput({ thumbTintColor={colors.blue3} /> - + + Show{' '} + + ) diff --git a/src/view/screens/ProfileFeed.tsx b/src/view/screens/ProfileFeed.tsx index f66231ab54..f8342e4dd4 100644 --- a/src/view/screens/ProfileFeed.tsx +++ b/src/view/screens/ProfileFeed.tsx @@ -601,11 +601,9 @@ function AboutSection({ label={_(msg`View users who like this feed`)} to={makeCustomFeedLink(feedOwnerDid, feedRkey, 'liked-by')} style={[t.atoms.text_contrast_medium, a.font_bold]}> - + + Liked by + )} From 8ce139817fce478073ebfb4ba362773c3ea2f008 Mon Sep 17 00:00:00 2001 From: Minseo Lee Date: Fri, 10 May 2024 20:24:01 +0900 Subject: [PATCH 3/7] Update PostCtrls.tsx --- src/view/com/util/post-ctrls/PostCtrls.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/view/com/util/post-ctrls/PostCtrls.tsx b/src/view/com/util/post-ctrls/PostCtrls.tsx index 460b98a7c3..2d12d985f3 100644 --- a/src/view/com/util/post-ctrls/PostCtrls.tsx +++ b/src/view/com/util/post-ctrls/PostCtrls.tsx @@ -201,10 +201,12 @@ let PostCtrls = ({ } }} accessibilityRole="button" - accessibilityLabel={`Reply (${plural(post.replyCount || 0, { - one: '# reply', - other: '# replies', - })})`} + accessibilityLabel={_( + msg`Reply (${plural(post.replyCount || 0, { + one: '# reply', + other: '# replies', + })})`, + )} accessibilityHint="" hitSlop={big ? HITSLOP_20 : HITSLOP_10}> Date: Sat, 11 May 2024 00:03:38 +0900 Subject: [PATCH 4/7] Update Deactivated.tsx --- src/screens/Deactivated.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/screens/Deactivated.tsx b/src/screens/Deactivated.tsx index 08a2232df2..854506da6c 100644 --- a/src/screens/Deactivated.tsx +++ b/src/screens/Deactivated.tsx @@ -204,16 +204,16 @@ function msToString(ms: number | undefined): string | undefined { return undefined } // hours - return `${estimatedTimeHrs} ${plural(estimatedTimeHrs, { - one: 'hour', - other: 'hours', - })}` + return plural(estimatedTimeHrs, { + one: '# hour', + other: '# hours', + }) } // minutes - return `${estimatedTimeMins} ${plural(estimatedTimeMins, { - one: 'minute', - other: 'minutes', - })}` + return plural(estimatedTimeMins, { + one: '# minute', + other: '# minutes', + }) } return undefined } From 5084d0943dfa55d69290809980a8289fbf461d52 Mon Sep 17 00:00:00 2001 From: Minseo Lee Date: Fri, 17 May 2024 14:06:39 +0900 Subject: [PATCH 5/7] Update LabelsOnMe.tsx --- src/components/moderation/LabelsOnMe.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/moderation/LabelsOnMe.tsx b/src/components/moderation/LabelsOnMe.tsx index 558798ac55..45ac7366af 100644 --- a/src/components/moderation/LabelsOnMe.tsx +++ b/src/components/moderation/LabelsOnMe.tsx @@ -53,12 +53,20 @@ export function LabelsOnMe({ {isAccount ? ( - {' '} + {' '} been placed on this account ) : ( - {' '} + {' '} been placed on this content )} From 052f6bd8e793d85ec7f02e1ae55be9d21f013899 Mon Sep 17 00:00:00 2001 From: Minseo Lee Date: Tue, 11 Jun 2024 09:18:16 +0900 Subject: [PATCH 6/7] Update RepostButton.tsx --- src/view/com/util/post-ctrls/RepostButton.tsx | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/view/com/util/post-ctrls/RepostButton.tsx b/src/view/com/util/post-ctrls/RepostButton.tsx index 81e89d42d9..1d0e173017 100644 --- a/src/view/com/util/post-ctrls/RepostButton.tsx +++ b/src/view/com/util/post-ctrls/RepostButton.tsx @@ -58,11 +58,21 @@ let RepostButton = ({ {padding: 5}, ]} hoverStyle={t.atoms.bg_contrast_25} - label={`${ + label={ isReposted - ? _(msg`Undo repost`) - : _(msg({message: 'Repost', context: 'action'})) - } (${plural(repostCount || 0, {one: '# repost', other: '# reposts'})})`} + ? _( + msg`Undo repost (${plural(repostCount || 0, { + one: '# repost', + other: '# reposts', + })})`, + ) + : _( + msg`Repost (${plural(repostCount || 0, { + one: '# repost', + other: '# reposts', + })})`, + ) + } shape="round" variant="ghost" color="secondary" From b7ea2da3bd9732ab6870e14fde07cdc17c38c97f Mon Sep 17 00:00:00 2001 From: Minseo Lee Date: Tue, 11 Jun 2024 09:25:10 +0900 Subject: [PATCH 7/7] Update index.tsx --- src/components/LabelingServiceCard/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/LabelingServiceCard/index.tsx b/src/components/LabelingServiceCard/index.tsx index 81b25c335f..8a20e4355c 100644 --- a/src/components/LabelingServiceCard/index.tsx +++ b/src/components/LabelingServiceCard/index.tsx @@ -58,7 +58,7 @@ export function Description({value, handle}: {value?: string; handle: string}) { ) } -export function LikeCount({count}: {count: number}) { +export function LikeCount({likeCount}: {likeCount: number}) { const t = useTheme() return ( - Liked by + Liked by ) @@ -115,7 +115,7 @@ export function Default({ value={labeler.creator.description} handle={labeler.creator.handle} /> - {labeler.likeCount ? : null} + {labeler.likeCount ? : null} )