diff --git a/client/src/components/landing_page.tsx b/client/src/components/landing_page.tsx index 26ab89b..30fb2d4 100644 --- a/client/src/components/landing_page.tsx +++ b/client/src/components/landing_page.tsx @@ -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
{t(data.title, { ns: gameId })}