From 8ea63a2784ce3c20e1fb9eb54687288466971401 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Thu, 8 Jun 2023 09:33:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=84=E8=AE=BA=E7=9D=80?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E6=98=BE=E7=A4=BA=E6=96=87=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lang/en_us.json | 1 + src/lang/zh_cn.json | 1 + src/screens/Comment/components/CommentFloor.tsx | 4 +++- src/utils/musicSdk/tx/comment.js | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lang/en_us.json b/src/lang/en_us.json index 813f9a7a..f041a211 100644 --- a/src/lang/en_us.json +++ b/src/lang/en_us.json @@ -89,6 +89,7 @@ "list_update_success": "{name} updated successfully", "load_failed": "Ah, loading failed 😥", "loading": "Loading...", + "location": "From {location}", "lyric__load_error": "Failed to get lyrics", "move_to": "Move to...", "name": "Name: {name}", diff --git a/src/lang/zh_cn.json b/src/lang/zh_cn.json index 6b0df94d..c8bb74cf 100644 --- a/src/lang/zh_cn.json +++ b/src/lang/zh_cn.json @@ -89,6 +89,7 @@ "list_update_success": "{name} 更新成功", "load_failed": "啊 加载失败了 😥", "loading": "加载中...", + "location": "来自{location}", "lyric__load_error": "歌词获取失败", "move_to": "移动到...", "name": "歌曲名:{name}", diff --git a/src/screens/Comment/components/CommentFloor.tsx b/src/screens/Comment/components/CommentFloor.tsx index 1698b189..1f5a75d9 100644 --- a/src/screens/Comment/components/CommentFloor.tsx +++ b/src/screens/Comment/components/CommentFloor.tsx @@ -9,6 +9,7 @@ import Text from '@/components/common/Text' import { scaleSizeH, scaleSizeW } from '@/utils/pixelRatio' import ScaledImage from '@/components/common/ScaledImage' import { useLayout } from '@/utils/hooks' +import { useI18n } from '@/lang' // eslint-disable-next-line @typescript-eslint/no-var-requires const defaultUser = require('@/resources/images/defaultUser.jpg') @@ -23,6 +24,7 @@ const CommentFloor = memo(({ comment, isLast }: { const theme = useTheme() const [isAvatarError, setIsAvatarError] = useState(false) const { onLayout, width } = useLayout() + const t = useI18n() const handleAvatarError = useCallback(() => { setIsAvatarError(true) @@ -74,7 +76,7 @@ const CommentFloor = memo(({ comment, isLast }: { {comment.timeStr} - { comment.location ? {comment.location} : null } + { comment.location ? {t('location', { location: comment.location })} : null } {likedCount} diff --git a/src/utils/musicSdk/tx/comment.js b/src/utils/musicSdk/tx/comment.js index 2db79753..09745c43 100644 --- a/src/utils/musicSdk/tx/comment.js +++ b/src/utils/musicSdk/tx/comment.js @@ -244,7 +244,7 @@ export default { userName: item.Nick ?? '', images: item.Pic ? [item.Pic] : [], avatar: item.Avatar, - location: item.Location ? ('来自' + item.Location) : '', + location: item.Location ? item.Location : '', userId: item.EncryptUin, likedCount: item.PraiseNum, reply: item.SubComments