class ItemList extends React.Component {
render() {
const label = this.props.label || pluralize(humanize(this.props.type))
- const objectName = label.slice(0,-1)
const actions = [...(this.props.actions || [])]
const lang = this.props.lang
'unspent outputs': 'UTXO',
Keys: lang === 'zh' ? '密钥' : 'Keys'
}
+ const objectNameZh = {
+ transactions: '交易' ,
+ accounts: '账户',
+ assets: '资产',
+ balances: '余额' ,
+ 'unspent outputs': '未完成输出',
+ Keys: '密钥'
+ }
+ const objectName = lang === 'zh' ? objectNameZh[label] :label.slice(0,-1)
const title = labelTitleMap[label] || capitalize(label)
const newButton = <button key='showCreate' className='btn btn-primary' onClick={this.props.showCreate}>
newButton={newButton}
showFirstTimeFlow={this.props.showFirstTimeFlow}
skipCreate={this.props.skipCreate}
- loadedOnce={this.props.loadedOnce} />
+ loadedOnce={this.props.loadedOnce}
+ lang={lang} />
</div>
)
let emptyBlock
if (!this.props.loadedOnce) {
- emptyBlock = <span>LOADING…</span>
+ emptyBlock = <span>{lang === 'zh' ? '加载中': 'LOADING'}…</span>
} else if (this.props.showFirstTimeFlow) {
emptyBlock = <div>
<span className={`${styles.emptyLabel} ${styles.noResultsLabel}`}>
- There are no {this.props.objectName}s
+ {lang === 'zh' ? `没有${this.props.objectName}记录`: `There are no ${this.props.objectName}s`}
</span>
</div>
}