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
+19
View File
@@ -0,0 +1,19 @@
import {type I18n} from '@lingui/core'
import {msg} from '@lingui/core/macro'
import {DISCOVER_FEED_URI, TIMELINE_SAVED_FEED} from '#/lib/constants'
type FeedNameSource = {
displayName: string
uri: string
}
export function getLocalizedFeedName(feed: FeedNameSource, i18n: I18n): string {
if (feed.uri === TIMELINE_SAVED_FEED.value) {
return i18n._(msg({message: 'Following', context: 'feed-name'}))
}
if (feed.uri === DISCOVER_FEED_URI) {
return i18n._(msg({message: 'Discover', context: 'feed-name'}))
}
return feed.displayName
}