use t prop from withTranslation
This commit is contained in:
parent
520f07ec23
commit
a11fae01dc
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { Link, withRouter } from 'react-router-dom';
|
||||
import { Dropdown } from 'react-viewerbase';
|
||||
import { withTranslation } from 'react-i18next';
|
||||
import i18n, { t } from 'ohif-i18n';
|
||||
import i18n from 'ohif-i18n';
|
||||
import './Header.css';
|
||||
import OHIFLogo from '../OHIFLogo/OHIFLogo.js';
|
||||
import ConnectedUserPreferencesModal from '../../connectedComponents/ConnectedUserPreferencesModal.js';
|
||||
@ -13,7 +13,8 @@ class Header extends Component {
|
||||
home: PropTypes.bool.isRequired,
|
||||
location: PropTypes.object.isRequired,
|
||||
openUserPreferencesModal: PropTypes.func,
|
||||
children: PropTypes.node
|
||||
children: PropTypes.node,
|
||||
t: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
@ -32,6 +33,7 @@ class Header extends Component {
|
||||
}
|
||||
|
||||
loadOptions() {
|
||||
const { t } = this.props;
|
||||
this.options = [
|
||||
{
|
||||
title: t('preferences'),
|
||||
@ -49,12 +51,13 @@ class Header extends Component {
|
||||
changeLanguage(language) {
|
||||
i18n.init({
|
||||
fallbackLng: language.substring(0, 2),
|
||||
lng: language
|
||||
lng: language,
|
||||
});
|
||||
this.loadOptions();
|
||||
}
|
||||
|
||||
render() {
|
||||
const { t } = this.props;
|
||||
return (
|
||||
<div className={`entry-header ${this.props.home ? 'header-big' : ''}`}>
|
||||
<div className="header-left-box">
|
||||
@ -108,11 +111,7 @@ class Header extends Component {
|
||||
>
|
||||
ES-MX
|
||||
</button>
|
||||
<Dropdown
|
||||
title={t('options')}
|
||||
list={this.options}
|
||||
align="right"
|
||||
/>
|
||||
<Dropdown title={t('options')} list={this.options} align="right" />
|
||||
<ConnectedUserPreferencesModal />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user