diff options
author | Stanislas Signoud <signez@stanisoft.net> | 2024-01-09 23:37:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-09 14:37:15 -0800 |
commit | 008893b911c354ea70fbb4ceacefe2dafc7567b9 (patch) | |
tree | 817a76b7a5a3b324db025b0d9c9c2647bde5ce6e /src/view/com/profile/FollowButton.tsx | |
parent | aeeacd10d322a6e599631c500de03172d69984de (diff) | |
download | voidsky-008893b911c354ea70fbb4ceacefe2dafc7567b9.tar.zst |
Internationalize more strings (#2440)
Co-authored-by: Ansh <anshnanda10@gmail.com>
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'}))} /> ) } |