diff options
author | surfdude29 <149612116+surfdude29@users.noreply.github.com> | 2025-02-24 21:11:01 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-24 13:11:01 -0800 |
commit | 3fc4c32ac62403269340c40ad529bfa67cd0a35a (patch) | |
tree | 37d9a8cb8ae30e0ebdfd0465e5e4a7f24800acee /src/view/shell/bottom-bar/BottomBar.tsx | |
parent | a383b9ba28d0fffa5692ffcc4f9ca744924a7d14 (diff) | |
download | voidsky-3fc4c32ac62403269340c40ad529bfa67cd0a35a.tar.zst |
Plural formatting for accessibility `unread items` strings (#7743)
Diffstat (limited to 'src/view/shell/bottom-bar/BottomBar.tsx')
-rw-r--r-- | src/view/shell/bottom-bar/BottomBar.tsx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/view/shell/bottom-bar/BottomBar.tsx b/src/view/shell/bottom-bar/BottomBar.tsx index 4f3e790de..7b760b069 100644 --- a/src/view/shell/bottom-bar/BottomBar.tsx +++ b/src/view/shell/bottom-bar/BottomBar.tsx @@ -2,7 +2,7 @@ import React, {ComponentProps} from 'react' import {GestureResponderEvent, View} from 'react-native' import Animated from 'react-native-reanimated' import {useSafeAreaInsets} from 'react-native-safe-area-context' -import {msg, Trans} from '@lingui/macro' +import {msg, plural, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {BottomTabBarProps} from '@react-navigation/bottom-tabs' import {StackActions} from '@react-navigation/native' @@ -204,7 +204,12 @@ export function BottomBar({navigation}: BottomTabBarProps) { accessibilityLabel={_(msg`Chat`)} accessibilityHint={ numUnreadMessages.count > 0 - ? _(msg`${numUnreadMessages.numUnread} unread items`) + ? _( + msg`${plural(numUnreadMessages.numUnread ?? 0, { + one: '# unread item', + other: '# unread items', + })}` || '', + ) : '' } /> @@ -231,7 +236,12 @@ export function BottomBar({navigation}: BottomTabBarProps) { accessibilityHint={ numUnreadNotifications === '' ? '' - : _(msg`${numUnreadNotifications} unread items`) + : _( + msg`${plural(numUnreadNotifications ?? 0, { + one: '# unread item', + other: '# unread items', + })}` || '', + ) } /> <Btn |