Client - change language on dropdown change
This commit is contained in:
parent
44d0c36485
commit
97934f8ffe
@ -1,4 +1,5 @@
|
|||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
|
import i18next from 'i18next'
|
||||||
|
|
||||||
import { ReactComponent as EnFlag } from '../../images/flags/en.svg'
|
import { ReactComponent as EnFlag } from '../../images/flags/en.svg'
|
||||||
import { ReactComponent as FrFlag } from '../../images/flags/fr.svg'
|
import { ReactComponent as FrFlag } from '../../images/flags/fr.svg'
|
||||||
@ -26,9 +27,12 @@ class Dropdown extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
selectLanguage(name) {
|
selectLanguage(name) {
|
||||||
this.setState({
|
if (name !== this.state.selected) {
|
||||||
selected: name,
|
i18next.changeLanguage(name)
|
||||||
})
|
this.setState({
|
||||||
|
selected: name,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleDropdown() {
|
toggleDropdown() {
|
||||||
|
Loading…
Reference in New Issue
Block a user