diff options
Diffstat (limited to 'src/view/com/profile/FollowButton.tsx')
-rw-r--r-- | src/view/com/profile/FollowButton.tsx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/view/com/profile/FollowButton.tsx b/src/view/com/profile/FollowButton.tsx index 1252f8ca8..9cc635b66 100644 --- a/src/view/com/profile/FollowButton.tsx +++ b/src/view/com/profile/FollowButton.tsx @@ -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'}))} /> ) } |