diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/FeedCard.tsx | 9 | ||||
-rw-r--r-- | src/components/LabelingServiceCard/index.tsx | 8 | ||||
-rw-r--r-- | src/components/moderation/LabelsOnMe.tsx | 28 |
3 files changed, 26 insertions, 19 deletions
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 ( <Text style={[a.text_sm, t.atoms.text_contrast_medium]}> - {plural(count || 0, { - one: 'Liked by # user', - other: 'Liked by # users', - })} + <Trans> + Liked by <Plural value={count || 0} one="# user" other="# users" /> + </Trans> </Text> ) } 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 ( <Text @@ -93,7 +93,9 @@ export function LikeCount({count}: {count: number}) { t.atoms.text_contrast_medium, {fontWeight: '600'}, ]}> - <Plural value={count} one="Liked by # user" other="Liked by # users" /> + <Trans> + Liked by <Plural value={likeCount} one="# user" other="# users" /> + </Trans> </Text> ) } @@ -138,7 +140,7 @@ export function Default({ value={labeler.creator.description} handle={labeler.creator.handle} /> - {labeler.likeCount ? <LikeCount count={labeler.likeCount} /> : null} + {labeler.likeCount ? <LikeCount likeCount={labeler.likeCount} /> : null} </Content> </Outer> ) 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({ <ButtonIcon position="left" icon={CircleInfo} /> <ButtonText style={[a.leading_snug]}> {type === 'account' ? ( - <Plural - value={labels.length} - one="# label has been placed on this account" - other="# labels have been placed on this account" - /> + <Trans> + <Plural + value={labels.length} + one="# label has" + other="# labels have" + />{' '} + been placed on this account + </Trans> ) : ( - <Plural - value={labels.length} - one="# label has been placed on this content" - other="# labels have been placed on this content" - /> + <Trans> + <Plural + value={labels.length} + one="# label has" + other="# labels have" + />{' '} + been placed on this content + </Trans> )} </ButtonText> </Button> |