Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
f2f0a56
translate `Discover` and `Following` feed names in feed.ts
surfdude29 May 16, 2025
f371a10
translate `Discover` feed name in DiscoverFallbackHeader.tsx
surfdude29 May 16, 2025
84d3ca6
Merge branch 'bluesky-social:main' into translate-discover-and-follow…
surfdude29 May 18, 2025
9d61198
Merge branch 'bluesky-social:main' into translate-discover-and-follow…
surfdude29 May 20, 2025
f2a0984
Merge branch 'bluesky-social:main' into translate-discover-and-follow…
surfdude29 May 21, 2025
bdb9864
Merge branch 'bluesky-social:main' into translate-discover-and-follow…
surfdude29 May 25, 2025
64d17fa
also make `Feeds ✨` string in HomeHeader.tsx translatable
surfdude29 May 25, 2025
81b7c93
lint
surfdude29 May 25, 2025
ca91f49
add comment for translators
surfdude29 May 25, 2025
0c204aa
correct comment
surfdude29 May 27, 2025
cf43444
Merge branch 'bluesky-social:main' into translate-discover-and-follow…
surfdude29 May 29, 2025
28a458f
Merge branch 'bluesky-social:main' into translate-discover-and-follow…
surfdude29 May 31, 2025
d87f19b
Merge branch 'bluesky-social:main' into translate-discover-and-follow…
surfdude29 Jun 8, 2025
ad2c215
Merge branch 'bluesky-social:main' into translate-discover-and-follow…
surfdude29 Jun 16, 2025
de646cc
Merge branch 'bluesky-social:main' into translate-discover-and-follow…
surfdude29 Jun 23, 2025
9e38589
Merge branch 'bluesky-social:main' into translate-discover-and-follow…
surfdude29 Jul 22, 2025
b414773
Merge branch 'bluesky-social:main' into translate-discover-and-follow…
surfdude29 Aug 11, 2025
6b2a9bf
Merge branch 'bluesky-social:main' into translate-discover-and-follow…
surfdude29 Sep 11, 2025
d157c7b
Merge branch 'bluesky-social:main' into translate-discover-and-follow…
surfdude29 Oct 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/state/queries/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
moderateFeedGenerator,
RichText,
} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {
type InfiniteData,
keepPreviousData,
Expand Down Expand Up @@ -423,6 +425,7 @@ const pinnedFeedInfosQueryKeyRoot = 'pinnedFeedsInfos'
export function usePinnedFeedsInfos() {
const {hasSession} = useSession()
const agent = useAgent()
const {_} = useLingui()
const {data: preferences, isLoading: isLoadingPrefs} = usePreferencesQuery()
const pinnedItems = preferences?.savedFeeds.filter(feed => feed.pinned) ?? []

Expand All @@ -436,7 +439,12 @@ export function usePinnedFeedsInfos() {
],
queryFn: async () => {
if (!hasSession) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After I opened this PR, I asked Claude about this and realised that this code path only runs when the user is logged out, so I think this means that Discover would only show up as translated in the PWI, and not when logged in?

I asked Claude how to fix it but couldn't come up with anything that looked like it would work 🤔

return [PWI_DISCOVER_FEED_STUB]
return [
{
...PWI_DISCOVER_FEED_STUB,
displayName: _(msg({message: 'Discover', context: 'feed-name'})),
},
]
}

let resolved = new Map<string, FeedSourceInfo>()
Expand Down Expand Up @@ -486,7 +494,7 @@ export function usePinnedFeedsInfos() {
} else if (pinnedItem.type === 'timeline') {
result.push({
type: 'feed',
displayName: 'Following',
displayName: _(msg({message: 'Following', context: 'feed-name'})),
uri: pinnedItem.value,
feedDescriptor: 'following',
route: {
Expand Down
15 changes: 13 additions & 2 deletions src/view/com/home/HomeHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {useNavigation} from '@react-navigation/native'

import {type NavigationProp} from '#/lib/routes/types'
Expand All @@ -18,6 +20,7 @@ export function HomeHeader(
const {feeds, onSelect: onSelectProp} = props
const {hasSession} = useSession()
const navigation = useNavigation<NavigationProp>()
const {_} = useLingui()

const hasPinnedCustom = React.useMemo<boolean>(() => {
if (!hasSession) return false
Expand All @@ -30,10 +33,18 @@ export function HomeHeader(
const items = React.useMemo(() => {
const pinnedNames = feeds.map(f => f.displayName)
if (!hasPinnedCustom) {
return pinnedNames.concat('Feeds ✨')
return pinnedNames.concat(
_(
msg({
message: 'Feeds ✨',
comment:
'Shown in tab bar on Home screen when logged out and when the user has no pinned feeds',
}),
),
)
}
return pinnedNames
}, [hasPinnedCustom, feeds])
}, [hasPinnedCustom, feeds, _])

const onPressFeedsLink = React.useCallback(() => {
navigation.navigate('Feeds')
Expand Down
6 changes: 4 additions & 2 deletions src/view/com/posts/DiscoverFallbackHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {View} from 'react-native'
import {Trans} from '@lingui/macro'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'

import {usePalette} from '#/lib/hooks/usePalette'
import {InfoCircleIcon} from '#/lib/icons'
Expand All @@ -8,6 +9,7 @@ import {Text} from '../util/text/Text'

export function DiscoverFallbackHeader() {
const pal = usePalette('default')
const {_} = useLingui()
return (
<View
style={[
Expand All @@ -31,7 +33,7 @@ export function DiscoverFallbackHeader() {
<TextLink
type="md-medium"
href="/profile/bsky.app/feed/whats-hot"
text="Discover"
text={_(msg({message: 'Discover', context: 'feed-name'}))}
style={pal.link}
/>
.
Expand Down