Internationalize StatusBadge and fix a missed spot in Sidebar

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
Mcat12
2018-06-02 13:36:51 -04:00
parent 165e922e37
commit d9133cdfc4
2 changed files with 12 additions and 5 deletions
+3 -1
View File
@@ -91,7 +91,9 @@ const navItem = (item, key, props) => (
const navDropdown = (item, key, props) => (
<li key={key} className={activeRoute(item.url, props)}>
<a className="nav-link nav-dropdown-toggle" style={{ "cursor": "pointer" }} onClick={handleClick}><i className={item.icon}/>{item.name}</a>
<a className="nav-link nav-dropdown-toggle" style={{ "cursor": "pointer" }} onClick={handleClick}>
<i className={item.icon}/>{props.t(item.name)}
</a>
<ul className="nav-dropdown-items">
{navList(item.children, props)}
</ul>
+9 -4
View File
@@ -1,7 +1,8 @@
import React, { Component } from 'react';
import { translate } from 'react-i18next';
import { api, makeCancelable, ignoreCancel } from '../utils';
export default class StatusBadge extends Component {
class StatusBadge extends Component {
state = {
status: "enabled"
};
@@ -23,12 +24,16 @@ export default class StatusBadge extends Component {
}
render() {
const { t } = this.props;
return (
this.state.status === "enabled"
?
<span><i className="fa fa-circle text-success"/> Enabled</span>
<span><i className="fa fa-circle text-success"/>&nbsp;{t("Enabled")}</span>
:
<span><i className="fa fa-circle text-danger"/> Disabled</span>
<span><i className="fa fa-circle text-danger"/>&nbsp;{t("Disabled")}</span>
);
}
}
}
export default translate("common")(StatusBadge);