From 3f5bdd8be37efbe3bf7b1b60bea2bfa4e32aa159 Mon Sep 17 00:00:00 2001 From: Minseo Lee Date: Wed, 14 Feb 2024 11:06:37 +0900 Subject: [PATCH] Mark more texts for localization --- .../AdultContentEnabledPref.tsx | 12 +++-- src/view/com/auth/HomeLoggedOutCTA.tsx | 8 +++- src/view/com/auth/SplashScreen.tsx | 8 +++- src/view/com/auth/create/Policies.tsx | 19 +++++--- src/view/com/auth/create/Step3.tsx | 2 +- src/view/com/auth/login/LoginForm.tsx | 2 +- .../onboarding/RecommendedFollowsItem.tsx | 6 ++- .../com/auth/onboarding/WelcomeMobile.tsx | 6 ++- src/view/com/auth/server-input/index.tsx | 2 +- src/view/com/lightbox/Lightbox.tsx | 4 +- src/view/com/modals/ChangeHandle.tsx | 46 ++++++++++--------- src/view/com/modals/ChangePassword.tsx | 4 +- src/view/com/modals/DeleteAccount.tsx | 6 +-- src/view/com/modals/InAppBrowserConsent.tsx | 2 +- src/view/com/modals/LinkWarning.tsx | 4 +- src/view/com/modals/ModerationDetails.tsx | 2 +- src/view/com/modals/VerifyEmail.tsx | 2 +- .../com/modals/crop-image/CropImage.web.tsx | 12 ++--- .../com/modals/report/InputIssueDetails.tsx | 6 +-- src/view/com/modals/report/Modal.tsx | 7 ++- src/view/com/post-thread/PostThreadItem.tsx | 4 +- .../profile/ProfileHeaderSuggestedFollows.tsx | 14 +++--- src/view/screens/LanguageSettings.tsx | 2 +- src/view/screens/Moderation.tsx | 4 +- src/view/screens/ProfileFeed.tsx | 2 +- src/view/screens/Settings/index.tsx | 32 +++++++------ src/view/shell/NavSignupCard.tsx | 2 +- 27 files changed, 127 insertions(+), 93 deletions(-) diff --git a/src/screens/Onboarding/StepModeration/AdultContentEnabledPref.tsx b/src/screens/Onboarding/StepModeration/AdultContentEnabledPref.tsx index b38b3df1..c3d61640 100644 --- a/src/screens/Onboarding/StepModeration/AdultContentEnabledPref.tsx +++ b/src/screens/Onboarding/StepModeration/AdultContentEnabledPref.tsx @@ -85,7 +85,9 @@ export function AdultContentEnabledPref({ a.align_center, a.py_md, ]}> - Enable Adult Content + + Enable Adult Content + @@ -106,7 +108,9 @@ export function AdultContentEnabledPref({ )} - Adult Content + + Adult Content + Due to Apple policies, adult content can only be enabled on the web @@ -114,7 +118,9 @@ export function AdultContentEnabledPref({ - OK + + OK + diff --git a/src/view/com/auth/HomeLoggedOutCTA.tsx b/src/view/com/auth/HomeLoggedOutCTA.tsx index f796d8ba..a5b5bf7b 100644 --- a/src/view/com/auth/HomeLoggedOutCTA.tsx +++ b/src/view/com/auth/HomeLoggedOutCTA.tsx @@ -52,7 +52,9 @@ export function HomeLoggedOutCTA() { onPress={showCreateAccount} accessibilityRole="button" accessibilityLabel={_(msg`Create new account`)} - accessibilityHint="Opens flow to create a new Bluesky account"> + accessibilityHint={_( + msg`Opens flow to create a new Bluesky account`, + )}> + accessibilityHint={_( + msg`Opens flow to sign into your existing Bluesky account`, + )}> + accessibilityHint={_( + msg`Opens flow to create a new Bluesky account`, + )}> Create a new account @@ -77,7 +79,9 @@ export const SplashScreen = ({ onPress={onPressSignin} accessibilityRole="button" accessibilityLabel={_(msg`Sign in`)} - accessibilityHint="Opens flow to sign into your existing Bluesky account"> + accessibilityHint={_( + msg`Opens flow to sign into your existing Bluesky account`, + )}> Sign In diff --git a/src/view/com/auth/create/Policies.tsx b/src/view/com/auth/create/Policies.tsx index 2c7d6081..803e2ad3 100644 --- a/src/view/com/auth/create/Policies.tsx +++ b/src/view/com/auth/create/Policies.tsx @@ -9,6 +9,8 @@ import {TextLink} from '../../util/Link' import {Text} from '../../util/text/Text' import {s, colors} from 'lib/styles' import {usePalette} from 'lib/hooks/usePalette' +import {Trans, msg} from '@lingui/macro' +import {useLingui} from '@lingui/react' type ServiceDescription = ComAtprotoServerDescribeServer.OutputSchema @@ -20,6 +22,7 @@ export const Policies = ({ needsGuardian: boolean }) => { const pal = usePalette('default') + const {_} = useLingui() if (!serviceDescription) { return } @@ -40,7 +43,9 @@ export const Policies = ({ /> - This service has not provided terms of service or a privacy policy. + + This service has not provided terms of service or a privacy policy. + ) @@ -51,7 +56,7 @@ export const Policies = ({ , ) @@ -61,7 +66,7 @@ export const Policies = ({ , ) @@ -79,12 +84,14 @@ export const Policies = ({ return ( - By creating an account you agree to the {els}. + By creating an account you agree to the {els}. {needsGuardian && ( - If you are not yet an adult according to the laws of your country, - your parent or legal guardian must read these Terms on your behalf. + + If you are not yet an adult according to the laws of your country, + your parent or legal guardian must read these Terms on your behalf. + )} diff --git a/src/view/com/auth/create/Step3.tsx b/src/view/com/auth/create/Step3.tsx index 3a52abf8..afd21a32 100644 --- a/src/view/com/auth/create/Step3.tsx +++ b/src/view/com/auth/create/Step3.tsx @@ -30,7 +30,7 @@ export function Step3({ {profile.description ? ( diff --git a/src/view/com/auth/onboarding/WelcomeMobile.tsx b/src/view/com/auth/onboarding/WelcomeMobile.tsx index 5de1a781..b8659d56 100644 --- a/src/view/com/auth/onboarding/WelcomeMobile.tsx +++ b/src/view/com/auth/onboarding/WelcomeMobile.tsx @@ -6,7 +6,8 @@ import {usePalette} from 'lib/hooks/usePalette' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {Button} from 'view/com/util/forms/Button' import {ViewHeader} from 'view/com/util/ViewHeader' -import {Trans} from '@lingui/macro' +import {useLingui} from '@lingui/react' +import {Trans, msg} from '@lingui/macro' type Props = { next: () => void @@ -15,6 +16,7 @@ type Props = { export function WelcomeMobile({next, skip}: Props) { const pal = usePalette('default') + const {_} = useLingui() return ( @@ -91,7 +93,7 @@ export function WelcomeMobile({next, skip}: Props) { {canSave === true && ( @@ -504,8 +506,8 @@ function CustomHandleForm({ ) : ( {canSave - ? `Update to ${handle}` - : `Verify ${isDNSForm ? 'DNS Record' : 'Text File'}`} + ? _(msg`Update to ${handle}`) + : _(msg`Verify ${isDNSForm ? 'DNS Record' : 'Text File'}`)} )} @@ -513,9 +515,9 @@ function CustomHandleForm({ + accessibilityHint={_(msg`Use bsky.social as hosting provider`)}> - Nevermind, create a handle for me + Nevermind, create a handle for me diff --git a/src/view/com/modals/ChangePassword.tsx b/src/view/com/modals/ChangePassword.tsx index d8add979..44d85fc4 100644 --- a/src/view/com/modals/ChangePassword.tsx +++ b/src/view/com/modals/ChangePassword.tsx @@ -180,7 +180,7 @@ export function Component() { Cancel diff --git a/src/view/com/modals/InAppBrowserConsent.tsx b/src/view/com/modals/InAppBrowserConsent.tsx index 86bb46ca..3fa51593 100644 --- a/src/view/com/modals/InAppBrowserConsent.tsx +++ b/src/view/com/modals/InAppBrowserConsent.tsx @@ -77,7 +77,7 @@ export function Component({href}: {href: string}) { }} accessibilityLabel={_(msg`Cancel`)} accessibilityHint="" - label="Cancel" + label={_(msg`Cancel`)} labelContainerStyle={{justifyContent: 'center', padding: 8}} labelStyle={[s.f18]} /> diff --git a/src/view/com/modals/LinkWarning.tsx b/src/view/com/modals/LinkWarning.tsx index 81fdc728..4e6d8f91 100644 --- a/src/view/com/modals/LinkWarning.tsx +++ b/src/view/com/modals/LinkWarning.tsx @@ -74,7 +74,7 @@ export function Component({text, href}: {text: string; href: string}) { onPress={onPressVisit} accessibilityLabel={_(msg`Visit Site`)} accessibilityHint="" - label="Visit Site" + label={_(msg`Visit Site`)} labelContainerStyle={{justifyContent: 'center', padding: 4}} labelStyle={[s.f18]} /> @@ -86,7 +86,7 @@ export function Component({text, href}: {text: string; href: string}) { }} accessibilityLabel={_(msg`Cancel`)} accessibilityHint="" - label="Cancel" + label={_(msg`Cancel`)} labelContainerStyle={{justifyContent: 'center', padding: 4}} labelStyle={[s.f18]} /> diff --git a/src/view/com/modals/ModerationDetails.tsx b/src/view/com/modals/ModerationDetails.tsx index f890d50d..6c022761 100644 --- a/src/view/com/modals/ModerationDetails.tsx +++ b/src/view/com/modals/ModerationDetails.tsx @@ -115,7 +115,7 @@ export function Component({ closeModal() }}> - Okay + Okay diff --git a/src/view/com/modals/VerifyEmail.tsx b/src/view/com/modals/VerifyEmail.tsx index 30a57afc..d3086d38 100644 --- a/src/view/com/modals/VerifyEmail.tsx +++ b/src/view/com/modals/VerifyEmail.tsx @@ -149,7 +149,7 @@ export function Component({showReminder}: {showReminder?: boolean}) { onPress={onEmailIncorrect} style={styles.changeEmailLink}> - Change + Change diff --git a/src/view/com/modals/crop-image/CropImage.web.tsx b/src/view/com/modals/crop-image/CropImage.web.tsx index 6f094a1f..98a2494e 100644 --- a/src/view/com/modals/crop-image/CropImage.web.tsx +++ b/src/view/com/modals/crop-image/CropImage.web.tsx @@ -100,7 +100,7 @@ export function Component({ onPress={doSetAs(AspectRatio.Wide)} accessibilityRole="button" accessibilityLabel={_(msg`Wide`)} - accessibilityHint="Sets image aspect ratio to wide"> + accessibilityHint={_(msg`Sets image aspect ratio to wide`)}> + accessibilityHint={_(msg`Sets image aspect ratio to tall`)}> + accessibilityHint={_(msg`Sets image aspect ratio to square`)}> + accessibilityHint={_(msg`Exits image cropping process`)}> - Cancel + Cancel @@ -142,7 +142,7 @@ export function Component({ onPress={onPressDone} accessibilityRole="button" accessibilityLabel={_(msg`Save image crop`)} - accessibilityHint="Saves image crop settings"> + accessibilityHint={_(msg`Saves image crop settings`)}> + accessibilityHint={_(msg`Add more details to your report`)}> {' '} @@ -49,8 +49,8 @@ export function InputIssueDetails({ + accessibilityHint={_(msg`Add more details to your report`)}> Add details to report diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index 826d0d16..fc13fa0e 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -296,7 +296,7 @@ let PostThreadItemLoaded = ({ color={pal.colors.textLight} /> - Muted + Muted )} @@ -578,7 +578,7 @@ let PostThreadItemLoaded = ({ title={itemTitle} noFeedback> - More + More { try { 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.`)) } } - }, [queueUnfollow]) + }, [queueUnfollow, _]) if (!moderationOpts) { return null @@ -236,7 +238,7 @@ function SuggestedFollow({