fix initial translation loading on starting page

pull/224/head
Jon Eugster 2 years ago
parent 10391b616c
commit 684a1bc72b

@ -39,13 +39,16 @@ function Tile({gameId, data}: {gameId: string, data: GameTile|undefined}) {
navigate(gameId);
}
// we use this to reload the tile 1x after the translation is loaded.
let [loadedTranslation, setLoadedTranslation] = React.useState(false)
// Load the namespace of the game
i18next.loadNamespaces(gameId).catch(err => {}).then(() => {setLoadedTranslation(true)})
if (typeof data === 'undefined') {
return <></>
}
// Load the namespace of the game
i18next.loadNamespaces(gameId)
return <div className="game" onClick={routeChange}>
<div className="wrapper">
<div className="title">{t(data.title, { ns: gameId })}</div>

Loading…
Cancel
Save