let $i18n = {
en: {
'注册': 'Register',
'交易': 'Exchange',
'回款': 'Rewards',
'平台': 'App',
'网址': 'Link'
}
}
let $tt = function (value) {
let translation;
try {
translation = $i18n[locale][value];
} finally {
return translation || value;
}
}
this.state = {
locale: 'en',
localeName: '英文'
}
<img src={`/img/banner_01_${locale}.png`} />
<div>{$tt(`注册`)}</div>
网友评论