diff --git a/client/src/components/landing_page.tsx b/client/src/components/landing_page.tsx index 54e038bc..e2003849 100644 --- a/client/src/components/landing_page.tsx +++ b/client/src/components/landing_page.tsx @@ -15,18 +15,10 @@ import {PrivacyPolicyPopup} from './popup/privacy_policy' import { GameTile, useGetGameInfoQuery } from '../state/api' import path from 'path'; -import lean4gameConfig from '../config.json' import { PreferencesPopup } from './popup/preferences'; import { ImpressumButton, MenuButton, PreferencesButton } from './app_bar'; - -const flag = { - 'Dutch': '🇳🇱', - 'English': '🇬🇧', - 'French': '🇫🇷', - 'German': '🇩🇪', - 'Italian': '🇮🇹', - 'Spanish': '🇪🇸', -} +import ReactCountryFlag from 'react-country-flag'; +import lean4gameConfig from '../config.json' function GithubIcon({url='https://github.com'}) { @@ -74,7 +66,16 @@ function Tile({gameId, data}: {gameId: string, data: GameTile|undefined}) { {t("Language")} - {data.languages.map((lan) => flag[lan]).join(', ')} + + + {data.languages.map((lang) => { + let langOpt = lean4gameConfig.languages.find((e) => e.iso == lang) + if (langOpt) { + return + } else + return <> + })} + diff --git a/server/GameServer/Commands.lean b/server/GameServer/Commands.lean index 5849ae96..058b2999 100644 --- a/server/GameServer/Commands.lean +++ b/server/GameServer/Commands.lean @@ -110,8 +110,9 @@ elab "CaptionLong" t:str : command => do modifyCurGame fun game => pure {game with tile := {game.tile with long := caption}} -/-- A list of Languages the game is translated to. For example `Languages "German" "English"`. -NOTE: For the time being, only a single language is supported. +/-- A list of Languages the game is translated to. For example `Languages "de" "en"`. + +The keys are ISO language codes. -/ elab "Languages" t:str* : command => do modifyCurGame fun game => pure {game with