diff options
Diffstat (limited to 'src/view/screens')
-rw-r--r-- | src/view/screens/AppPasswords.tsx | 4 | ||||
-rw-r--r-- | src/view/screens/Debug.tsx | 7 | ||||
-rw-r--r-- | src/view/screens/Feeds.tsx | 2 | ||||
-rw-r--r-- | src/view/screens/Lists.tsx | 2 | ||||
-rw-r--r-- | src/view/screens/Log.tsx | 4 | ||||
-rw-r--r-- | src/view/screens/PostThread.tsx | 4 | ||||
-rw-r--r-- | src/view/screens/PreferencesExternalEmbeds.tsx | 2 | ||||
-rw-r--r-- | src/view/screens/PreferencesHomeFeed.tsx | 11 | ||||
-rw-r--r-- | src/view/screens/PreferencesThreads.tsx | 2 | ||||
-rw-r--r-- | src/view/screens/Profile.tsx | 7 | ||||
-rw-r--r-- | src/view/screens/ProfileFeed.tsx | 61 | ||||
-rw-r--r-- | src/view/screens/ProfileList.tsx | 95 | ||||
-rw-r--r-- | src/view/screens/SavedFeeds.tsx | 15 | ||||
-rw-r--r-- | src/view/screens/Search/Search.tsx | 4 | ||||
-rw-r--r-- | src/view/screens/Settings.tsx | 60 | ||||
-rw-r--r-- | src/view/screens/Support.tsx | 4 |
16 files changed, 171 insertions, 113 deletions
diff --git a/src/view/screens/AppPasswords.tsx b/src/view/screens/AppPasswords.tsx index ab4a6a6a8..dc439c367 100644 --- a/src/view/screens/AppPasswords.tsx +++ b/src/view/screens/AppPasswords.tsx @@ -62,8 +62,8 @@ export function AppPasswords({}: Props) { ]} testID="appPasswordsScreen"> <ErrorScreen - title="Oops!" - message="There was an issue with fetching your app passwords" + title={_(msg`Oops!`)} + message={_(msg`There was an issue with fetching your app passwords`)} details={cleanError(error)} /> </CenteredView> diff --git a/src/view/screens/Debug.tsx b/src/view/screens/Debug.tsx index 0e0464200..f26b1505a 100644 --- a/src/view/screens/Debug.tsx +++ b/src/view/screens/Debug.tsx @@ -16,6 +16,8 @@ import {ToggleButton} from '../com/util/forms/ToggleButton' import {RadioGroup} from '../com/util/forms/RadioGroup' import {ErrorScreen} from '../com/util/error/ErrorScreen' import {ErrorMessage} from '../com/util/error/ErrorMessage' +import {msg} from '@lingui/macro' +import {useLingui} from '@lingui/react' const MAIN_VIEWS = ['Base', 'Controls', 'Error', 'Notifs'] @@ -48,6 +50,7 @@ function DebugInner({ }) { const [currentView, setCurrentView] = React.useState<number>(0) const pal = usePalette('default') + const {_} = useLingui() const renderItem = (item: any) => { return ( @@ -57,7 +60,7 @@ function DebugInner({ type="default-light" onPress={onToggleColorScheme} isSelected={colorScheme === 'dark'} - label="Dark mode" + label={_(msg`Dark mode`)} /> </View> {item.currentView === 3 ? ( @@ -77,7 +80,7 @@ function DebugInner({ return ( <View style={[s.hContentRegion, pal.view]}> - <ViewHeader title="Debug panel" /> + <ViewHeader title={_(msg`Debug panel`)} /> <ViewSelector swipeEnabled sections={MAIN_VIEWS} diff --git a/src/view/screens/Feeds.tsx b/src/view/screens/Feeds.tsx index dbdb6d9ca..e0126bd48 100644 --- a/src/view/screens/Feeds.tsx +++ b/src/view/screens/Feeds.tsx @@ -328,7 +328,7 @@ export function FeedsScreen(_props: Props) { hitSlop={10} accessibilityRole="button" accessibilityLabel={_(msg`Edit Saved Feeds`)} - accessibilityHint="Opens screen to edit Saved Feeds"> + accessibilityHint={_(msg`Opens screen to edit Saved Feeds`)}> <CogIcon size={22} strokeWidth={2} style={pal.textLight} /> </Link> ) diff --git a/src/view/screens/Lists.tsx b/src/view/screens/Lists.tsx index d28db7c6c..23d6c8fac 100644 --- a/src/view/screens/Lists.tsx +++ b/src/view/screens/Lists.tsx @@ -73,7 +73,7 @@ export function ListsScreen({}: Props) { }}> <FontAwesomeIcon icon="plus" color={pal.colors.text} /> <Text type="button" style={pal.text}> - <Trans>New</Trans> + <Trans context="action">New</Trans> </Text> </Button> </View> diff --git a/src/view/screens/Log.tsx b/src/view/screens/Log.tsx index 8680b851b..e727a1fb8 100644 --- a/src/view/screens/Log.tsx +++ b/src/view/screens/Log.tsx @@ -50,7 +50,9 @@ export function LogScreen({}: NativeStackScreenProps< style={[styles.entry, pal.border, pal.view]} onPress={toggler(entry.id)} accessibilityLabel={_(msg`View debug entry`)} - accessibilityHint="Opens additional details for a debug entry"> + accessibilityHint={_( + msg`Opens additional details for a debug entry`, + )}> {entry.level === 'debug' ? ( <FontAwesomeIcon icon="info" /> ) : ( diff --git a/src/view/screens/PostThread.tsx b/src/view/screens/PostThread.tsx index 6f8434412..aaadbf399 100644 --- a/src/view/screens/PostThread.tsx +++ b/src/view/screens/PostThread.tsx @@ -78,7 +78,9 @@ export function PostThreadScreen({route}: Props) { return ( <View style={s.hContentRegion}> - {isMobile && <ViewHeader title={_(msg`Post`)} />} + {isMobile && ( + <ViewHeader title={_(msg({message: 'Post', context: 'description'}))} /> + )} <View style={s.flex1}> {uriError ? ( <CenteredView> diff --git a/src/view/screens/PreferencesExternalEmbeds.tsx b/src/view/screens/PreferencesExternalEmbeds.tsx index 24e7d56df..1e8cedf7e 100644 --- a/src/view/screens/PreferencesExternalEmbeds.tsx +++ b/src/view/screens/PreferencesExternalEmbeds.tsx @@ -72,7 +72,7 @@ export function PreferencesExternalEmbeds({}: Props) { </View> </View> <Text type="xl-bold" style={[pal.text, styles.heading]}> - Enable media players for + <Trans>Enable media players for</Trans> </Text> {Object.entries(externalEmbedLabels).map(([key, label]) => ( <PrefSelector diff --git a/src/view/screens/PreferencesHomeFeed.tsx b/src/view/screens/PreferencesHomeFeed.tsx index 874272831..7ad870937 100644 --- a/src/view/screens/PreferencesHomeFeed.tsx +++ b/src/view/screens/PreferencesHomeFeed.tsx @@ -27,6 +27,7 @@ function RepliesThresholdInput({ initialValue: number }) { const pal = usePalette('default') + const {_} = useLingui() const [value, setValue] = useState(initialValue) const {mutate: setFeedViewPref} = useSetFeedViewPreferencesMutation() const preValue = React.useRef(initialValue) @@ -64,10 +65,12 @@ function RepliesThresholdInput({ /> <Text type="xs" style={pal.text}> {value === 0 - ? `Show all replies` - : `Show replies with at least ${value} ${ - value > 1 ? `likes` : `like` - }`} + ? _(msg`Show all replies`) + : _( + msg`Show replies with at least ${value} ${ + value > 1 ? `likes` : `like` + }`, + )} </Text> </View> ) diff --git a/src/view/screens/PreferencesThreads.tsx b/src/view/screens/PreferencesThreads.tsx index 35a010b55..321c67293 100644 --- a/src/view/screens/PreferencesThreads.tsx +++ b/src/view/screens/PreferencesThreads.tsx @@ -159,7 +159,7 @@ export function PreferencesThreads({navigation}: Props) { accessibilityLabel={_(msg`Confirm`)} accessibilityHint=""> <Text style={[s.white, s.bold, s.f18]}> - <Trans>Done</Trans> + <Trans context="action">Done</Trans> </Text> </TouchableOpacity> </View> diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx index 4558ae33d..7fc4d7a20 100644 --- a/src/view/screens/Profile.tsx +++ b/src/view/screens/Profile.tsx @@ -371,6 +371,7 @@ const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>( {feed, headerHeight, isFocused, scrollElRef, ignoreFilterFor}, ref, ) { + const {_} = useLingui() const queryClient = useQueryClient() const [hasNew, setHasNew] = React.useState(false) const [isScrolledDown, setIsScrolledDown] = React.useState(false) @@ -388,8 +389,8 @@ const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>( })) const renderPostsEmpty = React.useCallback(() => { - return <EmptyState icon="feed" message="This feed is empty!" /> - }, []) + return <EmptyState icon="feed" message={_(msg`This feed is empty!`)} /> + }, [_]) return ( <View> @@ -408,7 +409,7 @@ const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>( {(isScrolledDown || hasNew) && ( <LoadLatestBtn onPress={onScrollToTop} - label="Load new posts" + label={_(msg`Load new posts`)} showIndicator={hasNew} /> )} diff --git a/src/view/screens/ProfileFeed.tsx b/src/view/screens/ProfileFeed.tsx index 211306c0d..4f5f300af 100644 --- a/src/view/screens/ProfileFeed.tsx +++ b/src/view/screens/ProfileFeed.tsx @@ -214,11 +214,21 @@ export function ProfileFeedScreenInner({ } } catch (err) { Toast.show( - 'There was an an issue updating your feeds, please check your internet connection and try again.', + _( + msg`There was an an issue updating your feeds, please check your internet connection and try again.`, + ), ) logger.error('Failed up update feeds', {error: err}) } - }, [feedInfo, isSaved, saveFeed, removeFeed, resetSaveFeed, resetRemoveFeed]) + }, [ + feedInfo, + isSaved, + saveFeed, + removeFeed, + resetSaveFeed, + resetRemoveFeed, + _, + ]) const onTogglePinned = React.useCallback(async () => { try { @@ -232,10 +242,10 @@ export function ProfileFeedScreenInner({ resetPinFeed() } } catch (e) { - Toast.show('There was an issue contacting the server') + Toast.show(_(msg`There was an issue contacting the server`)) logger.error('Failed to toggle pinned feed', {error: e}) } - }, [isPinned, feedInfo, pinFeed, unpinFeed, resetPinFeed, resetUnpinFeed]) + }, [isPinned, feedInfo, pinFeed, unpinFeed, resetPinFeed, resetUnpinFeed, _]) const onPressShare = React.useCallback(() => { const url = toShareUrl(feedInfo.route.href) @@ -341,7 +351,7 @@ export function ProfileFeedScreenInner({ <Button disabled={isSavePending || isRemovePending} type="default" - label={isSaved ? 'Unsave' : 'Save'} + label={isSaved ? _(msg`Unsave`) : _(msg`Save`)} onPress={onToggleSaved} style={styles.btn} /> @@ -349,7 +359,7 @@ export function ProfileFeedScreenInner({ testID={isPinned ? 'unpinBtn' : 'pinBtn'} disabled={isPinPending || isUnpinPending} type={isPinned ? 'default' : 'inverted'} - label={isPinned ? 'Unpin' : 'Pin to home'} + label={isPinned ? _(msg`Unpin`) : _(msg`Pin to home`)} onPress={onTogglePinned} style={styles.btn} /> @@ -444,6 +454,7 @@ interface FeedSectionProps { } const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>( function FeedSectionImpl({feed, headerHeight, scrollElRef, isFocused}, ref) { + const {_} = useLingui() const [hasNew, setHasNew] = React.useState(false) const [isScrolledDown, setIsScrolledDown] = React.useState(false) const queryClient = useQueryClient() @@ -470,8 +481,8 @@ const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>( }, [onScrollToTop, isScreenFocused]) const renderPostsEmpty = useCallback(() => { - return <EmptyState icon="feed" message="This feed is empty!" /> - }, []) + return <EmptyState icon="feed" message={_(msg`This feed is empty!`)} /> + }, [_]) return ( <View> @@ -488,7 +499,7 @@ const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>( {(isScrolledDown || hasNew) && ( <LoadLatestBtn onPress={onScrollToTop} - label="Load new posts" + label={_(msg`Load new posts`)} showIndicator={hasNew} /> )} @@ -542,11 +553,13 @@ function AboutSection({ } } catch (err) { Toast.show( - 'There was an an issue contacting the server, please check your internet connection and try again.', + _( + msg`There was an an issue contacting the server, please check your internet connection and try again.`, + ), ) logger.error('Failed up toggle like', {error: err}) } - }, [likeUri, isLiked, feedInfo, likeFeed, unlikeFeed, track]) + }, [likeUri, isLiked, feedInfo, likeFeed, unlikeFeed, track, _]) return ( <ScrollView @@ -597,24 +610,28 @@ function AboutSection({ {typeof likeCount === 'number' && ( <TextLink href={makeCustomFeedLink(feedOwnerDid, feedRkey, 'liked-by')} - text={`Liked by ${likeCount} ${pluralize(likeCount, 'user')}`} + text={_( + msg`Liked by ${likeCount} ${pluralize(likeCount, 'user')}`, + )} style={[pal.textLight, s.semiBold]} /> )} </View> <Text type="md" style={[pal.textLight]} numberOfLines={1}> - Created by{' '} {isOwner ? ( - 'you' + <Trans>Created by you</Trans> ) : ( - <TextLink - text={sanitizeHandle(feedInfo.creatorHandle, '@')} - href={makeProfileLink({ - did: feedInfo.creatorDid, - handle: feedInfo.creatorHandle, - })} - style={pal.textLight} - /> + <Trans> + Created by{' '} + <TextLink + text={sanitizeHandle(feedInfo.creatorHandle, '@')} + href={makeProfileLink({ + did: feedInfo.creatorDid, + handle: feedInfo.creatorHandle, + })} + style={pal.textLight} + /> + </Trans> )} </Text> </View> diff --git a/src/view/screens/ProfileList.tsx b/src/view/screens/ProfileList.tsx index c51758ae5..30999b518 100644 --- a/src/view/screens/ProfileList.tsx +++ b/src/view/screens/ProfileList.tsx @@ -68,6 +68,7 @@ interface SectionRef { type Props = NativeStackScreenProps<CommonNavigatorParams, 'ProfileList'> export function ProfileListScreen(props: Props) { + const {_} = useLingui() const {name: handleOrDid, rkey} = props.route.params const {data: resolvedUri, error: resolveError} = useResolveUriQuery( AtUri.make(handleOrDid, 'app.bsky.graph.list', rkey).toString(), @@ -78,7 +79,9 @@ export function ProfileListScreen(props: Props) { return ( <CenteredView> <ErrorScreen - error={`We're sorry, but we were unable to resolve this list. If this persists, please contact the list creator, @${handleOrDid}.`} + error={_( + msg`We're sorry, but we were unable to resolve this list. If this persists, please contact the list creator, @${handleOrDid}.`, + )} /> </CenteredView> ) @@ -260,10 +263,10 @@ function Header({rkey, list}: {rkey: string; list: AppBskyGraphDefs.ListView}) { await pinFeed({uri: list.uri}) } } catch (e) { - Toast.show('There was an issue contacting the server') + Toast.show(_(msg`There was an issue contacting the server`)) logger.error('Failed to toggle pinned feed', {error: e}) } - }, [list.uri, isPinned, pinFeed, unpinFeed]) + }, [list.uri, isPinned, pinFeed, unpinFeed, _]) const onSubscribeMute = useCallback(() => { openModal({ @@ -272,15 +275,17 @@ function Header({rkey, list}: {rkey: string; list: AppBskyGraphDefs.ListView}) { message: _( msg`Muting is private. Muted accounts can interact with you, but you will not see their posts or receive notifications from them.`, ), - confirmBtnText: 'Mute this List', + confirmBtnText: _(msg`Mute this List`), async onPressConfirm() { try { await listMuteMutation.mutateAsync({uri: list.uri, mute: true}) - Toast.show('List muted') + Toast.show(_(msg`List muted`)) track('Lists:Mute') } catch { Toast.show( - 'There was an issue. Please check your internet connection and try again.', + _( + msg`There was an issue. Please check your internet connection and try again.`, + ), ) } }, @@ -293,14 +298,16 @@ function Header({rkey, list}: {rkey: string; list: AppBskyGraphDefs.ListView}) { const onUnsubscribeMute = useCallback(async () => { try { await listMuteMutation.mutateAsync({uri: list.uri, mute: false}) - Toast.show('List unmuted') + Toast.show(_(msg`List unmuted`)) track('Lists:Unmute') } catch { Toast.show( - 'There was an issue. Please check your internet connection and try again.', + _( + msg`There was an issue. Please check your internet connection and try again.`, + ), ) } - }, [list, listMuteMutation, track]) + }, [list, listMuteMutation, track, _]) const onSubscribeBlock = useCallback(() => { openModal({ @@ -309,15 +316,17 @@ function Header({rkey, list}: {rkey: string; list: AppBskyGraphDefs.ListView}) { message: _( msg`Blocking is public. Blocked accounts cannot reply in your threads, mention you, or otherwise interact with you.`, ), - confirmBtnText: 'Block this List', + confirmBtnText: _(msg`Block this List`), async onPressConfirm() { try { await listBlockMutation.mutateAsync({uri: list.uri, block: true}) - Toast.show('List blocked') + Toast.show(_(msg`List blocked`)) track('Lists:Block') } catch { Toast.show( - 'There was an issue. Please check your internet connection and try again.', + _( + msg`There was an issue. Please check your internet connection and try again.`, + ), ) } }, @@ -330,14 +339,16 @@ function Header({rkey, list}: {rkey: string; list: AppBskyGraphDefs.ListView}) { const onUnsubscribeBlock = useCallback(async () => { try { await listBlockMutation.mutateAsync({uri: list.uri, block: false}) - Toast.show('List unblocked') + Toast.show(_(msg`List unblocked`)) track('Lists:Unblock') } catch { Toast.show( - 'There was an issue. Please check your internet connection and try again.', + _( + msg`There was an issue. Please check your internet connection and try again.`, + ), ) } - }, [list, listBlockMutation, track]) + }, [list, listBlockMutation, track, _]) const onPressEdit = useCallback(() => { openModal({ @@ -353,7 +364,7 @@ function Header({rkey, list}: {rkey: string; list: AppBskyGraphDefs.ListView}) { message: _(msg`Are you sure?`), async onPressConfirm() { await listDeleteMutation.mutateAsync({uri: list.uri}) - Toast.show('List deleted') + Toast.show(_(msg`List deleted`)) track('Lists:Delete') if (navigation.canGoBack()) { navigation.goBack() @@ -545,7 +556,7 @@ function Header({rkey, list}: {rkey: string; list: AppBskyGraphDefs.ListView}) { <Button testID={isPinned ? 'unpinBtn' : 'pinBtn'} type={isPinned ? 'default' : 'inverted'} - label={isPinned ? 'Unpin' : 'Pin to home'} + label={isPinned ? _(msg`Unpin`) : _(msg`Pin to home`)} onPress={onTogglePinned} disabled={isPending} /> @@ -554,14 +565,14 @@ function Header({rkey, list}: {rkey: string; list: AppBskyGraphDefs.ListView}) { <Button testID="unblockBtn" type="default" - label="Unblock" + label={_(msg`Unblock`)} onPress={onUnsubscribeBlock} /> ) : isMuting ? ( <Button testID="unmuteBtn" type="default" - label="Unmute" + label={_(msg`Unmute`)} onPress={onUnsubscribeMute} /> ) : ( @@ -603,6 +614,7 @@ const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>( const [hasNew, setHasNew] = React.useState(false) const [isScrolledDown, setIsScrolledDown] = React.useState(false) const isScreenFocused = useIsFocused() + const {_} = useLingui() const onScrollToTop = useCallback(() => { scrollElRef.current?.scrollToOffset({ @@ -624,8 +636,8 @@ const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>( }, [onScrollToTop, isScreenFocused]) const renderPostsEmpty = useCallback(() => { - return <EmptyState icon="feed" message="This feed is empty!" /> - }, []) + return <EmptyState icon="feed" message={_(msg`This feed is empty!`)} /> + }, [_]) return ( <View> @@ -643,7 +655,7 @@ const FeedSection = React.forwardRef<SectionRef, FeedSectionProps>( {(isScrolledDown || hasNew) && ( <LoadLatestBtn onPress={onScrollToTop} - label="Load new posts" + label={_(msg`Load new posts`)} showIndicator={hasNew} /> )} @@ -721,15 +733,30 @@ const AboutSection = React.forwardRef<SectionRef, AboutSectionProps>( </Text> )} <Text type="md" style={[pal.textLight]} numberOfLines={1}> - {isCurateList ? 'User list' : 'Moderation list'} by{' '} - {isOwner ? ( - 'you' + {isCurateList ? ( + isOwner ? ( + <Trans>User list by you</Trans> + ) : ( + <Trans> + User list by{' '} + <TextLink + text={sanitizeHandle(list.creator.handle || '', '@')} + href={makeProfileLink(list.creator)} + style={pal.textLight} + /> + </Trans> + ) + ) : isOwner ? ( + <Trans>Moderation list by you</Trans> ) : ( - <TextLink - text={sanitizeHandle(list.creator.handle || '', '@')} - href={makeProfileLink(list.creator)} - style={pal.textLight} - /> + <Trans> + Moderation list by{' '} + <TextLink + text={sanitizeHandle(list.creator.handle || '', '@')} + href={makeProfileLink(list.creator)} + style={pal.textLight} + /> + </Trans> )} </Text> </View> @@ -782,11 +809,11 @@ const AboutSection = React.forwardRef<SectionRef, AboutSectionProps>( return ( <EmptyState icon="users-slash" - message="This list is empty!" + message={_(msg`This list is empty!`)} style={{paddingTop: 40}} /> ) - }, []) + }, [_]) return ( <View> @@ -802,7 +829,7 @@ const AboutSection = React.forwardRef<SectionRef, AboutSectionProps>( {isScrolledDown && ( <LoadLatestBtn onPress={onScrollToTop} - label="Scroll to top" + label={_(msg`Scroll to top`)} showIndicator={false} /> )} @@ -846,7 +873,7 @@ function ErrorScreen({error}: {error: string}) { <Button type="default" accessibilityLabel={_(msg`Go Back`)} - accessibilityHint="Return to previous page" + accessibilityHint={_(msg`Return to previous page`)} onPress={onPressBack} style={{flexShrink: 1}}> <Text type="button" style={pal.text}> diff --git a/src/view/screens/SavedFeeds.tsx b/src/view/screens/SavedFeeds.tsx index 8a16ffdf2..19ae37f0c 100644 --- a/src/view/screens/SavedFeeds.tsx +++ b/src/view/screens/SavedFeeds.tsx @@ -160,7 +160,7 @@ export function SavedFeeds({}: Props) { type="sm" style={pal.link} href="https://github.com/bluesky-social/feed-generator" - text="See this guide" + text={_(msg`See this guide`)} />{' '} for more information. </Trans> @@ -188,6 +188,7 @@ function ListItem({ >['reset'] }) { const pal = usePalette('default') + const {_} = useLingui() const {isPending: isPinPending, mutateAsync: pinFeed} = usePinFeedMutation() const {isPending: isUnpinPending, mutateAsync: unpinFeed} = useUnpinFeedMutation() @@ -205,10 +206,10 @@ function ListItem({ await pinFeed({uri: feedUri}) } } catch (e) { - Toast.show('There was an issue contacting the server') + Toast.show(_(msg`There was an issue contacting the server`)) logger.error('Failed to toggle pinned feed', {error: e}) } - }, [feedUri, isPinned, pinFeed, unpinFeed, resetSaveFeedsMutationState]) + }, [feedUri, isPinned, pinFeed, unpinFeed, resetSaveFeedsMutationState, _]) const onPressUp = React.useCallback(async () => { if (!isPinned) return @@ -227,10 +228,10 @@ function ListItem({ index: pinned.indexOf(feedUri), }) } catch (e) { - Toast.show('There was an issue contacting the server') + Toast.show(_(msg`There was an issue contacting the server`)) logger.error('Failed to set pinned feed order', {error: e}) } - }, [feedUri, isPinned, setSavedFeeds, currentFeeds]) + }, [feedUri, isPinned, setSavedFeeds, currentFeeds, _]) const onPressDown = React.useCallback(async () => { if (!isPinned) return @@ -248,10 +249,10 @@ function ListItem({ index: pinned.indexOf(feedUri), }) } catch (e) { - Toast.show('There was an issue contacting the server') + Toast.show(_(msg`There was an issue contacting the server`)) logger.error('Failed to set pinned feed order', {error: e}) } - }, [feedUri, isPinned, setSavedFeeds, currentFeeds]) + }, [feedUri, isPinned, setSavedFeeds, currentFeeds, _]) return ( <Pressable diff --git a/src/view/screens/Search/Search.tsx b/src/view/screens/Search/Search.tsx index da3a82a4d..33356662a 100644 --- a/src/view/screens/Search/Search.tsx +++ b/src/view/screens/Search/Search.tsx @@ -535,7 +535,7 @@ export function SearchScreen( style={styles.headerMenuBtn} accessibilityRole="button" accessibilityLabel={_(msg`Menu`)} - accessibilityHint="Access navigation links and settings"> + accessibilityHint={_(msg`Access navigation links and settings`)}> <FontAwesomeIcon icon="bars" size={18} @@ -556,7 +556,7 @@ export function SearchScreen( <TextInput testID="searchTextInput" ref={textInput} - placeholder="Search" + placeholder={_(msg`Search`)} placeholderTextColor={pal.colors.textLight} selectTextOnFocus returnKeyType="search" diff --git a/src/view/screens/Settings.tsx b/src/view/screens/Settings.tsx index 8278b753e..c078e7a23 100644 --- a/src/view/screens/Settings.tsx +++ b/src/view/screens/Settings.tsx @@ -117,7 +117,7 @@ function SettingsAccountCard({account}: {account: SessionAccount}) { did: currentAccount?.did, handle: currentAccount?.handle, })} - title="Your profile" + title={_(msg`Your profile`)} noFeedback> {contents} </Link> @@ -129,8 +129,8 @@ function SettingsAccountCard({account}: {account: SessionAccount}) { isSwitchingAccounts ? undefined : () => onPressSwitchAccount(account) } accessibilityRole="button" - accessibilityLabel={`Switch to ${account.handle}`} - accessibilityHint="Switches the account you are logged in to"> + accessibilityLabel={_(msg`Switch to ${account.handle}`)} + accessibilityHint={_(msg`Switches the account you are logged in to`)}> {contents} </TouchableOpacity> ) @@ -318,7 +318,7 @@ export function SettingsScreen({}: Props) { </Text> <Link onPress={() => openModal({name: 'change-email'})}> <Text type="lg" style={pal.link}> - <Trans>Change</Trans> + <Trans context="action">Change</Trans> </Text> </Link> </View> @@ -368,7 +368,7 @@ export function SettingsScreen({}: Props) { onPress={isSwitchingAccounts ? undefined : onPressAddAccount} accessibilityRole="button" accessibilityLabel={_(msg`Add account`)} - accessibilityHint="Create a new Bluesky account"> + accessibilityHint={_(msg`Create a new Bluesky account`)}> <View style={[styles.iconContainer, pal.btn]}> <FontAwesomeIcon icon="plus" @@ -396,7 +396,7 @@ export function SettingsScreen({}: Props) { onPress={isSwitchingAccounts ? undefined : onPressInviteCodes} accessibilityRole="button" accessibilityLabel={_(msg`Invite`)} - accessibilityHint="Opens invite code list" + accessibilityHint={_(msg`Opens invite code list`)} disabled={invites?.disabled}> <View style={[ @@ -453,20 +453,20 @@ export function SettingsScreen({}: Props) { label={_(msg`System`)} left onSelect={() => setColorMode('system')} - accessibilityHint="Set color theme to system setting" + accessibilityHint={_(msg`Set color theme to system setting`)} /> <SelectableBtn selected={colorMode === 'light'} label={_(msg`Light`)} onSelect={() => setColorMode('light')} - accessibilityHint="Set color theme to light" + accessibilityHint={_(msg`Set color theme to light`)} /> <SelectableBtn selected={colorMode === 'dark'} label={_(msg`Dark`)} right onSelect={() => setColorMode('dark')} - accessibilityHint="Set color theme to dark" + accessibilityHint={_(msg`Set color theme to dark`)} /> </View> </View> @@ -544,8 +544,8 @@ export function SettingsScreen({}: Props) { ]} onPress={isSwitchingAccounts ? undefined : onPressLanguageSettings} accessibilityRole="button" - accessibilityHint="Language settings" - accessibilityLabel={_(msg`Opens configurable language settings`)}> + accessibilityLabel={_(msg`Language settings`)} + accessibilityHint={_(msg`Opens configurable language settings`)}> <View style={[styles.iconContainer, pal.btn]}> <FontAwesomeIcon icon="language" @@ -569,8 +569,8 @@ export function SettingsScreen({}: Props) { : () => navigation.navigate('Moderation') } accessibilityRole="button" - accessibilityHint="" - accessibilityLabel={_(msg`Opens moderation settings`)}> + accessibilityLabel={_(msg`Moderation settings`)} + accessibilityHint={_(msg`Opens moderation settings`)}> <View style={[styles.iconContainer, pal.btn]}> <HandIcon style={pal.text} size={18} strokeWidth={6} /> </View> @@ -598,8 +598,8 @@ export function SettingsScreen({}: Props) { : () => navigation.navigate('PreferencesExternalEmbeds') } accessibilityRole="button" - accessibilityHint="" - accessibilityLabel={_(msg`Opens external embeds settings`)}> + accessibilityLabel={_(msg`External media settings`)} + accessibilityHint={_(msg`Opens external embeds settings`)}> <View style={[styles.iconContainer, pal.btn]}> <FontAwesomeIcon icon={['far', 'circle-play']} @@ -625,8 +625,8 @@ export function SettingsScreen({}: Props) { ]} onPress={onPressAppPasswords} accessibilityRole="button" - accessibilityHint="Open app password settings" - accessibilityLabel={_(msg`Opens the app password settings page`)}> + accessibilityLabel={_(msg`App password settings`)} + accessibilityHint={_(msg`Opens the app password settings page`)}> <View style={[styles.iconContainer, pal.btn]}> <FontAwesomeIcon icon="lock" @@ -647,7 +647,7 @@ export function SettingsScreen({}: Props) { onPress={isSwitchingAccounts ? undefined : onPressChangeHandle} accessibilityRole="button" accessibilityLabel={_(msg`Change handle`)} - accessibilityHint="Choose a new Bluesky username or create"> + accessibilityHint={_(msg`Choose a new Bluesky username or create`)}> <View style={[styles.iconContainer, pal.btn]}> <FontAwesomeIcon icon="at" @@ -668,7 +668,9 @@ export function SettingsScreen({}: Props) { accessible={true} accessibilityRole="button" accessibilityLabel={_(msg`Delete account`)} - accessibilityHint="Opens modal for account deletion confirmation. Requires email code."> + accessibilityHint={_( + msg`Opens modal for account deletion confirmation. Requires email code.`, + )}> <View style={[styles.iconContainer, dangerBg]}> <FontAwesomeIcon icon={['far', 'trash-can']} @@ -708,8 +710,8 @@ export function SettingsScreen({}: Props) { style={[pal.view, styles.linkCardNoIcon]} onPress={onPressStorybook} accessibilityRole="button" - accessibilityHint="Open storybook page" - accessibilityLabel={_(msg`Opens the storybook page`)}> + accessibilityLabel={_(msg`Open storybook page`)} + accessibilityHint={_(msg`Opens the storybook page`)}> <Text type="lg" style={pal.text}> <Trans>Storybook</Trans> </Text> @@ -718,8 +720,8 @@ export function SettingsScreen({}: Props) { style={[pal.view, styles.linkCardNoIcon]} onPress={onPressResetPreferences} accessibilityRole="button" - accessibilityHint="Reset preferences" - accessibilityLabel={_(msg`Resets the preferences state`)}> + accessibilityLabel={_(msg`Reset preferences`)} + accessibilityHint={_(msg`Resets the preferences state`)}> <Text type="lg" style={pal.text}> <Trans>Reset preferences state</Trans> </Text> @@ -728,8 +730,8 @@ export function SettingsScreen({}: Props) { style={[pal.view, styles.linkCardNoIcon]} onPress={onPressResetOnboarding} accessibilityRole="button" - accessibilityHint="Reset onboarding" - accessibilityLabel={_(msg`Resets the onboarding state`)}> + accessibilityLabel={_(msg`Reset onboarding`)} + accessibilityHint={_(msg`Resets the onboarding state`)}> <Text type="lg" style={pal.text}> <Trans>Reset onboarding state</Trans> </Text> @@ -738,8 +740,8 @@ export function SettingsScreen({}: Props) { style={[pal.view, styles.linkCardNoIcon]} onPress={clearAllLegacyStorage} accessibilityRole="button" - accessibilityHint="Clear all legacy storage data" - accessibilityLabel={_(msg`Clear all legacy storage data`)}> + accessibilityLabel={_(msg`Clear all legacy storage data`)} + accessibilityHint={_(msg`Clear all legacy storage data`)}> <Text type="lg" style={pal.text}> <Trans> Clear all legacy storage data (restart after this) @@ -750,8 +752,8 @@ export function SettingsScreen({}: Props) { style={[pal.view, styles.linkCardNoIcon]} onPress={clearAllStorage} accessibilityRole="button" - accessibilityHint="Clear all storage data" - accessibilityLabel={_(msg`Clear all storage data`)}> + accessibilityLabel={_(msg`Clear all storage data`)} + accessibilityHint={_(msg`Clear all storage data`)}> <Text type="lg" style={pal.text}> <Trans>Clear all storage data (restart after this)</Trans> </Text> diff --git a/src/view/screens/Support.tsx b/src/view/screens/Support.tsx index 6856f6759..9e7d36ec7 100644 --- a/src/view/screens/Support.tsx +++ b/src/view/screens/Support.tsx @@ -34,10 +34,10 @@ export const SupportScreen = (_props: Props) => { </Text> <Text style={[pal.text, s.p20]}> <Trans> - The support form has been moved. If you need help, please + The support form has been moved. If you need help, please{' '} <TextLink href={HELP_DESK_URL} - text=" click here" + text={_(msg`click here`)} style={pal.link} />{' '} or visit {HELP_DESK_URL} to get in touch with us. |