OSDN Git Service

add the transaltion for generatedTX page
authorZhiting Lin <zlin035@uottawa.ca>
Mon, 25 Feb 2019 06:40:01 +0000 (14:40 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Mon, 25 Feb 2019 06:40:01 +0000 (14:40 +0800)
src/features/transactions/components/GeneratedTxHex/GeneratedTxHex.jsx
src/locales/en/translation.json
src/locales/zh/translation.json

index b53a020..d934a44 100644 (file)
@@ -3,24 +3,26 @@ import { connect } from 'react-redux'
 import { NotFound, PageContent, PageTitle } from 'features/shared/components'
 import styles from './GeneratedTxHex.scss'
 import { copyToClipboard } from 'utility/clipboard'
+import {withNamespaces} from 'react-i18next'
 
 class Generated extends React.Component {
   render() {
-    if (!this.props.hex) return <NotFound />
+    const t = this.props.t
 
+    if (!this.props.hex) return <NotFound />
     return (
       <div>
-        <PageTitle title='Generated Transaction' />
+        <PageTitle title={t('transaction.advance.generated.title')} />
 
         <PageContent>
           <div className={styles.main}>
-            <p>Use the following JSON string as the transaction to sign by another account:</p>
+            <p>{t('transaction.advance.generated.lead')}</p>
 
             <button
               className='btn btn-primary'
               onClick={() => copyToClipboard(this.props.hex)}
             >
-              Copy to clipboard
+              {t('account.copyClipboard')}
             </button>
 
             <pre className={styles.hex}>{this.props.hex}</pre>
@@ -39,4 +41,4 @@ export default connect(
     if (found) return {hex: found.hex}
     return {}
   }
-)(Generated)
+)(withNamespaces('translations') ( Generated) )
index 7d082b1..c26f729 100644 (file)
       "showDetails":"Show transaction details",
       "transactionContent":"Transaction Content",
       "normalView":"Normal View",
-      "jsonView":"Json View"
+      "jsonView":"Json View",
+      "generated":{
+        "title":"Generated Transaction",
+        "lead":"Use the following JSON string as the transaction to sign by another account:"
+      }
     }
   },
   "balances":{
index b9bc1fb..fead1bd 100644 (file)
       "showDetails":"展示交易内容",
       "transactionContent":"交易内容",
       "normalView":"普通展示",
-      "jsonView":"Json格式"
+      "jsonView":"Json格式",
+      "generated":{
+        "title":"生成的交易",
+        "lead":"请将下面的JSON交易发送给其他账户进行签名:"
+      }
     }
   },
   "balances":{