diff options
author | Ansh <anshnanda10@gmail.com> | 2023-11-09 10:04:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-09 10:04:16 -0800 |
commit | 4c7850f8c48a0cb3f83f33b1701a99066c6b31db (patch) | |
tree | 62313ddf74601d42c70365e0863adbfbc7c93b0e /src/view/com/modals/LinkWarning.tsx | |
parent | 82059b7ee138d24ff50b0f4fad0eaeac860bb78c (diff) | |
download | voidsky-4c7850f8c48a0cb3f83f33b1701a99066c6b31db.tar.zst |
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
Diffstat (limited to 'src/view/com/modals/LinkWarning.tsx')
-rw-r--r-- | src/view/com/modals/LinkWarning.tsx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/view/com/modals/LinkWarning.tsx b/src/view/com/modals/LinkWarning.tsx index 751c69b3f..cb86387a0 100644 --- a/src/view/com/modals/LinkWarning.tsx +++ b/src/view/com/modals/LinkWarning.tsx @@ -10,6 +10,8 @@ import {usePalette} from 'lib/hooks/usePalette' import {isWeb} from 'platform/detection' import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' import {isPossiblyAUrl, splitApexDomain} from 'lib/strings/url-helpers' +import {Trans, msg} from '@lingui/macro' +import {useLingui} from '@lingui/react' import {useModalControls} from '#/state/modals' export const snapPoints = ['50%'] @@ -24,6 +26,7 @@ export const Component = observer(function Component({ const pal = usePalette('default') const {closeModal} = useModalControls() const {isMobile} = useWebMediaQueries() + const {_} = useLingui() const potentiallyMisleading = isPossiblyAUrl(text) const onPressVisit = () => { @@ -45,26 +48,26 @@ export const Component = observer(function Component({ size={18} /> <Text type="title-lg" style={[pal.text, styles.title]}> - Potentially Misleading Link + <Trans>Potentially Misleading Link</Trans> </Text> </> ) : ( <Text type="title-lg" style={[pal.text, styles.title]}> - Leaving Bluesky + <Trans>Leaving Bluesky</Trans> </Text> )} </View> <View style={{gap: 10}}> <Text type="lg" style={pal.text}> - This link is taking you to the following website: + <Trans>This link is taking you to the following website:</Trans> </Text> <LinkBox href={href} /> {potentiallyMisleading && ( <Text type="lg" style={pal.text}> - Make sure this is where you intend to go! + <Trans>Make sure this is where you intend to go!</Trans> </Text> )} </View> @@ -74,7 +77,7 @@ export const Component = observer(function Component({ testID="confirmBtn" type="primary" onPress={onPressVisit} - accessibilityLabel="Visit Site" + accessibilityLabel={_(msg`Visit Site`)} accessibilityHint="" label="Visit Site" labelContainerStyle={{justifyContent: 'center', padding: 4}} @@ -84,7 +87,7 @@ export const Component = observer(function Component({ testID="cancelBtn" type="default" onPress={() => closeModal()} - accessibilityLabel="Cancel" + accessibilityLabel={_(msg`Cancel`)} accessibilityHint="" label="Cancel" labelContainerStyle={{justifyContent: 'center', padding: 4}} |