将文本翻译成英语

This commit is contained in:
2025-12-04 18:52:57 +08:00
parent b4a86baaee
commit ffe4bacc82
9 changed files with 43 additions and 39 deletions

View File

@@ -88,7 +88,7 @@
<!-- <Findmore /> -->
<view v-else class="loading-container">
<text>ページ読み込み中...</text>
<text>Loading...</text>
</view>
</template>
@@ -102,7 +102,7 @@ import Comments from '@/pages/comments/comments.vue'
import Intereact from '@/pages/intereact/intereact.vue'
import { getPostList, getPostVideo, getUserImg } from '@/api/api.js'
// 导入翻译工具
import { translateZhToJa, translationCache } from '@/utils/translate.js'
import { translateZhToEn, translationCache } from '@/utils/translate.js'
const common = useCommonStore()
const formatCount = common.formatCount
@@ -275,8 +275,8 @@ onLoad(() => {
// 并行翻译需要翻译的内容
Promise.all([
translateZhToJa(userName),
translateZhToJa(copywriting)
translateZhToEn(userName),
translateZhToEn(copywriting)
]).then(([translatedUserName, translatedCopywriting]) => {
// 更新视频数据 - 使用翻译后的内容
data.userName = translatedUserName