From 879d6dfa283f4bfa19090a1a7e23a3828bf033b1 Mon Sep 17 00:00:00 2001
From: Stephen Zhou <38493346+hyoban@users.noreply.github.com>
Date: Fri, 28 Mar 2025 16:28:12 +0800
Subject: [PATCH] fix(mobile): translation separator, translate for entry title
---
apps/mobile/src/modules/entry-content/EntryTitle.tsx | 10 +++++++++-
.../modules/entry-list/templates/EntryTranslation.tsx | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/apps/mobile/src/modules/entry-content/EntryTitle.tsx b/apps/mobile/src/modules/entry-content/EntryTitle.tsx
index 34247fb7a..4b32faac4 100644
--- a/apps/mobile/src/modules/entry-content/EntryTitle.tsx
+++ b/apps/mobile/src/modules/entry-content/EntryTitle.tsx
@@ -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)
}}
>
- {title.trim()}
+
>
)
diff --git a/apps/mobile/src/modules/entry-list/templates/EntryTranslation.tsx b/apps/mobile/src/modules/entry-list/templates/EntryTranslation.tsx
index 7d6568755..5ab6524eb 100644
--- a/apps/mobile/src/modules/entry-list/templates/EntryTranslation.tsx
+++ b/apps/mobile/src/modules/entry-list/templates/EntryTranslation.tsx
@@ -39,7 +39,7 @@ export const EntryTranslation = ({
if (inline) {
return (
- {`${nextTarget ? `${nextTarget} ` : ""}${nextSource}`}
+ {`${nextTarget ? `${nextTarget} | ` : ""}${nextSource}`}
)
}