diff options
author | Minseo Lee <itoupluk427@gmail.com> | 2024-05-07 11:58:04 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-06 19:58:04 -0700 |
commit | 2ea9e2c929d5ae013977fb3d2e962296364629ac (patch) | |
tree | 61c38e04dd5b06113265a94c90159be7dec4ce0d | |
parent | 4fad18b2fa3c12ffdf1d49afac5228f7df658bc2 (diff) | |
download | voidsky-2ea9e2c929d5ae013977fb3d2e962296364629ac.tar.zst |
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
-rw-r--r-- | src/components/ProfileHoverCard/index.web.tsx | 18 | ||||
-rw-r--r-- | src/components/moderation/LabelsOnMeDialog.tsx | 2 | ||||
-rw-r--r-- | src/components/moderation/ModerationDetailsDialog.tsx | 16 | ||||
-rw-r--r-- | src/screens/Onboarding/StepAlgoFeeds/FeedCard.tsx | 4 | ||||
-rw-r--r-- | src/screens/Onboarding/StepInterests/index.tsx | 4 | ||||
-rw-r--r-- | src/screens/Profile/Header/Metrics.tsx | 21 | ||||
-rw-r--r-- | src/screens/Signup/index.tsx | 12 | ||||
-rw-r--r-- | src/view/com/lightbox/Lightbox.tsx | 2 | ||||
-rw-r--r-- | src/view/com/modals/ChangeHandle.tsx | 4 | ||||
-rw-r--r-- | src/view/com/modals/DeleteAccount.tsx | 38 | ||||
-rw-r--r-- | src/view/com/modals/SelfLabel.tsx | 6 | ||||
-rw-r--r-- | src/view/shell/Drawer.tsx | 6 |
12 files changed, 67 insertions, 66 deletions
diff --git a/src/components/ProfileHoverCard/index.web.tsx b/src/components/ProfileHoverCard/index.web.tsx index 305327d8b..274a4c96f 100644 --- a/src/components/ProfileHoverCard/index.web.tsx +++ b/src/components/ProfileHoverCard/index.web.tsx @@ -404,7 +404,9 @@ function Inner({ color={profileShadow.viewer?.following ? 'secondary' : 'primary'} variant="solid" label={ - profileShadow.viewer?.following ? _('Following') : _('Follow') + profileShadow.viewer?.following + ? _(msg`Following`) + : _(msg`Follow`) } style={[a.rounded_full]} onPress={profileShadow.viewer?.following ? unfollow : follow}> @@ -413,7 +415,9 @@ function Inner({ icon={profileShadow.viewer?.following ? Check : Plus} /> <ButtonText> - {profileShadow.viewer?.following ? _('Following') : _('Follow')} + {profileShadow.viewer?.following + ? _(msg`Following`) + : _(msg`Follow`)} </ButtonText> </Button> )} @@ -452,12 +456,10 @@ function Inner({ label={_(msg`${following} following`)} style={[t.atoms.text]} onPress={hide}> - <Trans> - <Text style={[a.text_md, a.font_bold]}>{following} </Text> - <Text style={[t.atoms.text_contrast_medium]}> - {pluralizedFollowings} - </Text> - </Trans> + <Text style={[a.text_md, a.font_bold]}>{following} </Text> + <Text style={[t.atoms.text_contrast_medium]}> + {pluralizedFollowings} + </Text> </InlineLinkText> </View> diff --git a/src/components/moderation/LabelsOnMeDialog.tsx b/src/components/moderation/LabelsOnMeDialog.tsx index 04b4dbd53..176b04941 100644 --- a/src/components/moderation/LabelsOnMeDialog.tsx +++ b/src/components/moderation/LabelsOnMeDialog.tsx @@ -190,7 +190,7 @@ function AppealForm({ }, reason: details, }) - Toast.show(_(msg`Appeal submitted.`)) + Toast.show(_(msg`Appeal submitted`)) } finally { control.close() } diff --git a/src/components/moderation/ModerationDetailsDialog.tsx b/src/components/moderation/ModerationDetailsDialog.tsx index da57de4df..edf828755 100644 --- a/src/components/moderation/ModerationDetailsDialog.tsx +++ b/src/components/moderation/ModerationDetailsDialog.tsx @@ -121,20 +121,20 @@ function ModerationDetailsDialogInner({ <> <Divider /> <Text style={[t.atoms.text, a.text_md, a.leading_snug, a.mt_lg]}> - <Trans> - This label was applied by{' '} - {modcause.source.type === 'user' ? ( - <Trans>the author</Trans> - ) : ( + {modcause.source.type === 'user' ? ( + <Trans>This label was applied by the author.</Trans> + ) : ( + <Trans> + This label was applied by{' '} <InlineLinkText to={makeProfileLink({did: modcause.label.src, handle: ''})} onPress={() => control.close()} style={a.text_md}> {desc.source} </InlineLinkText> - )} - . - </Trans> + . + </Trans> + )} </Text> </> )} diff --git a/src/screens/Onboarding/StepAlgoFeeds/FeedCard.tsx b/src/screens/Onboarding/StepAlgoFeeds/FeedCard.tsx index 06b5a145a..d2b2a5f39 100644 --- a/src/screens/Onboarding/StepAlgoFeeds/FeedCard.tsx +++ b/src/screens/Onboarding/StepAlgoFeeds/FeedCard.tsx @@ -2,7 +2,7 @@ import React from 'react' import {View} from 'react-native' import {Image} from 'expo-image' import {LinearGradient} from 'expo-linear-gradient' -import {msg} from '@lingui/macro' +import {Trans, msg} from '@lingui/macro' import {useLingui} from '@lingui/react' import {FeedSourceInfo, useFeedSourceInfoQuery} from '#/state/queries/feed' @@ -109,7 +109,7 @@ function PrimaryFeedCardInner({ a.py_xs, ctx.selected && styles.textSelected, ]}> - by @{feed.creatorHandle} + <Trans>by @{feed.creatorHandle}</Trans> </Text> </View> diff --git a/src/screens/Onboarding/StepInterests/index.tsx b/src/screens/Onboarding/StepInterests/index.tsx index df489f571..174488a34 100644 --- a/src/screens/Onboarding/StepInterests/index.tsx +++ b/src/screens/Onboarding/StepInterests/index.tsx @@ -189,9 +189,9 @@ export function StepInterests() { color: t.palette.negative_900, }, ]}> - Error:{' '} + <Trans>Error:</Trans>{' '} </Text> - {error?.message || 'an unknown error occurred'} + {error?.message || _(msg`an unknown error occurred`)} </Text> </View> ) : ( diff --git a/src/screens/Profile/Header/Metrics.tsx b/src/screens/Profile/Header/Metrics.tsx index 6d0a25182..864729684 100644 --- a/src/screens/Profile/Header/Metrics.tsx +++ b/src/screens/Profile/Header/Metrics.tsx @@ -50,21 +50,16 @@ export function ProfileHeaderMetrics({ style={[a.flex_row, t.atoms.text]} to={makeProfileLink(profile, 'follows')} label={_(msg`${following} following`)}> - <Trans> - <Text style={[a.font_bold, a.text_md]}>{following} </Text> - <Text style={[t.atoms.text_contrast_medium, a.text_md]}> - {pluralizedFollowings} - </Text> - </Trans> + <Text style={[a.font_bold, a.text_md]}>{following} </Text> + <Text style={[t.atoms.text_contrast_medium, a.text_md]}> + {pluralizedFollowings} + </Text> </InlineLinkText> <Text style={[a.font_bold, t.atoms.text, a.text_md]}> - <Trans> - {formatCount(profile.postsCount || 0)}{' '} - <Text - style={[t.atoms.text_contrast_medium, a.font_normal, a.text_md]}> - {plural(profile.postsCount || 0, {one: 'post', other: 'posts'})} - </Text> - </Trans> + {formatCount(profile.postsCount || 0)}{' '} + <Text style={[t.atoms.text_contrast_medium, a.font_normal, a.text_md]}> + {plural(profile.postsCount || 0, {one: 'post', other: 'posts'})} + </Text> </Text> </View> ) diff --git a/src/screens/Signup/index.tsx b/src/screens/Signup/index.tsx index 5e2596d8c..3d8b505b9 100644 --- a/src/screens/Signup/index.tsx +++ b/src/screens/Signup/index.tsx @@ -151,11 +151,13 @@ export function Signup({onPressBack}: {onPressBack: () => void}) { ]}> <View style={[a.gap_sm, a.pb_3xl]}> <Text style={[a.font_semibold, t.atoms.text_contrast_medium]}> - <Trans>Step</Trans> {state.activeStep + 1} <Trans>of</Trans>{' '} - {state.serviceDescription && - !state.serviceDescription.phoneVerificationRequired - ? '2' - : '3'} + <Trans> + Step {state.activeStep + 1} of{' '} + {state.serviceDescription && + !state.serviceDescription.phoneVerificationRequired + ? '2' + : '3'} + </Trans> </Text> <Text style={[a.text_3xl, a.font_bold]}> {state.activeStep === SignupStep.INFO ? ( diff --git a/src/view/com/lightbox/Lightbox.tsx b/src/view/com/lightbox/Lightbox.tsx index 5bab643ca..fd4c486af 100644 --- a/src/view/com/lightbox/Lightbox.tsx +++ b/src/view/com/lightbox/Lightbox.tsx @@ -78,7 +78,7 @@ function LightboxFooter({imageIndex}: {imageIndex: number}) { try { await saveImageToMediaLibrary({uri}) - Toast.show(_(msg`Saved to your camera roll.`)) + Toast.show(_(msg`Saved to your camera roll`)) } catch (e: any) { Toast.show(_(msg`Failed to save image: ${String(e)}`)) } diff --git a/src/view/com/modals/ChangeHandle.tsx b/src/view/com/modals/ChangeHandle.tsx index ae43d1e32..ea49a93f2 100644 --- a/src/view/com/modals/ChangeHandle.tsx +++ b/src/view/com/modals/ChangeHandle.tsx @@ -507,7 +507,9 @@ function CustomHandleForm({ <Text type="xl-medium" style={[s.white, s.textCenter]}> {canSave ? _(msg`Update to ${handle}`) - : _(msg`Verify ${isDNSForm ? 'DNS Record' : 'Text File'}`)} + : isDNSForm + ? _(msg`Verify DNS Record`) + : _(msg`Verify Text File`)} </Text> )} </Button> diff --git a/src/view/com/modals/DeleteAccount.tsx b/src/view/com/modals/DeleteAccount.tsx index 5e68daef9..2e23a46b0 100644 --- a/src/view/com/modals/DeleteAccount.tsx +++ b/src/view/com/modals/DeleteAccount.tsx @@ -84,26 +84,26 @@ export function Component({}: {}) { <ScrollView style={[pal.view]} keyboardShouldPersistTaps="handled"> <View style={[styles.titleContainer, pal.view]}> <Text type="title-xl" style={[s.textCenter, pal.text]}> - <Trans>Delete Account</Trans> + <Trans> + Delete Account{' '} + <Text type="title-xl" style={[pal.text, s.bold]}> + " + </Text> + <Text + type="title-xl" + numberOfLines={1} + style={[ + isMobile ? styles.titleMobile : styles.titleDesktop, + pal.text, + s.bold, + ]}> + {currentAccount?.handle} + </Text> + <Text type="title-xl" style={[pal.text, s.bold]}> + " + </Text> + </Trans> </Text> - <View style={[pal.view, s.flexRow]}> - <Text type="title-xl" style={[pal.text, s.bold]}> - {' "'} - </Text> - <Text - type="title-xl" - numberOfLines={1} - style={[ - isMobile ? styles.titleMobile : styles.titleDesktop, - pal.text, - s.bold, - ]}> - {currentAccount?.handle} - </Text> - <Text type="title-xl" style={[pal.text, s.bold]}> - {'"'} - </Text> - </View> </View> {!isEmailSent ? ( <> diff --git a/src/view/com/modals/SelfLabel.tsx b/src/view/com/modals/SelfLabel.tsx index 779a9e71b..2b83c7a9a 100644 --- a/src/view/com/modals/SelfLabel.tsx +++ b/src/view/com/modals/SelfLabel.tsx @@ -131,10 +131,10 @@ export function Component({ ) : ( <View> <Text style={[pal.textLight]}> - <Text type="md-bold" style={[pal.textLight, s.mr5]}> - <Trans>Not Applicable.</Trans> - </Text> <Trans> + <Text type="md-bold" style={[pal.textLight]}> + Not Applicable. + </Text>{' '} This warning is only available for posts with media attached. </Trans> </Text> diff --git a/src/view/shell/Drawer.tsx b/src/view/shell/Drawer.tsx index 04f144e87..b57569203 100644 --- a/src/view/shell/Drawer.tsx +++ b/src/view/shell/Drawer.tsx @@ -97,9 +97,9 @@ let DrawerProfileCard = ({ value={profile?.followersCount || 0} one="follower" other="followers" - />{' '} - ·{' '} - </Trans> + /> + </Trans>{' '} + ·{' '} <Trans> <Text type="xl-medium" style={pal.text}> {formatCountShortOnly(profile?.followsCount ?? 0)} |