feat: replace flags by text

This commit is contained in:
2026-06-12 14:14:29 +04:00
parent 17ef7f5534
commit ad496f50b0
+15 -32
View File
@@ -77,6 +77,8 @@ const Root = styled('div')((
}, },
})) }))
const LANG_NAMES = {fr: 'Français', en: 'English', es: 'Español', de: 'Deutsch', it: 'Italiano'}
const langToArray = parole => { const langToArray = parole => {
const langArray = [] const langArray = []
@@ -84,23 +86,23 @@ const langToArray = parole => {
const {francais, anglais, espagnol, allemand, italien} = parole.traductions const {francais, anglais, espagnol, allemand, italien} = parole.traductions
if (anglais) { if (anglais) {
langArray.push({title: 'Translation', flag: 'en', lang: anglais}) langArray.push({title: 'English', lang: anglais})
} }
if (francais) { if (francais) {
langArray.push({title: 'Traduction', flag: 'fr', lang: francais}) langArray.push({title: 'Français', lang: francais})
} }
if (espagnol) { if (espagnol) {
langArray.push({title: 'Traducción', flag: 'es', lang: espagnol}) langArray.push({title: 'Español', lang: espagnol})
} }
if (allemand) { if (allemand) {
langArray.push({title: 'Übersetzung', flag: 'de', lang: allemand}) langArray.push({title: 'Deutsch', lang: allemand})
} }
if (italien) { if (italien) {
langArray.push({title: 'Traduzione', flag: 'it', lang: italien}) langArray.push({title: 'Italiano', lang: italien})
} }
} }
@@ -198,7 +200,7 @@ export default function Teks({parole}) {
)} )}
{parole.creativeCommons && ( {parole.creativeCommons && (
<Box sx={{maxWidth: 220, margin: '0 auto', textAlign: 'center'}}> <Box sx={{maxWidth: 220, margin: '0 auto', textAlign: 'center'}}>
<LicenseModal license={parole.creativeCommons.toLowerCase()} /> <LicenseModal license={parole.creativeCommons.toLowerCase()} sourceOriginale={parole.sourceOriginale ?? null} remixes={parole.remixes?.length ? parole.remixes : null} />
</Box> </Box>
)} )}
{parole?.files && ( {parole?.files && (
@@ -221,41 +223,22 @@ export default function Teks({parole}) {
<Box className={classes.gridText}> <Box className={classes.gridText}>
<Typography align='center' sx={{marginBottom: '0.5em'}} variant='h4'> <Typography align='center' sx={{marginBottom: '0.5em'}} variant='h4'>
Transcription Transcription
{parole.langueSource && parole.langueSource !== 'ka' && (
<Typography component='span' variant='body2' color='text.secondary' sx={{ml: 1}}>
({LANG_NAMES[parole.langueSource]})
</Typography>
)}
</Typography> </Typography>
<Typography paragraph='true' align={alignTeks(langArray, isMobile)} component='span'> <Typography paragraph='true' align={alignTeks(langArray, isMobile)} component='span'>
{formatJsonString(parole.transcription)} {formatJsonString(parole.transcription)}
</Typography> </Typography>
</Box> </Box>
</Grid> </Grid>
{langArray.map(({title, flag, lang}) => ( {langArray.map(({title, lang}) => (
<Grid key={title} size={{xs: 12, md: 6}}> <Grid key={title} size={{xs: 12, md: 6}}>
<Box className={classes.gridText}> <Box className={classes.gridText}>
<Typography align='center' sx={{marginBottom: '0.5em'}} variant='h4'> <Typography align='center' sx={{marginBottom: '0.5em'}} variant='h4'>
{flag === 'fr' && ( {title}
<span>
🇫🇷
</span>
)}
{flag === 'en' && (
<span>
🇺🇸
</span>
)}
{flag === 'es' && (
<span>
🇪🇸
</span>
)}
{flag === 'de' && (
<span>
🇩🇪
</span>
)}
{flag === 'it' && (
<span>
🇮🇹
</span>
)} {title}
</Typography> </Typography>
<Typography paragraph='true' align='justify' component='span'> <Typography paragraph='true' align='justify' component='span'>
{formatJsonString(lang)} {formatJsonString(lang)}