Internationalize more strings (#2440)

Co-authored-by: Ansh <anshnanda10@gmail.com>
This commit is contained in:
Stanislas Signoud
2024-01-09 23:37:15 +01:00
committed by GitHub
parent aeeacd10d3
commit 008893b911
108 changed files with 925 additions and 558 deletions
+7 -4
View File
@@ -5,6 +5,8 @@ import {Button, ButtonType} from '../util/forms/Button'
import * as Toast from '../util/Toast'
import {useProfileFollowMutationQueue} from '#/state/queries/profile'
import {Shadow} from '#/state/cache/types'
import {useLingui} from '@lingui/react'
import {msg} from '@lingui/macro'
export function FollowButton({
unfollowedType = 'inverted',
@@ -18,13 +20,14 @@ export function FollowButton({
labelStyle?: StyleProp<TextStyle>
}) {
const [queueFollow, queueUnfollow] = useProfileFollowMutationQueue(profile)
const {_} = useLingui()
const onPressFollow = async () => {
try {
await queueFollow()
} catch (e: any) {
if (e?.name !== 'AbortError') {
Toast.show(`An issue occurred, please try again.`)
Toast.show(_(msg`An issue occurred, please try again.`))
}
}
}
@@ -34,7 +37,7 @@ export function FollowButton({
await queueUnfollow()
} catch (e: any) {
if (e?.name !== 'AbortError') {
Toast.show(`An issue occurred, please try again.`)
Toast.show(_(msg`An issue occurred, please try again.`))
}
}
}
@@ -49,7 +52,7 @@ export function FollowButton({
type={followedType}
labelStyle={labelStyle}
onPress={onPressUnfollow}
label="Unfollow"
label={_(msg({message: 'Unfollow', context: 'action'}))}
/>
)
} else {
@@ -58,7 +61,7 @@ export function FollowButton({
type={unfollowedType}
labelStyle={labelStyle}
onPress={onPressFollow}
label="Follow"
label={_(msg({message: 'Follow', context: 'action'}))}
/>
)
}