Improve localization marks (#3285)

* Update Lightbox.tsx

* Change strings for easier localization

* Update DeleteAccount.tsx

* Update LabelsOnMeDialog.tsx

* Update FeedCard.tsx

* Update index.tsx

* Update LabelsOnMeDialog.tsx

* Update index.tsx

* Update FeedCard.tsx

* Update SelfLabel.tsx

* Update Hashtag.tsx

* Update index.tsx

* Update Hashtag.tsx

* Update ChangeHandle.tsx

* Update index.web.tsx

* Update index.web.tsx

* Update index.tsx

* Remove unnecessary `<Trans>` tags

* Update Drawer.tsx
zio/stable
Minseo Lee 2024-05-07 11:58:04 +09:00 committed by GitHub
parent 4fad18b2fa
commit 2ea9e2c929
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 67 additions and 66 deletions

View File

@ -404,7 +404,9 @@ function Inner({
color={profileShadow.viewer?.following ? 'secondary' : 'primary'} color={profileShadow.viewer?.following ? 'secondary' : 'primary'}
variant="solid" variant="solid"
label={ label={
profileShadow.viewer?.following ? _('Following') : _('Follow') profileShadow.viewer?.following
? _(msg`Following`)
: _(msg`Follow`)
} }
style={[a.rounded_full]} style={[a.rounded_full]}
onPress={profileShadow.viewer?.following ? unfollow : follow}> onPress={profileShadow.viewer?.following ? unfollow : follow}>
@ -413,7 +415,9 @@ function Inner({
icon={profileShadow.viewer?.following ? Check : Plus} icon={profileShadow.viewer?.following ? Check : Plus}
/> />
<ButtonText> <ButtonText>
{profileShadow.viewer?.following ? _('Following') : _('Follow')} {profileShadow.viewer?.following
? _(msg`Following`)
: _(msg`Follow`)}
</ButtonText> </ButtonText>
</Button> </Button>
)} )}
@ -452,12 +456,10 @@ function Inner({
label={_(msg`${following} following`)} label={_(msg`${following} following`)}
style={[t.atoms.text]} style={[t.atoms.text]}
onPress={hide}> onPress={hide}>
<Trans>
<Text style={[a.text_md, a.font_bold]}>{following} </Text> <Text style={[a.text_md, a.font_bold]}>{following} </Text>
<Text style={[t.atoms.text_contrast_medium]}> <Text style={[t.atoms.text_contrast_medium]}>
{pluralizedFollowings} {pluralizedFollowings}
</Text> </Text>
</Trans>
</InlineLinkText> </InlineLinkText>
</View> </View>

View File

@ -190,7 +190,7 @@ function AppealForm({
}, },
reason: details, reason: details,
}) })
Toast.show(_(msg`Appeal submitted.`)) Toast.show(_(msg`Appeal submitted`))
} finally { } finally {
control.close() control.close()
} }

View File

@ -121,20 +121,20 @@ function ModerationDetailsDialogInner({
<> <>
<Divider /> <Divider />
<Text style={[t.atoms.text, a.text_md, a.leading_snug, a.mt_lg]}> <Text style={[t.atoms.text, a.text_md, a.leading_snug, a.mt_lg]}>
{modcause.source.type === 'user' ? (
<Trans>This label was applied by the author.</Trans>
) : (
<Trans> <Trans>
This label was applied by{' '} This label was applied by{' '}
{modcause.source.type === 'user' ? (
<Trans>the author</Trans>
) : (
<InlineLinkText <InlineLinkText
to={makeProfileLink({did: modcause.label.src, handle: ''})} to={makeProfileLink({did: modcause.label.src, handle: ''})}
onPress={() => control.close()} onPress={() => control.close()}
style={a.text_md}> style={a.text_md}>
{desc.source} {desc.source}
</InlineLinkText> </InlineLinkText>
)}
. .
</Trans> </Trans>
)}
</Text> </Text>
</> </>
)} )}

View File

@ -2,7 +2,7 @@ import React from 'react'
import {View} from 'react-native' import {View} from 'react-native'
import {Image} from 'expo-image' import {Image} from 'expo-image'
import {LinearGradient} from 'expo-linear-gradient' import {LinearGradient} from 'expo-linear-gradient'
import {msg} from '@lingui/macro' import {Trans, msg} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
import {FeedSourceInfo, useFeedSourceInfoQuery} from '#/state/queries/feed' import {FeedSourceInfo, useFeedSourceInfoQuery} from '#/state/queries/feed'
@ -109,7 +109,7 @@ function PrimaryFeedCardInner({
a.py_xs, a.py_xs,
ctx.selected && styles.textSelected, ctx.selected && styles.textSelected,
]}> ]}>
by @{feed.creatorHandle} <Trans>by @{feed.creatorHandle}</Trans>
</Text> </Text>
</View> </View>

View File

@ -189,9 +189,9 @@ export function StepInterests() {
color: t.palette.negative_900, color: t.palette.negative_900,
}, },
]}> ]}>
Error:{' '} <Trans>Error:</Trans>{' '}
</Text> </Text>
{error?.message || 'an unknown error occurred'} {error?.message || _(msg`an unknown error occurred`)}
</Text> </Text>
</View> </View>
) : ( ) : (

View File

@ -50,21 +50,16 @@ export function ProfileHeaderMetrics({
style={[a.flex_row, t.atoms.text]} style={[a.flex_row, t.atoms.text]}
to={makeProfileLink(profile, 'follows')} to={makeProfileLink(profile, 'follows')}
label={_(msg`${following} following`)}> label={_(msg`${following} following`)}>
<Trans>
<Text style={[a.font_bold, a.text_md]}>{following} </Text> <Text style={[a.font_bold, a.text_md]}>{following} </Text>
<Text style={[t.atoms.text_contrast_medium, a.text_md]}> <Text style={[t.atoms.text_contrast_medium, a.text_md]}>
{pluralizedFollowings} {pluralizedFollowings}
</Text> </Text>
</Trans>
</InlineLinkText> </InlineLinkText>
<Text style={[a.font_bold, t.atoms.text, a.text_md]}> <Text style={[a.font_bold, t.atoms.text, a.text_md]}>
<Trans>
{formatCount(profile.postsCount || 0)}{' '} {formatCount(profile.postsCount || 0)}{' '}
<Text <Text style={[t.atoms.text_contrast_medium, a.font_normal, a.text_md]}>
style={[t.atoms.text_contrast_medium, a.font_normal, a.text_md]}>
{plural(profile.postsCount || 0, {one: 'post', other: 'posts'})} {plural(profile.postsCount || 0, {one: 'post', other: 'posts'})}
</Text> </Text>
</Trans>
</Text> </Text>
</View> </View>
) )

View File

@ -151,11 +151,13 @@ export function Signup({onPressBack}: {onPressBack: () => void}) {
]}> ]}>
<View style={[a.gap_sm, a.pb_3xl]}> <View style={[a.gap_sm, a.pb_3xl]}>
<Text style={[a.font_semibold, t.atoms.text_contrast_medium]}> <Text style={[a.font_semibold, t.atoms.text_contrast_medium]}>
<Trans>Step</Trans> {state.activeStep + 1} <Trans>of</Trans>{' '} <Trans>
Step {state.activeStep + 1} of{' '}
{state.serviceDescription && {state.serviceDescription &&
!state.serviceDescription.phoneVerificationRequired !state.serviceDescription.phoneVerificationRequired
? '2' ? '2'
: '3'} : '3'}
</Trans>
</Text> </Text>
<Text style={[a.text_3xl, a.font_bold]}> <Text style={[a.text_3xl, a.font_bold]}>
{state.activeStep === SignupStep.INFO ? ( {state.activeStep === SignupStep.INFO ? (

View File

@ -78,7 +78,7 @@ function LightboxFooter({imageIndex}: {imageIndex: number}) {
try { try {
await saveImageToMediaLibrary({uri}) await saveImageToMediaLibrary({uri})
Toast.show(_(msg`Saved to your camera roll.`)) Toast.show(_(msg`Saved to your camera roll`))
} catch (e: any) { } catch (e: any) {
Toast.show(_(msg`Failed to save image: ${String(e)}`)) Toast.show(_(msg`Failed to save image: ${String(e)}`))
} }

View File

@ -507,7 +507,9 @@ function CustomHandleForm({
<Text type="xl-medium" style={[s.white, s.textCenter]}> <Text type="xl-medium" style={[s.white, s.textCenter]}>
{canSave {canSave
? _(msg`Update to ${handle}`) ? _(msg`Update to ${handle}`)
: _(msg`Verify ${isDNSForm ? 'DNS Record' : 'Text File'}`)} : isDNSForm
? _(msg`Verify DNS Record`)
: _(msg`Verify Text File`)}
</Text> </Text>
)} )}
</Button> </Button>

View File

@ -84,11 +84,10 @@ export function Component({}: {}) {
<ScrollView style={[pal.view]} keyboardShouldPersistTaps="handled"> <ScrollView style={[pal.view]} keyboardShouldPersistTaps="handled">
<View style={[styles.titleContainer, pal.view]}> <View style={[styles.titleContainer, pal.view]}>
<Text type="title-xl" style={[s.textCenter, pal.text]}> <Text type="title-xl" style={[s.textCenter, pal.text]}>
<Trans>Delete Account</Trans> <Trans>
</Text> Delete Account{' '}
<View style={[pal.view, s.flexRow]}>
<Text type="title-xl" style={[pal.text, s.bold]}> <Text type="title-xl" style={[pal.text, s.bold]}>
{' "'} "
</Text> </Text>
<Text <Text
type="title-xl" type="title-xl"
@ -101,9 +100,10 @@ export function Component({}: {}) {
{currentAccount?.handle} {currentAccount?.handle}
</Text> </Text>
<Text type="title-xl" style={[pal.text, s.bold]}> <Text type="title-xl" style={[pal.text, s.bold]}>
{'"'} "
</Text>
</Trans>
</Text> </Text>
</View>
</View> </View>
{!isEmailSent ? ( {!isEmailSent ? (
<> <>

View File

@ -131,10 +131,10 @@ export function Component({
) : ( ) : (
<View> <View>
<Text style={[pal.textLight]}> <Text style={[pal.textLight]}>
<Text type="md-bold" style={[pal.textLight, s.mr5]}>
<Trans>Not Applicable.</Trans>
</Text>
<Trans> <Trans>
<Text type="md-bold" style={[pal.textLight]}>
Not Applicable.
</Text>{' '}
This warning is only available for posts with media attached. This warning is only available for posts with media attached.
</Trans> </Trans>
</Text> </Text>

View File

@ -97,9 +97,9 @@ let DrawerProfileCard = ({
value={profile?.followersCount || 0} value={profile?.followersCount || 0}
one="follower" one="follower"
other="followers" other="followers"
/>{' '} />
</Trans>{' '}
&middot;{' '} &middot;{' '}
</Trans>
<Trans> <Trans>
<Text type="xl-medium" style={pal.text}> <Text type="xl-medium" style={pal.text}>
{formatCountShortOnly(profile?.followsCount ?? 0)} {formatCountShortOnly(profile?.followsCount ?? 0)}