npm install --save react-translate-connector
import React, { Component } from 'react'
import connectProvider from 'react-translate-connector';
class Header extends React.Component {
render(){
return(
<div>
<button onClick={() => this.props.changeLang('en')}>EN</button>
<button onClick={() => this.props.changeLang('es')}>ES</button>
</div>
)
}
}
export default connectProvider(Header);
Name | Type | Param | Description |
---|---|---|---|
changeLang | Function | Language key | Change the current language |
language | Object | void | Object that contains the language keys |
MIT © eugeni9872