Skip to content

Commit

Permalink
add language#275
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhvk committed Jul 1, 2020
1 parent 99f72c5 commit c10d059
Show file tree
Hide file tree
Showing 9 changed files with 438 additions and 300 deletions.
32 changes: 21 additions & 11 deletions src/app/DepositPage/DepositPageRenderer.jsx
Expand Up @@ -23,33 +23,33 @@ export default function DepositRenderer({
}) {
const columns = [
{
title: 'Coin',
title: <FormattedMessage id="portfolioPage.depositWithdraw.table.coin" />,
field: 'coin',
width: '8%',
},
{
title: 'Status',
title: <FormattedMessage id="portfolioPage.depositWithdraw.table.status" />,
field: 'status',
width: '12%',
},
{
title: 'Amount',
title: <FormattedMessage id="portfolioPage.depositWithdraw.table.amount" />,
field: 'amount',
width: '15%',
},
{
title: 'Date',
title: <FormattedMessage id="portfolioPage.depositWithdraw.table.date" />,
field: 'date',
parents: null,
width: '15%',
},
{
title: 'TxHash',
title: <FormattedMessage id="portfolioPage.depositWithdraw.table.txHash" />,
field: 'txHash',
width: '25%',
},
{
title: 'Deposit Address',
title: <FormattedMessage id="portfolioPage.depositWithdraw.table.depositAddress" />,
field: 'depositAddress',
width: '25%',
},
Expand Down Expand Up @@ -86,7 +86,7 @@ export default function DepositRenderer({
</BalanceRow>

<TradeBox>
<TradeTitle>Go to trade:</TradeTitle>
<TradeTitle><FormattedMessage id="portfolioPage.deposit.goToTrade" />:</TradeTitle>
<div>
{
token.pairs.map((pair, index) => <PairLink key={index} onClick={() => updateCurrentPair(pair)}>{pair}</PairLink>)
Expand All @@ -95,7 +95,12 @@ export default function DepositRenderer({
</TradeBox>
</Cell>
<Cell>
<AddressRow>Send { token.symbol } to the address below</AddressRow>
<AddressRow>
<FormattedMessage
id="portfolioPage.deposit.sendToAddress"
values={{ symbol: token.symbol }}
/>
</AddressRow>
<AddressBox>
<AddressRow>{token.depositAddress && <QRCode value={token.depositAddress} size={150} includeMargin={true} />}</AddressRow>
<AddressRow><Address>{token.depositAddress}</Address></AddressRow>
Expand All @@ -104,14 +109,19 @@ export default function DepositRenderer({
</CopyToClipboard>
</AddressBox>
<NoteBox intent="danger" title="Note">
<NoteItem>Minimum deposit is <strong style={{fontFamily: 'Ubuntu'}}>{token.minimumWithdrawal && token.minimumWithdrawal}</strong> { token.symbol }</NoteItem>
<NoteItem>You might not receive TRC Token if you deposit below minimum deposit amount of { token.symbol }</NoteItem>
<NoteItem><FormattedMessage id="portfolioPage.deposit.warning1" /> <strong style={{fontFamily: 'Ubuntu'}}>{token.minimumWithdrawal && token.minimumWithdrawal}</strong> { token.symbol }</NoteItem>
<NoteItem>
<FormattedMessage
id="portfolioPage.deposit.warning2"
values={{ symbol: token.symbol }}
/>
</NoteItem>
</NoteBox>
</Cell>
</Grid>

<DepositHistory>
<SubTitle>Recent deposit history</SubTitle>
<SubTitle><FormattedMessage id="portfolioPage.deposit.recentDeposit" /></SubTitle>
<DataTableHistory columns={columns} data={depositHistory} />
</DepositHistory>
</Container>
Expand Down
33 changes: 18 additions & 15 deletions src/app/WithdrawPage/WithdrawPageRenderer.jsx
Expand Up @@ -27,33 +27,33 @@ export default function WithdrawPageRenderer({
}) {
const columns = [
{
title: 'Coin',
title: <FormattedMessage id="portfolioPage.depositWithdraw.table.coin" />,
field: 'coin',
width: '8%',
},
{
title: 'Status',
title: <FormattedMessage id="portfolioPage.depositWithdraw.table.status" />,
field: 'status',
width: '12%',
},
{
title: 'Amount',
title: <FormattedMessage id="portfolioPage.depositWithdraw.table.amount" />,
field: 'amount',
width: '15%',
},
{
title: 'Date',
title: <FormattedMessage id="portfolioPage.depositWithdraw.table.date" />,
field: 'date',
parents: null,
width: '15%',
},
{
title: 'TxHash',
title: <FormattedMessage id="portfolioPage.depositWithdraw.table.txHash" />,
field: 'txHash',
width: '25%',
},
{
title: 'Withdraw Address',
title: <FormattedMessage id="portfolioPage.depositWithdraw.table.withdrawalAddress" />,
field: 'withdrawalAddress',
width: '25%',
},
Expand Down Expand Up @@ -90,14 +90,17 @@ export default function WithdrawPageRenderer({
</BalanceRow>

<NoteBox intent="danger">
<NoteItem>Do not withdraw directly to a crowdfund or ICO address, as your account will not be credited with tokens from such sales.</NoteItem>
<NoteItem>Coins will be withdrawing after 30 network confirmations</NoteItem>
<NoteItem><FormattedMessage id="portfolioPage.withdraw.warning1" /></NoteItem>
<NoteItem><FormattedMessage id="portfolioPage.withdraw.warning2" /></NoteItem>
</NoteBox>
</Cell>
<Cell>
<InputBox>
<InputLabel>
Recipient's {token.symbol} address
<FormattedMessage
id="portfolioPage.withdraw.recipientAddress"
values={{symbol: token.symbol}}
/>
</InputLabel>

<InputGroupWrapper
Expand All @@ -110,7 +113,7 @@ export default function WithdrawPageRenderer({

<InputBox>
<InputLabel>
Amount
<FormattedMessage id="portfolioPage.withdraw.amount" />
</InputLabel>

<InputGroupWrapper
Expand All @@ -122,11 +125,11 @@ export default function WithdrawPageRenderer({
/>
</InputBox>
<WithdrawInfo>
<SmallText>Minimum withdraw: <BalanceValue>{token.minimumWithdrawal}</BalanceValue> {token.symbol}</SmallText>
<SmallText>Available amount: <BalanceValue>{BigNumber(token.availableBalance).toFormat(pricePrecision)}</BalanceValue> {token.symbol}</SmallText>
<SmallText><FormattedMessage id="portfolioPage.withdraw.minimumWithdrawal" />: <BalanceValue>{token.minimumWithdrawal}</BalanceValue> {token.symbol}</SmallText>
<SmallText><FormattedMessage id="portfolioPage.availableAmount" />: <BalanceValue>{BigNumber(token.availableBalance).toFormat(pricePrecision)}</BalanceValue> {token.symbol}</SmallText>
</WithdrawInfo>
<TextRow><SmallText>Withdraw fee: <BalanceValue>{token.withdrawFee}</BalanceValue> {token.symbol}</SmallText></TextRow>
<TextRow><SmallText>You will get: <AmountWithoutFee>{withdrawalAmountWithoutFee}</AmountWithoutFee> {token.symbol}</SmallText></TextRow>
<TextRow><SmallText><FormattedMessage id="portfolioPage.withdraw.withdrawalFee" />: <BalanceValue>{token.withdrawFee}</BalanceValue> {token.symbol}</SmallText></TextRow>
<TextRow><SmallText><FormattedMessage id="portfolioPage.withdraw.youWillGet" />: <AmountWithoutFee>{withdrawalAmountWithoutFee}</AmountWithoutFee> {token.symbol}</SmallText></TextRow>

<ButtonWrapper
text="Withdraw"
Expand All @@ -141,7 +144,7 @@ export default function WithdrawPageRenderer({
</Grid>

<History>
<SubTitle>Recent withdrawal history</SubTitle>
<SubTitle><FormattedMessage id="portfolioPage.withdraw.recentWithdrawal" /></SubTitle>
<DataTableHistory columns={columns} data={withdrawHistory} />
</History>
</Container>
Expand Down
6 changes: 3 additions & 3 deletions src/components/DataTableHistory/DataTableHistory.jsx
Expand Up @@ -6,8 +6,8 @@ import { formatDate, truncateTripleText } from '../../utils/helpers'
import { TmColors } from '../../components/Common'

const STATUS = {
PROCESSING: <FormattedMessage id="portfolioPage.deposit.status.processing" />,
COMPLETED: <FormattedMessage id="portfolioPage.deposit.status.completed" />,
PROCESSING: <FormattedMessage id="portfolioPage.depositWithdraw.status.processing" />,
COMPLETED: <FormattedMessage id="portfolioPage.depositWithdraw.status.completed" />,
}

function renderHeader(columns, widths) {
Expand Down Expand Up @@ -42,7 +42,7 @@ function renderCell(item, field) {
}

function renderBody(columns, data, widths) {
if (data.length === 0) return (<NoData>No data</NoData>)
if (data.length === 0) return (<NoData><FormattedMessage id="exchangePage.noData" /></NoData>)

return (
data.map((item, index) => {
Expand Down
24 changes: 22 additions & 2 deletions src/locales/langs/en.json
Expand Up @@ -243,9 +243,29 @@
"portfolioPage.transferTokensModal.transactionFailed": "Transaction Failed",
"portfolioPage.transferTokensModal.transactionValid": "Transaction Valid",
"portfolioPage.deposit.copy": "Copy",
"portfolioPage.deposit.status.processing": "Processing",
"portfolioPage.deposit.status.completed": "Completed",
"portfolioPage.depositWithdraw.status.processing": "Processing",
"portfolioPage.depositWithdraw.status.completed": "Completed",
"portfolioPage.depositWithdraw.table.coin": "Coin",
"portfolioPage.depositWithdraw.table.status": "Status",
"portfolioPage.depositWithdraw.table.amount": "Amount",
"portfolioPage.depositWithdraw.table.date": "Date",
"portfolioPage.depositWithdraw.table.txHash": "TxHash",
"portfolioPage.depositWithdraw.table.withdrawalAddress": "Withdrawal Address",
"portfolioPage.depositWithdraw.table.depositAddress": "Deposit Address",
"portfolioPage.withdraw": "Withdraw",
"portfolioPage.withdraw.warning1": "Do not withdraw directly to a crowdfund or ICO address, as your account will not be credited with tokens from such sales.",
"portfolioPage.withdraw.warning2": "Coins will be withdrawing after 30 network confirmations",
"portfolioPage.withdraw.recipientAddress": "Recipient's {symbol} address",
"portfolioPage.withdraw.amount": "Amount",
"portfolioPage.withdraw.minimumWithdrawal": "Minimum withdrawal",
"portfolioPage.withdraw.withdrawalFee": "Withdrawal fee",
"portfolioPage.withdraw.youWillGet": "You will get",
"portfolioPage.withdraw.recentWithdrawal": "Recent withdrawal history",
"portfolioPage.deposit.goToTrade": "Go to trade",
"portfolioPage.deposit.sendToAddress": "Send { symbol } to the address below",
"portfolioPage.deposit.warning1": "Minimum deposit is",
"portfolioPage.deposit.warning2": "You might not receive TRC Token if you deposit below minimum deposit amount of { symbol }",
"portfolioPage.deposit.recentDeposit": "Recent deposit history",
"dapp.orders": "Orders",
"dapp.instruction": "Please use a dapp browser for this action.",
"dapp.or": "or",
Expand Down
27 changes: 24 additions & 3 deletions src/locales/langs/fr.json
Expand Up @@ -243,8 +243,29 @@
"portfolioPage.transferTokensModal.transactionFailed": "Transaction Failed",
"portfolioPage.transferTokensModal.transactionValid": "Transaction Valid",
"portfolioPage.deposit.copy": "Copy",
"portfolioPage.deposit.status.processing": "Processing",
"portfolioPage.deposit.status.completed": "Completed",
"portfolioPage.depositWithdraw.status.processing": "Processing",
"portfolioPage.depositWithdraw.status.completed": "Completed",
"portfolioPage.depositWithdraw.table.coin": "Coin",
"portfolioPage.depositWithdraw.table.status": "Status",
"portfolioPage.depositWithdraw.table.amount": "Amount",
"portfolioPage.depositWithdraw.table.date": "Date",
"portfolioPage.depositWithdraw.table.txHash": "TxHash",
"portfolioPage.depositWithdraw.table.withdrawalAddress": "Withdrawal Address",
"portfolioPage.depositWithdraw.table.depositAddress": "Deposit Address",
"portfolioPage.withdraw": "Withdraw",
"portfolioPage.withdraw.warning1": "Do not withdraw directly to a crowdfund or ICO address, as your account will not be credited with tokens from such sales.",
"portfolioPage.withdraw.warning2": "Coins will be withdrawing after 30 network confirmations",
"portfolioPage.withdraw.recipientAddress": "Recipient's {symbol} address",
"portfolioPage.withdraw.amount": "Amount",
"portfolioPage.withdraw.minimumWithdrawal": "Minimum withdrawal",
"portfolioPage.withdraw.withdrawalFee": "Withdrawal fee",
"portfolioPage.withdraw.youWillGet": "You will get",
"portfolioPage.withdraw.recentWithdrawal": "Recent withdrawal history",
"portfolioPage.deposit.goToTrade": "Go to trade",
"portfolioPage.deposit.sendToAddress": "Send { symbol } to the address below",
"portfolioPage.deposit.warning1": "Minimum deposit is",
"portfolioPage.deposit.warning2": "You might not receive TRC Token if you deposit below minimum deposit amount of { symbol }",
"portfolioPage.deposit.recentDeposit": "Recent deposit history",
"dapp.orders": "Ordres",
"dapp.instruction": "Please use a dapp browser for this action.",
"dapp.or": "ou",
Expand All @@ -256,5 +277,5 @@
"dapp.switchToSpot": "Switch to Spot",
"dapp.switchToLending": "Switch to Lending",
"dapp.marketContracts": "Market contracts",
"dapp.contracts": "Kontratlar"
"dapp.contracts": "Contracts"
}

0 comments on commit c10d059

Please sign in to comment.