diff options
Diffstat (limited to 'src/view/com/notifications')
-rw-r--r-- | src/view/com/notifications/Feed.tsx | 11 | ||||
-rw-r--r-- | src/view/com/notifications/FeedItem.tsx | 23 |
2 files changed, 22 insertions, 12 deletions
diff --git a/src/view/com/notifications/Feed.tsx b/src/view/com/notifications/Feed.tsx index a99fe2c1d..2088acbac 100644 --- a/src/view/com/notifications/Feed.tsx +++ b/src/view/com/notifications/Feed.tsx @@ -13,6 +13,8 @@ import {logger} from '#/logger' import {cleanError} from '#/lib/strings/errors' import {useModerationOpts} from '#/state/queries/preferences' import {List, ListRef} from '../util/List' +import {useLingui} from '@lingui/react' +import {msg} from '@lingui/macro' const EMPTY_FEED_ITEM = {_reactKey: '__empty__'} const LOAD_MORE_ERROR_ITEM = {_reactKey: '__load_more_error__'} @@ -31,6 +33,7 @@ export function Feed({ }) { const [isPTRing, setIsPTRing] = React.useState(false) + const {_} = useLingui() const moderationOpts = useModerationOpts() const {checkUnread} = useUnreadNotificationsApi() const { @@ -101,14 +104,16 @@ export function Feed({ return ( <EmptyState icon="bell" - message="No notifications yet!" + message={_(msg`No notifications yet!`)} style={styles.emptyState} /> ) } else if (item === LOAD_MORE_ERROR_ITEM) { return ( <LoadMoreRetryBtn - label="There was an issue fetching notifications. Tap here to try again." + label={_( + msg`There was an issue fetching notifications. Tap here to try again.`, + )} onPress={onPressRetryLoadMore} /> ) @@ -117,7 +122,7 @@ export function Feed({ } return <FeedItem item={item} moderationOpts={moderationOpts!} /> }, - [onPressRetryLoadMore, moderationOpts], + [onPressRetryLoadMore, moderationOpts, _], ) const FeedFooter = React.useCallback( diff --git a/src/view/com/notifications/FeedItem.tsx b/src/view/com/notifications/FeedItem.tsx index 24b7e4fb6..0dfac2a83 100644 --- a/src/view/com/notifications/FeedItem.tsx +++ b/src/view/com/notifications/FeedItem.tsx @@ -65,6 +65,7 @@ let FeedItem = ({ moderationOpts: ModerationOpts }): React.ReactNode => { const pal = usePalette('default') + const {_} = useLingui() const [isAuthorsExpanded, setAuthorsExpanded] = useState<boolean>(false) const itemHref = useMemo(() => { if (item.type === 'post-like' || item.type === 'repost') { @@ -151,24 +152,24 @@ let FeedItem = ({ let icon: Props['icon'] | 'HeartIconSolid' let iconStyle: Props['style'] = [] if (item.type === 'post-like') { - action = 'liked your post' + action = _(msg`liked your post`) icon = 'HeartIconSolid' iconStyle = [ s.likeColor as FontAwesomeIconStyle, {position: 'relative', top: -4}, ] } else if (item.type === 'repost') { - action = 'reposted your post' + action = _(msg`reposted your post`) icon = 'retweet' iconStyle = [s.green3 as FontAwesomeIconStyle] } else if (item.type === 'follow') { - action = 'followed you' + action = _(msg`followed you`) icon = 'user-plus' iconStyle = [s.blue3 as FontAwesomeIconStyle] } else if (item.type === 'feedgen-like') { - action = `liked your custom feed${ - item.subjectUri ? ` '${new AtUri(item.subjectUri).rkey}'` : '' - }` + action = item.subjectUri + ? _(msg`liked your custom feed '${new AtUri(item.subjectUri).rkey}'`) + : _(msg`liked your custom feed`) icon = 'HeartIconSolid' iconStyle = [ s.likeColor as FontAwesomeIconStyle, @@ -314,14 +315,16 @@ function CondensedAuthorsList({ onPress={onToggleAuthorsExpanded} accessibilityRole="button" accessibilityLabel={_(msg`Hide user list`)} - accessibilityHint="Collapses list of users for a given notification"> + accessibilityHint={_( + msg`Collapses list of users for a given notification`, + )}> <FontAwesomeIcon icon="angle-up" size={18} style={[styles.expandedAuthorsCloseBtnIcon, pal.text]} /> <Text type="sm-medium" style={pal.text}> - <Trans>Hide</Trans> + <Trans context="action">Hide</Trans> </Text> </TouchableOpacity> </View> @@ -343,7 +346,9 @@ function CondensedAuthorsList({ return ( <TouchableOpacity accessibilityLabel={_(msg`Show users`)} - accessibilityHint="Opens an expanded list of users in this notification" + accessibilityHint={_( + msg`Opens an expanded list of users in this notification`, + )} onPress={onToggleAuthorsExpanded}> <View style={styles.avis}> {authors.slice(0, MAX_AUTHORS).map(author => ( |