Skip to content

Commit

Permalink
add config option to disable flags in preferences #208
Browse files Browse the repository at this point in the history
  • Loading branch information
joneugster committed Apr 18, 2024
1 parent 3ddcc35 commit 8cf358e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion client/src/components/popup/preferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export function PreferencesPopup({ handleClose }: { handleClose: () => void }) {
let { t } = useTranslation()
const {layout, isSavePreferences, language, setLayout, setIsSavePreferences, setLanguage} = React.useContext(PreferencesContext)



const marks = [
{
value: 0,
Expand Down Expand Up @@ -59,7 +61,13 @@ export function PreferencesPopup({ handleClose }: { handleClose: () => void }) {
value={language}
label={t("Language")}
onChange={handlerChangeLanguage}>
{lean4gameConfig.languages.map(lang => {return <MenuItem key={`menu-item-lang-${lang.iso}`} value={lang.iso}><ReactCountryFlag countryCode={lang.flag}/>&nbsp;{lang.name}</MenuItem>})}
{lean4gameConfig.languages.map(lang => {
return <MenuItem key={`menu-item-lang-${lang.iso}`} value={lang.iso}>
{lean4gameConfig.useFlags && <ReactCountryFlag countryCode={lang.flag}/>}
&nbsp;
{lang.name}
</MenuItem>
})}
</Select>
</Box>
}
Expand Down
3 changes: 2 additions & 1 deletion client/src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
"flag": "CN",
"name": "中文"
}
]
],
"useFlags": false
}

0 comments on commit 8cf358e

Please sign in to comment.