fix(mobile): translation separator, translate for entry title

This commit is contained in:
Stephen Zhou
2025-03-28 16:28:12 +08:00
parent 48bae78253
commit 879d6dfa28
2 changed files with 10 additions and 2 deletions
@@ -21,11 +21,14 @@ import { EntryContentContext, useEntryContentContext } from "@/src/modules/entry
import { EntryContentHeaderRightActions } from "@/src/modules/entry-content/EntryContentHeaderRightActions"
import { useEntry } from "@/src/store/entry/hooks"
import { useFeed } from "@/src/store/feed/hooks"
import { useEntryTranslation } from "@/src/store/translation/hooks"
import { EntryTranslation } from "../entry-list/templates/EntryTranslation"
import { useHeaderHeight } from "../screen/hooks/useHeaderHeight"
import { EntryReadHistory } from "./EntryReadHistory"
export const EntryTitle = ({ title, entryId }: { title: string; entryId: string }) => {
const translation = useEntryTranslation(entryId)
const reanimatedScrollY = useContext(ScreenItemContext).reAnimatedScrollY
const [titleHeight, setTitleHeight] = useState(0)
@@ -94,7 +97,12 @@ export const EntryTitle = ({ title, entryId }: { title: string; entryId: string
setTitleHeight(titleHeight)
}}
>
<Text className="text-label px-4 text-4xl font-bold leading-snug">{title.trim()}</Text>
<EntryTranslation
className="text-label px-4 text-4xl font-bold leading-snug"
source={title}
target={translation?.title}
inline
/>
</View>
</>
)
@@ -39,7 +39,7 @@ export const EntryTranslation = ({
if (inline) {
return (
<Text {...props} className={className}>
{`${nextTarget ? `${nextTarget} ` : ""}${nextSource}`}
{`${nextTarget ? `${nextTarget} | ` : ""}${nextSource}`}
</Text>
)
}