add missing language selector component
This commit is contained in:
parent
2054df1103
commit
1e8b5456c7
19
frontend/search/components/user/LanguageSelection.tsx
Normal file
19
frontend/search/components/user/LanguageSelection.tsx
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
import i18next from 'i18next'
|
||||||
|
import '../../i18n/config'
|
||||||
|
|
||||||
|
|
||||||
|
export default () => {
|
||||||
|
const languages = [{id: 'de', name: 'Deutsch'}, {id: 'en', name: 'Englisch'}]
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{ languages.map( lang => (
|
||||||
|
<span key={lang.id}>
|
||||||
|
<button title={lang.name}
|
||||||
|
onClick={() => i18next.changeLanguage(lang.id)}
|
||||||
|
>{lang.name}</button>
|
||||||
|
</span>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user