Fix translations for posts on profiles

This commit is contained in:
DS Boyce
2026-03-03 12:03:30 -08:00
parent 1c5522164e
commit 06daefabac
2 changed files with 30 additions and 14 deletions
@@ -533,7 +533,6 @@ const ThreadItemAnchorInner = memo(function ThreadItemAnchorInner({
feedContext={postSource?.post?.feedContext}
reqId={postSource?.post?.reqId}
viaRepost={viaRepost}
forceGoogleTranslate={true}
/>
</FeedFeedbackProvider>
</View>
+30 -13
View File
@@ -42,6 +42,7 @@ import {Embed} from '#/components/Post/Embed'
import {PostEmbedViewContext} from '#/components/Post/Embed/types'
import {PostRepliedTo} from '#/components/Post/PostRepliedTo'
import {ShowMoreTextButton} from '#/components/Post/ShowMoreTextButton'
import {TranslatedPost} from '#/components/Post/Translated'
import {PostControls} from '#/components/PostControls'
import {DiscoverDebug} from '#/components/PostControls/DiscoverDebug'
import {RichText} from '#/components/RichText'
@@ -450,6 +451,14 @@ let PostContent = ({
: []
}, [post, currentAccount?.did, threadgateHiddenReplies])
const record = useMemo<AppBskyFeedPost.Record | undefined>(
() =>
bsky.validate(post.record, AppBskyFeedPost.validateRecord)
? post.record
: undefined,
[post],
)
const onPressShowMore = useCallback(() => {
setLimitLines(false)
}, [setLimitLines])
@@ -466,20 +475,28 @@ let PostContent = ({
additionalCauses={additionalPostAlerts}
/>
{richText.text ? (
<View style={[a.mb_2xs]}>
<RichText
enableTags
testID="postText"
value={richText}
numberOfLines={limitLines ? MAX_POST_LINES : undefined}
style={[a.flex_1, a.text_md]}
authorHandle={postAuthor.handle}
shouldProxyLinks={true}
/>
{limitLines && (
<ShowMoreTextButton style={[a.text_md]} onPress={onPressShowMore} />
<>
<View style={[a.mb_2xs]}>
<RichText
enableTags
testID="postText"
value={richText}
numberOfLines={limitLines ? MAX_POST_LINES : undefined}
style={[a.flex_1, a.text_md]}
authorHandle={postAuthor.handle}
shouldProxyLinks={true}
/>
{limitLines && (
<ShowMoreTextButton
style={[a.text_md]}
onPress={onPressShowMore}
/>
)}
</View>
{record && (
<TranslatedPost translationKey={post.uri} postText={record.text} />
)}
</View>
</>
) : undefined}
{postEmbed ? (
<View style={[a.pb_xs]}>