From 084905c1461ec6f86b03da4d4f6f6300ad9a7fc0 Mon Sep 17 00:00:00 2001 From: Minseo Lee Date: Thu, 12 Dec 2024 12:48:02 +0900 Subject: refine plural marks (#7065) --- src/components/FeedCard.tsx | 9 +++---- src/components/LabelingServiceCard/index.tsx | 8 +++--- src/components/moderation/LabelsOnMe.tsx | 28 ++++++++++++-------- .../Profile/Header/ProfileHeaderLabeler.tsx | 23 ++++++++++------- src/view/com/feeds/FeedSourceCard.tsx | 13 ++++++---- src/view/com/util/post-ctrls/PostCtrls.tsx | 30 +++++++++++++--------- src/view/com/util/post-ctrls/RepostButton.tsx | 18 ++++++++++--- src/view/screens/ProfileFeed.tsx | 8 +++--- 8 files changed, 83 insertions(+), 54 deletions(-) (limited to 'src') diff --git a/src/components/FeedCard.tsx b/src/components/FeedCard.tsx index b28f66f83..de94d7e19 100644 --- a/src/components/FeedCard.tsx +++ b/src/components/FeedCard.tsx @@ -7,7 +7,7 @@ import { AtUri, RichText as RichTextApi, } from '@atproto/api' -import {msg, plural, Trans} from '@lingui/macro' +import {msg, Plural, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useQueryClient} from '@tanstack/react-query' @@ -210,10 +210,9 @@ export function Likes({count}: {count: number}) { const t = useTheme() return ( - {plural(count || 0, { - one: 'Liked by # user', - other: 'Liked by # users', - })} + + Liked by + ) } diff --git a/src/components/LabelingServiceCard/index.tsx b/src/components/LabelingServiceCard/index.tsx index 03b8ece6b..b144c1dc8 100644 --- a/src/components/LabelingServiceCard/index.tsx +++ b/src/components/LabelingServiceCard/index.tsx @@ -83,7 +83,7 @@ export function RegionalNotice() { ) } -export function LikeCount({count}: {count: number}) { +export function LikeCount({likeCount}: {likeCount: number}) { const t = useTheme() return ( - + + Liked by + ) } @@ -138,7 +140,7 @@ export function Default({ value={labeler.creator.description} handle={labeler.creator.handle} /> - {labeler.likeCount ? : null} + {labeler.likeCount ? : null} ) diff --git a/src/components/moderation/LabelsOnMe.tsx b/src/components/moderation/LabelsOnMe.tsx index 681599807..f0a25959f 100644 --- a/src/components/moderation/LabelsOnMe.tsx +++ b/src/components/moderation/LabelsOnMe.tsx @@ -1,6 +1,6 @@ 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' @@ -50,17 +50,23 @@ export function LabelsOnMe({ {type === 'account' ? ( - + + {' '} + been placed on this account + ) : ( - + + {' '} + been placed on this content + )} diff --git a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx index ca0cb1e62..1725c4aac 100644 --- a/src/screens/Profile/Header/ProfileHeaderLabeler.tsx +++ b/src/screens/Profile/Header/ProfileHeaderLabeler.tsx @@ -291,10 +291,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 707aad7fb..a59148889 100644 --- a/src/view/com/feeds/FeedSourceCard.tsx +++ b/src/view/com/feeds/FeedSourceCard.tsx @@ -300,11 +300,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 deb4b51d8..39caaf098 100644 --- a/src/view/com/util/post-ctrls/PostCtrls.tsx +++ b/src/view/com/util/post-ctrls/PostCtrls.tsx @@ -258,10 +258,12 @@ let PostCtrls = ({ } }} accessibilityRole="button" - accessibilityLabel={plural(post.replyCount || 0, { - one: 'Reply (# reply)', - other: 'Reply (# replies)', - })} + accessibilityLabel={_( + msg`Reply (${plural(post.replyCount || 0, { + one: '# reply', + other: '# replies', + })})`, + )} accessibilityHint="" hitSlop={POST_CTRL_HITSLOP}> diff --git a/src/view/com/util/post-ctrls/RepostButton.tsx b/src/view/com/util/post-ctrls/RepostButton.tsx index 06b1fcaf6..ca1647a99 100644 --- a/src/view/com/util/post-ctrls/RepostButton.tsx +++ b/src/view/com/util/post-ctrls/RepostButton.tsx @@ -62,11 +62,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" diff --git a/src/view/screens/ProfileFeed.tsx b/src/view/screens/ProfileFeed.tsx index dd2f8f12b..c3f98c067 100644 --- a/src/view/screens/ProfileFeed.tsx +++ b/src/view/screens/ProfileFeed.tsx @@ -587,11 +587,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 + )} -- cgit 1.4.1