Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d66c679fd1
|
||
|
|
cab293d62e |
@@ -135,14 +135,6 @@ const langToArray = parole => {
|
||||
.map(({field, title, continent, vedette}) => ({field, title, continent, vedette, lang: parole.traductions[field]}))
|
||||
}
|
||||
|
||||
const BROWSER_LANG_TO_FIELD = {
|
||||
yo: 'yoruba', ln: 'lingala', wo: 'wolof', sw: 'swahili', ha: 'hausa',
|
||||
ar: 'arabe', om: 'oromo', ig: 'igbo', zu: 'zoulou', mg: 'malgache',
|
||||
xh: 'xhosa', tn: 'tswana', ts: 'tsonga', st: 'sesotho',
|
||||
ja: 'japonais', ko: 'coreen', en: 'anglais', fr: 'francais',
|
||||
es: 'espagnol', de: 'allemand', it: 'italien', pt: 'portugais',
|
||||
}
|
||||
|
||||
const ExplicitTooltip = Tooltip
|
||||
|
||||
export default function Teks({parole}) {
|
||||
@@ -167,20 +159,6 @@ export default function Teks({parole}) {
|
||||
return () => setCurrentTrack(null)
|
||||
}, [parole, setCurrentTrack])
|
||||
|
||||
useEffect(() => {
|
||||
const browserLang = navigator.language?.split('-')[0]?.toLowerCase()
|
||||
if (!browserLang || browserLang === parole.langueSource) {
|
||||
return
|
||||
}
|
||||
|
||||
const champ = BROWSER_LANG_TO_FIELD[browserLang]
|
||||
const index = langArray.findIndex(lang => lang.field === champ)
|
||||
if (index !== -1) {
|
||||
setTab(index + 1)
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps -- ne doit s'exécuter qu'au montage, pas à chaque changement d'onglet
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<Root className={classes.container}>
|
||||
<Box sx={{textAlign: 'center', marginTop: 12}}>
|
||||
|
||||
Reference in New Issue
Block a user