Fix localization for Following and Discover feed names (#11572)

This commit is contained in:
DS Boyce
2026-09-02 07:24:34 -07:00
committed by GitHub
parent f288e18baa
commit 701d7c4659
5 changed files with 56 additions and 25 deletions
+10 -10
View File
@@ -1,10 +1,10 @@
import {Pressable, View} from 'react-native'
import {msg} from '@lingui/core/macro'
import {useLingui} from '@lingui/react'
import {useLingui} from '@lingui/react/macro'
import {useNavigation, useNavigationState} from '@react-navigation/native'
import {getCurrentRoute} from '#/lib/routes/helpers'
import {type NavigationProp} from '#/lib/routes/types'
import {getLocalizedFeedName} from '#/lib/strings/feed-names'
import {emitSoftReset} from '#/state/events'
import {
type SavedFeedSourceInfo,
@@ -22,7 +22,7 @@ import {useAnalytics} from '#/analytics'
export function DesktopFeeds() {
const t = useTheme()
const {_} = useLingui()
const {t: l} = useLingui()
const ax = useAnalytics()
const {data: pinnedFeedInfos, error, isLoading} = usePinnedFeedsInfos()
const selectedFeed = useSelectedFeed()
@@ -100,10 +100,9 @@ export function DesktopFeeds() {
/>
)
})}
<Link
to="/feeds"
label={_(msg`More feeds`)}
label={l`More feeds`}
style={[
a.flex_row,
a.align_center,
@@ -150,7 +149,7 @@ export function DesktopFeeds() {
: t.atoms.text_contrast_medium,
]}
numberOfLines={1}>
{_(msg`More feeds`)}
{l`More feeds`}
</Text>
</>
)
@@ -170,19 +169,20 @@ function FeedItem({
onPress: () => void
}) {
const t = useTheme()
const {_} = useLingui()
const {t: l, i18n} = useLingui()
const {
state: hovered,
onIn: onHoverIn,
onOut: onHoverOut,
} = useInteractionState()
const isFollowing = feedInfo.feedDescriptor === 'following'
const displayName = getLocalizedFeedName(feedInfo, i18n)
return (
<Pressable
accessibilityRole="link"
accessibilityLabel={feedInfo.displayName}
accessibilityHint={_(msg`Opens ${feedInfo.displayName} feed`)}
accessibilityLabel={displayName}
accessibilityHint={l`Opens ${displayName} feed`}
onPress={onPress}
onHoverIn={onHoverIn}
onHoverOut={onHoverOut}
@@ -231,7 +231,7 @@ function FeedItem({
: t.atoms.text_contrast_medium,
]}
numberOfLines={1}>
{feedInfo.displayName}
{displayName}
</Text>
</Pressable>
)