OSDN Git Service

Add the translation to Access Control
authorZhiting Lin <zlin035@uottawa.ca>
Fri, 2 Mar 2018 06:41:19 +0000 (14:41 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Fri, 2 Mar 2018 06:41:19 +0000 (14:41 +0800)
src/features/accessControl/components/AccessControlList.jsx
src/features/accessControl/routes.js
src/features/app/components/SecondaryNavigation/SecondaryNavigation.jsx

index ca21e9e..a246a3d 100644 (file)
@@ -22,7 +22,7 @@ class AccessControlList extends React.Component {
     // </TableList>
 
     return (<div>
-      <PageTitle title='Access control' />
+      <PageTitle title={ lang==='zh'? '访问控制' : 'Access control'} />
 
       <PageContent>
         <div className={`btn-group ${styles.btnGroup}`} role='group'>
index 0639d2e..5bd40fe 100644 (file)
@@ -21,7 +21,8 @@ export default (store) => {
 
   const routes = makeRoutes(store, 'accessControl', AccessControlList, null, null, null, {
     path: 'access-control',
-    name: 'Access control'
+    name: 'Access control',
+    name_zh: '访问控制'
   })
 
   routes.indexRoute.onEnter = (nextState, replace) => {
index 6f87c0c..b9f2963 100644 (file)
@@ -18,6 +18,7 @@ class SecondaryNavigation extends React.Component {
   }
 
   render() {
+    const lang = this.props.lang
     return (
       <div className={styles.main}>
         <ul className={styles.navigation}>
@@ -35,7 +36,7 @@ class SecondaryNavigation extends React.Component {
             <li>
               <Link to='/access-control' activeClassName={styles.active}>
                 {navIcon('network', styles)}
-                Access Control
+                { lang === 'zh' ?  '访问控制' : 'Access Control'}
               </Link>
             </li>
           }
@@ -43,7 +44,7 @@ class SecondaryNavigation extends React.Component {
           {this.props.canLogOut && <li className={styles.logOut}>
             <a href='#' onClick={this.logOut}>
               {navIcon('logout', styles)}
-              Log Out
+              { lang === 'zh' ?  '退出' : 'Log Out' }
             </a>
           </li>}
         </ul>
@@ -55,7 +56,8 @@ class SecondaryNavigation extends React.Component {
 export default connect(
   (state) => ({
     canLogOut: !!state.core.clientToken,
-    canViewTokens: !state.core.clientToken
+    canViewTokens: !state.core.clientToken,
+    lang: state.core.lang
   }),
   (dispatch) => ({
     logOut: () => dispatch(actions.core.clearSession)