mark most of the game text for translation

This commit is contained in:
Jon Eugster
2024-03-27 02:03:05 +01:00
parent 1a54edffd4
commit d60dc3fcb2
7 changed files with 26 additions and 13 deletions
+6 -1
View File
@@ -4,6 +4,8 @@
import * as React from 'react'
import { Typography } from '@mui/material'
import Markdown from '../markdown'
import { useTranslation } from 'react-i18next'
import { GameIdContext } from '../../app'
/** Pop-up that is displaying the Game Info.
*
@@ -11,12 +13,15 @@ import Markdown from '../markdown'
* controlled by the containing element.
*/
export function InfoPopup ({info, handleClose}: {info: string, handleClose: () => void}) {
let { t } = useTranslation()
const gameId = React.useContext(GameIdContext)
return <div className="modal-wrapper">
<div className="modal-backdrop" onClick={handleClose} />
<div className="modal">
<div className="codicon codicon-close modal-close" onClick={handleClose}></div>
<Typography variant="body1" component="div" className="welcome-text">
<Markdown>{info}</Markdown>
<Markdown>{t(info, {ns: gameId})}</Markdown>
</Typography>
</div>
</div>