@@ -31,6 +31,7 @@ import { Backup } from './Backup';
3131import { getGameById } from '@/utils/repository' ;
3232import i18n from '@/utils/i18n' ;
3333import { getGameDisplayName } from '@/utils' ;
34+ import { translateTags } from '@/utils/tagTranslation' ;
3435
3536
3637// Tab面板组件
@@ -70,7 +71,7 @@ const TabPanel = (props: TabPanelProps) => {
7071export const Detail : React . FC = ( ) => {
7172 const id = Number ( useLocation ( ) . pathname . split ( '/' ) . pop ( ) ) ;
7273 const { t } = useTranslation ( ) ;
73- const { setSelectedGameId, selectedGame, fetchGame } = useStore ( ) ;
74+ const { setSelectedGameId, selectedGame, fetchGame, tagTranslation } = useStore ( ) ;
7475 const [ tabIndex , setTabIndex ] = useState ( 0 ) ;
7576 const [ isLoading , setIsLoading ] = useState ( true ) ; // 添加加载状态
7677 const [ currentId , setCurrentId ] = useState < number | null > ( null ) ; // 跟踪当前显示的游戏ID
@@ -190,8 +191,8 @@ export const Detail: React.FC = () => {
190191 < Box className = "mt-2" >
191192 < Typography variant = "subtitle2" fontWeight = "bold" gutterBottom component = "div" > { t ( 'pages.Detail.gameTags' ) } </ Typography >
192193 < Stack direction = "row" className = "flex-wrap gap-1" >
193- { selectedGame . tags ? .map ( tag => (
194- < Chip key = { tag } label = { tag } size = "small" variant = "outlined" />
194+ { translateTags ( selectedGame . tags || [ ] , tagTranslation ) . map ( ( tag , index ) => (
195+ < Chip key = { ` ${ selectedGame . tags ?. [ index ] || tag } - ${ index } ` } label = { tag } size = "small" variant = "outlined" />
195196 ) ) }
196197 </ Stack >
197198 </ Box >
0 commit comments