this.setState({ showExpand: true })}
@@ -137,7 +139,9 @@ class StorageBarCompoment extends Component {
- 存储空间{" "}
+
+ {t("navbar.storage")}
+
{
return {
@@ -91,7 +92,7 @@ class UserAvatarCompoment extends Component {
};
render() {
- const { classes } = this.props;
+ const { classes, t } = this.props;
const loginCheck = Auth.Check(this.props.isLogin);
const user = Auth.GetUser(this.props.isLogin);
const isAdminPage = pathHelper.isAdminPage(
@@ -113,7 +114,7 @@ class UserAvatarCompoment extends Component {
{loginCheck && (
<>
)}
{isAdminPage && (
-
+
{
return {
@@ -105,7 +110,7 @@ class UserAvatarPopoverCompoment extends Component {
};
render() {
- const { classes } = this.props;
+ const { classes, t } = this.props;
const user = Auth.GetUser();
const isAdminPage = pathHelper.isAdminPage(
this.props.location.pathname
@@ -134,16 +139,18 @@ class UserAvatarPopoverCompoment extends Component {
- 登录
+ {t("login.signIn")}
{this.props.registerEnabled && (
)}
@@ -198,7 +205,7 @@ class UserAvatarPopoverCompoment extends Component {
- 个人主页
+ {t("navbar.myProfile")}
)}
{user.group.id === 1 && (
@@ -214,7 +221,7 @@ class UserAvatarPopoverCompoment extends Component {
- 管理面板
+ {t("navbar.dashboard")}
)}
@@ -227,7 +234,7 @@ class UserAvatarPopoverCompoment extends Component {
- 退出登录
+ {t("login.logout")}
@@ -244,6 +251,10 @@ UserAvatarPopoverCompoment.propTypes = {
const UserAvatarPopover = connect(
mapStateToProps,
mapDispatchToProps
-)(withStyles(styles)(withRouter(UserAvatarPopoverCompoment)));
+)(
+ withStyles(styles)(
+ withRouter(withTranslation()(UserAvatarPopoverCompoment))
+ )
+);
export default UserAvatarPopover;
diff --git a/src/component/Navbar/UserInfo.js b/src/component/Navbar/UserInfo.js
index c142b0e..2daeffb 100644
--- a/src/component/Navbar/UserInfo.js
+++ b/src/component/Navbar/UserInfo.js
@@ -6,6 +6,7 @@ import Auth from "../../middleware/Auth";
import DarkModeSwitcher from "./DarkModeSwitcher";
import Avatar from "@material-ui/core/Avatar";
import { setUserPopover } from "../../redux/explorer";
+import { withTranslation } from "react-i18next";
const mapStateToProps = (state) => {
return {
@@ -70,7 +71,6 @@ const styles = (theme) => ({
},
nickName: {
color: "#fff",
- marginLeft: "10px",
marginTop: "15px",
fontSize: "17px",
},
@@ -80,7 +80,6 @@ const styles = (theme) => ({
alignItems: "flex-start",
},
groupName: {
- marginLeft: "10px",
color: "#ffffff",
opacity: "0.54",
},
@@ -95,7 +94,7 @@ class UserInfoCompoment extends Component {
};
render() {
- const { classes } = this.props;
+ const { classes, t } = this.props;
const isLogin = Auth.Check(this.props.isLogin);
const user = Auth.GetUser(this.props.isLogin);
@@ -125,7 +124,7 @@ class UserInfoCompoment extends Component {
component="h2"
noWrap
>
- {isLogin ? user.nickname : "未登录"}
+ {isLogin ? user.nickname : t("navbar.notLoginIn")}
- {isLogin ? user.group.name : "游客"}
+ {isLogin ? user.group.name : t("navbar.visitor")}