diff --git a/src/lang/en_us.json b/src/lang/en_us.json index 813f9a7..f041a21 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 6b0df94..c8bb74c 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 1698b18..1f5a75d 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 2db7975..09745c4 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