OSDN Git Service

Add convert all the hard-code to i18n
[bytom/bytom-electron.git] / src / features / mockhsm / components / ListItem.jsx
index 031fc77..867b7b4 100644 (file)
@@ -1,5 +1,6 @@
 import React from 'react'
 import { Link } from 'react-router'
+import {withNamespaces} from 'react-i18next'
 
 class ListItem extends React.Component {
   constructor(props) {
@@ -7,19 +8,18 @@ class ListItem extends React.Component {
   }
 
   render() {
-    const item = this.props.item
-    const lang = this.props.lang
+    const {item, t} = this.props
 
     return(
       <tr>
         <td>{item.alias}</td>
         <td><code>{item.xpub}</code></td>
         <td><Link to={`/keys/${item.id}`}>
-          {lang === 'zh' ? '更多' : 'More'}
+          {t('form.more')}
         </Link></td>
       </tr>
     )
   }
 }
 
-export default ListItem
+export default withNamespaces('translations') (ListItem)