From 4c7850f8c48a0cb3f83f33b1701a99066c6b31db Mon Sep 17 00:00:00 2001 From: Ansh Date: Thu, 9 Nov 2023 10:04:16 -0800 Subject: Internationalization & localization (#1822) * install and setup lingui * setup dynamic locale activation and async loading * first pass of automated replacement of text messages * add some more documentaton * fix nits * add `es` and `hi`locales for testing purposes * make accessibilityLabel localized * compile and extract new messages * fix merge conflicts * fix eslint warning * change instructions from sending email to opening PR * fix comments --- src/view/com/modals/EditProfile.tsx | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'src/view/com/modals/EditProfile.tsx') diff --git a/src/view/com/modals/EditProfile.tsx b/src/view/com/modals/EditProfile.tsx index f08bb2326..eef408e98 100644 --- a/src/view/com/modals/EditProfile.tsx +++ b/src/view/com/modals/EditProfile.tsx @@ -26,6 +26,8 @@ import {useAnalytics} from 'lib/analytics/analytics' import {cleanError, isNetworkError} from 'lib/strings/errors' import Animated, {FadeOut} from 'react-native-reanimated' import {isWeb} from 'platform/detection' +import {Trans, msg} from '@lingui/macro' +import {useLingui} from '@lingui/react' import {useModalControls} from '#/state/modals' const AnimatedTouchableOpacity = @@ -44,6 +46,7 @@ export function Component({ const pal = usePalette('default') const theme = useTheme() const {track} = useAnalytics() + const {_} = useLingui() const {closeModal} = useModalControls() const [isProcessing, setProcessing] = useState(false) @@ -151,7 +154,9 @@ export function Component({ return ( - Edit my profile + + Edit my profile + - Display Name + + Display Name + - Description + + Description + setDescription(enforceLen(v, MAX_DESCRIPTION))} accessible={true} - accessibilityLabel="Description" + accessibilityLabel={_(msg`Description`)} accessibilityHint="Edit your profile description" /> @@ -213,14 +222,16 @@ export function Component({ style={s.mt10} onPress={onPressSave} accessibilityRole="button" - accessibilityLabel="Save" + accessibilityLabel={_(msg`Save`)} accessibilityHint="Saves any changes to your profile"> - Save Changes + + Save Changes + )} @@ -231,11 +242,13 @@ export function Component({ style={s.mt5} onPress={onPressCancel} accessibilityRole="button" - accessibilityLabel="Cancel profile editing" + accessibilityLabel={_(msg`Cancel profile editing`)} accessibilityHint="" onAccessibilityEscape={onPressCancel}> - Cancel + + Cancel + )} -- cgit 1.4.1