Implement i18n 5/9 OrderPage

This commit is contained in:
Reckless_Satoshi 2022-04-04 12:18:07 -07:00
parent b95d21c8bc
commit 433f538508
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
4 changed files with 166 additions and 99 deletions

View File

@ -15,6 +15,7 @@ import NumbersIcon from '@mui/icons-material/Numbers';
import PriceChangeIcon from '@mui/icons-material/PriceChange';
import PaymentsIcon from '@mui/icons-material/Payments';
import ArticleIcon from '@mui/icons-material/Article';
import { t } from "i18next";
function getCookie(name) {
let cookieValue = null;
@ -127,9 +128,10 @@ class OrderPage extends Component {
// Countdown Renderer callback with condition
countdownRenderer = ({ total, hours, minutes, seconds, completed }) => {
const { t } = this.props;
if (completed) {
// Render a completed state
return (<span> The order has expired</span>);
return (<span> {t("The order has expired")}</span>);
} else {
var col = 'inherit'
@ -148,13 +150,14 @@ class OrderPage extends Component {
// Countdown Renderer callback with condition
countdownPenaltyRenderer = ({ minutes, seconds, completed }) => {
const { t } = this.props;
if (completed) {
// Render a completed state
return (<span> Penalty lifted, good to go!</span>);
return (<span> {t("Penalty lifted, good to go!")}</span>);
} else {
return (
<span> You cannot take an order yet! Wait {zeroPad(minutes)}m {zeroPad(seconds)}s </span>
<span> {t("You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s",{timeMin: zeroPad(minutes), timeSec: zeroPad(seconds) })} </span>
);
}
};
@ -168,27 +171,29 @@ class OrderPage extends Component {
}
amountHelperText=()=>{
const { t } = this.props;
if(this.state.takeAmount < this.state.min_amount & this.state.takeAmount != ""){
return "Too low"
return t("Too low")
}else if (this.state.takeAmount > this.state.max_amount & this.state.takeAmount != ""){
return "Too high"
return t("Too high")
}else{
return null
}
}
takeOrderButton = () => {
const { t } = this.props;
if(this.state.has_range){
return(
<Grid containter xs={12} align="center" alignItems="stretch" justifyContent="center" style={{ display: "flex"}}>
<this.InactiveMakerDialog/>
<div style={{maxWidth:120}}>
<Tooltip placement="top" enterTouchDelay="500" enterDelay="700" enterNextDelay="2000" title="Enter amount of fiat to exchange for bitcoin">
<Tooltip placement="top" enterTouchDelay="500" enterDelay="700" enterNextDelay="2000" title={t("Enter amount of fiat to exchange for bitcoin")}>
<Paper elevation={5} sx={{maxHeight:40}}>
<TextField
error={(this.state.takeAmount < this.state.min_amount || this.state.takeAmount > this.state.max_amount) & this.state.takeAmount != "" }
helperText={this.amountHelperText()}
label={"Amount "+this.state.currencyCode}
label={t("Amount {{currencyCode}}", {currencyCode: this.state.currencyCode})}
size="small"
type="number"
required="true"
@ -204,11 +209,11 @@ class OrderPage extends Component {
</Tooltip>
</div>
<div style={{height:38, top:'1px', position:'relative', display: (this.state.takeAmount < this.state.min_amount || this.state.takeAmount > this.state.max_amount || this.state.takeAmount == "" || this.state.takeAmount == null) ? '':'none'}}>
<Tooltip placement="top" enterTouchDelay="0" enterDelay="500" enterNextDelay="1200" title="You must specify an amount first">
<Tooltip placement="top" enterTouchDelay="0" enterDelay="500" enterNextDelay="1200" title={t("You must specify an amount first")}>
<Paper elevation={4}>
<Button sx={{height:38}} variant='contained' color='primary'
disabled={true}>
Take Order
{t("Take Order")}
</Button>
</Paper>
</Tooltip>
@ -217,7 +222,7 @@ class OrderPage extends Component {
<Paper elevation={4}>
<Button sx={{height:38}} variant='contained' color='primary'
onClick={this.state.maker_status=='Inactive' ? this.handleClickOpenInactiveMakerDialog : this.takeOrder}>
Take Order
{t("Take Order")}
</Button>
</Paper>
</div>
@ -229,7 +234,7 @@ class OrderPage extends Component {
<this.InactiveMakerDialog/>
<Button variant='contained' color='primary'
onClick={this.state.maker_status=='Inactive' ? this.handleClickOpenInactiveMakerDialog : this.takeOrder}>
Take Order
{t("Take Order")}
</Button>
</>
)
@ -243,8 +248,8 @@ class OrderPage extends Component {
return ( <this.takeOrderButton/>);
} else{
return(
<Tooltip enterTouchDelay="0" title="Wait until you can take an order"><div>
<Button disabled={true} variant='contained' color='primary'>Take Order</Button>
<Tooltip enterTouchDelay="0" title={t("Wait until you can take an order")}><div>
<Button disabled={true} variant='contained' color='primary'>{t("Take Order")}</Button>
</div></Tooltip>)
}
};
@ -320,6 +325,7 @@ class OrderPage extends Component {
};
CancelDialog =() =>{
const { t } = this.props;
return(
<Dialog
open={this.state.openCancel}
@ -328,16 +334,16 @@ class OrderPage extends Component {
aria-describedby="cancel-dialog-description"
>
<DialogTitle id="cancel-dialog-title">
{"Cancel the order?"}
{t("Cancel the order?")}
</DialogTitle>
<DialogContent>
<DialogContentText id="cancel-dialog-description">
If the order is cancelled now you will lose your bond.
{t("If the order is cancelled now you will lose your bond.")}
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={this.handleClickCloseConfirmCancelDialog} autoFocus>Go back</Button>
<Button onClick={this.handleClickConfirmCancelButton}> Confirm Cancel </Button>
<Button onClick={this.handleClickCloseConfirmCancelDialog} autoFocus>{t("Go back")}</Button>
<Button onClick={this.handleClickConfirmCancelButton}>{t("Confirm Cancel")}</Button>
</DialogActions>
</Dialog>
)
@ -351,6 +357,7 @@ class OrderPage extends Component {
};
InactiveMakerDialog =() =>{
const { t } = this.props;
return(
<Dialog
open={this.state.openInactiveMaker}
@ -359,17 +366,16 @@ class OrderPage extends Component {
aria-describedby="inactive-maker-description"
>
<DialogTitle id="inactive-maker-dialog-title">
{"The maker is away"}
{t("The maker is away")}
</DialogTitle>
<DialogContent>
<DialogContentText id="cancel-dialog-description">
By taking this order you risk wasting your time.
If the maker does not proceed in time, you will be compensated in satoshis for 50% of the maker bond.
{t("By taking this order you risk wasting your time. If the maker does not proceed in time, you will be compensated in satoshis for 50% of the maker bond.")}
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={this.handleClickCloseInactiveMakerDialog} autoFocus>Go back</Button>
<Button onClick={this.takeOrder}> Take Order </Button>
<Button onClick={this.handleClickCloseInactiveMakerDialog} autoFocus>{t("Go back")}</Button>
<Button onClick={this.takeOrder}>{t("Take Order")}</Button>
</DialogActions>
</Dialog>
)
@ -396,6 +402,7 @@ class OrderPage extends Component {
};
CollaborativeCancelDialog =() =>{
const { t } = this.props;
return(
<Dialog
open={this.state.openCollaborativeCancel}
@ -404,41 +411,41 @@ class OrderPage extends Component {
aria-describedby="collaborative-cancel-dialog-description"
>
<DialogTitle id="cancel-dialog-title">
{"Collaborative cancel the order?"}
{t("Collaborative cancel the order?")}
</DialogTitle>
<DialogContent>
<DialogContentText id="cancel-dialog-description">
The trade escrow has been posted. The order can be cancelled only if both, maker and
taker, agree to cancel.
{t("The trade escrow has been posted. The order can be cancelled only if both, maker and taker, agree to cancel.")}
</DialogContentText>
</DialogContent>
<DialogActions>
<Button onClick={this.handleClickCloseCollaborativeCancelDialog} autoFocus>Go back</Button>
<Button onClick={this.handleClickConfirmCollaborativeCancelButton}> Ask for Cancel </Button>
<Button onClick={this.handleClickCloseCollaborativeCancelDialog} autoFocus>{t("Go back")}</Button>
<Button onClick={this.handleClickConfirmCollaborativeCancelButton}>{t("Ask for Cancel")}</Button>
</DialogActions>
</Dialog>
)
}
BackButton = () => {
const { t } = this.props;
// If order has expired, show back button.
if (this.state.status == 5){
return(
<Grid item xs={12} align="center">
<Button variant='contained' color='secondary' onClick={this.props.history.goBack}>Back</Button>
<Button variant='contained' color='secondary' onClick={this.props.history.goBack}>{t("Back")}</Button>
</Grid>
)}
return(null)
}
CancelButton = () => {
const { t } = this.props;
// If maker and Waiting for Bond. Or if taker and Waiting for bond.
// Simply allow to cancel without showing the cancel dialog.
if ((this.state.is_maker & [0,1].includes(this.state.status)) || this.state.is_taker & this.state.status == 3){
return(
<Grid item xs={12} align="center">
<Button variant='contained' color='secondary' onClick={this.handleClickConfirmCancelButton}>Cancel</Button>
<Button variant='contained' color='secondary' onClick={this.handleClickConfirmCancelButton}>{t("Cancel")}</Button>
</Grid>
)}
// If the order does not yet have an escrow deposited. Show dialog
@ -448,7 +455,7 @@ class OrderPage extends Component {
<div id="openDialogCancelButton">
<Grid item xs={12} align="center">
<this.CancelDialog/>
<Button variant='contained' color='secondary' onClick={this.handleClickOpenConfirmCancelDialog}>Cancel</Button>
<Button variant='contained' color='secondary' onClick={this.handleClickOpenConfirmCancelDialog}>{t("Cancel")}</Button>
</Grid>
</div>
)}
@ -459,7 +466,7 @@ class OrderPage extends Component {
return(
<Grid item xs={12} align="center">
<this.CollaborativeCancelDialog/>
<Button variant='contained' color='secondary' onClick={this.handleClickOpenCollaborativeCancelDialog}>Collaborative Cancel</Button>
<Button variant='contained' color='secondary' onClick={this.handleClickOpenCollaborativeCancelDialog}>{t("Collaborative Cancel")}</Button>
</Grid>
)}
@ -475,19 +482,20 @@ class OrderPage extends Component {
}
orderBox=()=>{
const { t } = this.props;
return(
<Grid container spacing={1} >
<Grid item xs={12} align="center">
<MediaQuery minWidth={920}>
<Typography component="h5" variant="h5">
Order Box
{t("Order Box")}
</Typography>
</MediaQuery>
<Paper elevation={12} style={{ padding: 8,}}>
<List dense="true">
<ListItem >
<ListItemAvatar sx={{ width: 56, height: 56 }}>
<Tooltip placement="top" enterTouchDelay="0" title={this.state.maker_status} >
<Tooltip placement="top" enterTouchDelay="0" title={t(this.state.maker_status)} >
<Badge variant="dot" overlap="circular" badgeContent="" color={this.statusBadgeColor(this.state.maker_status)}>
<Avatar className="flippedSmallAvatar"
alt={this.state.maker_nick}
@ -496,7 +504,7 @@ class OrderPage extends Component {
</Badge>
</Tooltip>
</ListItemAvatar>
<ListItemText primary={this.state.maker_nick + (this.state.type ? " (Seller)" : " (Buyer)")} secondary="Order maker" align="right"/>
<ListItemText primary={this.state.maker_nick + (this.state.type ? " "+t("(Seller)") : " "+t("(Buyer)") )} secondary={t("Order maker")} align="right"/>
</ListItem>
{this.state.is_participant ?
@ -505,9 +513,9 @@ class OrderPage extends Component {
<>
<Divider />
<ListItem align="left">
<ListItemText primary={this.state.taker_nick + (this.state.type ? " (Buyer)" : " (Seller)")} secondary="Order taker"/>
<ListItemText primary={this.state.taker_nick + (this.state.type ? " "+t("(Buyer)") : " "+t("(Seller)"))} secondary={t("Order taker")}/>
<ListItemAvatar >
<Tooltip enterTouchDelay="0" title={this.state.taker_status} >
<Tooltip enterTouchDelay="0" title={t(this.state.taker_status)} >
<Badge variant="dot" overlap="circular" badgeContent="" color={this.statusBadgeColor(this.state.taker_status)}>
<Avatar className="smallAvatar"
alt={this.state.taker_nick}
@ -520,16 +528,16 @@ class OrderPage extends Component {
</>:
""
}
<Divider><Chip label='Order Details'/></Divider>
<Divider><Chip label={t("Order Details")}/></Divider>
<ListItem>
<ListItemIcon>
<ArticleIcon/>
</ListItemIcon>
<ListItemText primary={this.state.status_message} secondary="Order status"/>
<ListItemText primary={t(this.state.status_message)} secondary={t("Order status")}/>
</ListItem>
<Divider/>
</>
:<Divider><Chip label='Order Details'/></Divider>
:<Divider><Chip label={t("Order Details")}/></Divider>
}
<ListItem>
@ -540,10 +548,10 @@ class OrderPage extends Component {
</ListItemIcon>
{this.state.has_range & this.state.amount == null ?
<ListItemText primary={parseFloat(Number(this.state.min_amount).toPrecision(2))
+"-" + parseFloat(Number(this.state.max_amount).toPrecision(2)) +" "+this.state.currencyCode} secondary="Amount range"/>
+"-" + parseFloat(Number(this.state.max_amount).toPrecision(2)) +" "+this.state.currencyCode} secondary={t("Amount range")}/>
:
<ListItemText primary={parseFloat(parseFloat(this.state.amount).toFixed(4))
+" "+this.state.currencyCode} secondary="Amount"/>
+" "+this.state.currencyCode} secondary={t("Amount")}/>
}
</ListItem>
@ -553,7 +561,7 @@ class OrderPage extends Component {
<ListItemIcon>
<PaymentsIcon/>
</ListItemIcon>
<ListItemText primary={<PaymentText size={20} verbose={true} text={this.state.payment_method}/>} secondary={this.state.currency==1000 ? "Swap destination":"Accepted payment methods"}/>
<ListItemText primary={<PaymentText size={20} verbose={true} text={this.state.payment_method}/>} secondary={this.state.currency==1000 ? t("Swap destination"):t("Accepted payment methods")}/>
</ListItem>
<Divider />
@ -563,12 +571,12 @@ class OrderPage extends Component {
<PriceChangeIcon/>
</ListItemIcon>
{this.state.price_now?
<ListItemText primary={pn(this.state.price_now)+" "+this.state.currencyCode+"/BTC - Premium: "+this.state.premium_now+"%"} secondary="Price and Premium"/>
<ListItemText primary={t("{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%", {price: pn(this.state.price_now), currencyCode:this.state.currencyCode, premium: this.state.premium_now})} secondary={t("Price and Premium")}/>
:
(this.state.is_explicit ?
<ListItemText primary={pn(this.state.satoshis)} secondary="Amount of Satoshis"/>
<ListItemText primary={pn(this.state.satoshis)} secondary={t("Amount of Satoshis")}/>
:
<ListItemText primary={parseFloat(parseFloat(this.state.premium).toFixed(2))+"%"} secondary="Premium over market price"/>
<ListItemText primary={parseFloat(parseFloat(this.state.premium).toFixed(2))+"%"} secondary={t("Premium over market price")}/>
)
}
</ListItem>
@ -578,14 +586,14 @@ class OrderPage extends Component {
<ListItemIcon>
<NumbersIcon/>
</ListItemIcon>
<ListItemText primary={this.orderId} secondary="Order ID"/>
<ListItemText primary={this.orderId} secondary={t("Order ID")}/>
</ListItem>
<Divider />
<ListItem>
<ListItemIcon>
<AccessTimeIcon/>
</ListItemIcon>
<ListItemText secondary="Expires in">
<ListItemText secondary={t("Expires in")}>
<Countdown date={new Date(this.state.expires_at)} renderer={this.countdownRenderer} />
</ListItemText>
</ListItem>
@ -610,7 +618,7 @@ class OrderPage extends Component {
<Divider />
<Grid item xs={12} align="center">
<Alert severity="warning" sx={{maxWidth:360}}>
{this.state.is_maker ? this.state.taker_nick : this.state.maker_nick} is asking for a collaborative cancel
{t("{{nickname}} is asking for a collaboratice cancel", {nickname: this.state.is_maker ? this.state.taker_nick : this.state.maker_nick})}
</Alert>
</Grid>
</>
@ -622,7 +630,7 @@ class OrderPage extends Component {
<Divider />
<Grid item xs={12} align="center">
<Alert severity="warning" sx={{maxWidth:360}}>
You asked for a collaborative cancellation
{t("You asked for a collaborative cancellation")}
</Alert>
</Grid>
</>
@ -644,7 +652,7 @@ class OrderPage extends Component {
<Countdown date={new Date(this.state.penalty)} renderer={this.countdownTakeOrderRenderer} />
</Grid>
<Grid item xs={12} align="center">
<Button variant='contained' color='secondary' onClick={this.props.history.goBack}>Back</Button>
<Button variant='contained' color='secondary' onClick={this.props.history.goBack}>{t("Back")}</Button>
</Grid>
</Grid>
}
@ -674,7 +682,7 @@ class OrderPage extends Component {
}
doubleOrderPagePhone=()=>{
const { t } = this.props;
const [value, setValue] = React.useState(this.state.showContractBox);
const handleChange = (event, newValue) => {
@ -686,8 +694,8 @@ class OrderPage extends Component {
<Box sx={{ width: '100%'}}>
<Box sx={{ borderBottom: 1, borderColor: 'divider' }}>
<Tabs value={value} onChange={handleChange} variant="fullWidth" >
<Tab label="Order" {...this.a11yProps(0)} />
<Tab label="Contract" {...this.a11yProps(1)} />
<Tab label={t("Order")} {...this.a11yProps(0)} />
<Tab label={t("Contract")} {...this.a11yProps(1)} />
</Tabs>
</Box>
<Grid container spacing={2}>
@ -705,13 +713,15 @@ class OrderPage extends Component {
}
orderDetailsPage (){
const { t } = this.props;
return(
this.state.bad_request ?
<div align='center'>
<Typography component="subtitle2" variant="subtitle2" color="secondary" >
{/* IMPLEMENT I18N for bad_request */}
{this.state.bad_request}<br/>
</Typography>
<Button variant='contained' color='secondary' onClick={this.props.history.goBack}>Back</Button>
<Button variant='contained' color='secondary' onClick={this.props.history.goBack}>{t("Back")}</Button>
</div>
:
(this.state.is_participant ?

View File

@ -178,13 +178,11 @@ class TradeBox extends Component {
aria-describedby="fiat-received-dialog-description"
>
<DialogTitle id="open-dispute-dialog-title">
<Trans i18n="confirm_fiat_received_title">Confirm you received {{currencyCode: this.props.data.currencyCode}}?</Trans>
{t("Confirm you received {{currencyCode}}?", {currencyCode: this.props.data.currencyCode})}
</DialogTitle>
<DialogContent>
<DialogContentText id="alert-dialog-description">
<Trans i18n="confirm_fiat_received_dialog">
Confirming that you received the fiat will finalize the trade. The satoshis in the escrow will be released to the buyer. Only confirm after the {{currencyCode: this.props.data.currencyCode}} has arrived to your account. In addition, if you have received {{currencyCode: this.props.data.currencyCode}} and do not confirm the receipt, you risk losing your bond.
</Trans>
{t("Confirming that you received the fiat will finalize the trade. The satoshis in the escrow will be released to the buyer. Only confirm after the {{currencyCode}} has arrived to your account. In addition, if you have received {{currencyCode}} and do not confirm the receipt, you risk losing your bond.",{currencyCode: this.props.data.currencyCode})}
</DialogContentText>
</DialogContent>
<DialogActions>
@ -207,16 +205,14 @@ class TradeBox extends Component {
<Grid item xs={12} align="center">
{this.props.data.is_maker ?
<Typography color="primary" component="subtitle1" variant="subtitle1">
<b><Trans i18nKey="lock_to_publish">
Lock {{amountSats: pn(this.props.data.bond_satoshis)}} Sats to PUBLISH order
</Trans>
<b>
{t("Lock {{amountSats}} Sats to PUBLISH order", {amountSats: pn(this.props.data.bond_satoshis)})}
</b> {" " + this.stepXofY()}
</Typography>
:
<Typography color="primary" component="subtitle1" variant="subtitle1">
<b><Trans i18nKey="lock_to_take">
Lock {{amountSats: pn(this.props.data.bond_satoshis)}} Sats to TAKE the order
</Trans>
<b>
{t("Lock {{amountSats}} Sats to TAKE order", {amountSats: pn(this.props.data.bond_satoshis)})}
</b> {" " + this.stepXofY()}
</Typography>
}
@ -291,9 +287,8 @@ class TradeBox extends Component {
<this.Sound soundFileName="locked-invoice"/>
<Grid item xs={12} align="center">
<Typography color="green" component="subtitle1" variant="subtitle1">
<b><Trans i18nKey="lock_escrow" >
Lock {{amountSats:pn(this.props.data.escrow_satoshis)}} Sats as collateral
</Trans>
<b>
{t("Lock {{amountSats}} Sats as collateral", {amountSats:pn(this.props.data.escrow_satoshis)})}
</b>{" " + this.stepXofY()}
</Typography>
</Grid>
@ -312,7 +307,7 @@ class TradeBox extends Component {
size="small"
defaultValue={this.props.data.escrow_invoice}
disabled="true"
helperText={<Trans i18nKey="hold_escrow_invoice_explanation">This is a hold invoice, it will freeze in your wallet. It will be released to the buyer once you confirm to have received the {{currencyCode: this.props.data.currencyCode}}.</Trans>}
helperText={t("This is a hold invoice, it will freeze in your wallet. It will be released to the buyer once you confirm to have received the {{currencyCode}}.",{currencyCode: this.props.data.currencyCode})}
color = "secondary"
/>
</Grid>
@ -416,7 +411,7 @@ class TradeBox extends Component {
<ListItemIcon>
<BookIcon/>
</ListItemIcon>
<ListItemText primary={this.props.data.num_similar_orders} secondary={<Trans i18n="public_order_num_subtitle">Public orders for {{currencyCode: this.props.data.currencyCode}} </Trans>}/>
<ListItemText primary={this.props.data.num_similar_orders} secondary={t("Public orders for {{currencyCode}}",{currencyCode: this.props.data.currencyCode})}/>
</ListItem>
<Divider/>
@ -425,7 +420,7 @@ class TradeBox extends Component {
<PercentIcon/>
</ListItemIcon>
<ListItemText primary={t("Premium rank") +" "+this.props.data.premium_percentile*100+"%"}
secondary={<Trans i18n="among_public"> Among public {{ currencyCode: this.props.data.currencyCode }} orders (higher is cheaper)</Trans>} />
secondary={t("Among public {{currencyCode}} orders (higher is cheaper)",{ currencyCode: this.props.data.currencyCode })}/>
</ListItem>
<Divider/>
@ -508,18 +503,18 @@ class TradeBox extends Component {
{/* Make confirmation sound for HTLC received. */}
<this.Sound soundFileName="locked-invoice"/>
<Typography color="primary" component="subtitle1" variant="subtitle1">
<b> <Trans i18n="submit_invoice">
Submit an invoice for {{amountSats: pn(this.props.data.invoice_amount)}} Sats
</Trans>
<b> {t("Submit an invoice for {{amountSats}} Sats",{amountSats: pn(this.props.data.invoice_amount)})}
</b> {" " + this.stepXofY()}
</Typography>
</Grid>
<Grid item xs={12} align="left">
<Typography component="body2" variant="body2">
<Trans i18n='submit_invoice_body'>
The taker is committed! Before letting you send {{amountFiat: parseFloat(parseFloat(this.props.data.amount).toFixed(4))}} {{currencyCode: this.props.data.currencyCode}}, we want to make sure you are able to receive the BTC.
Please provide a valid invoice for {{amountSats: pn(this.props.data.invoice_amount)}} Satoshis.
</Trans>
{t("The taker is committed! Before letting you send {{amountFiat}} {{currencyCode}}, we want to make sure you are able to receive the BTC. Please provide a valid invoice for {{amountSats}} Satoshis.",
{amountFiat: parseFloat(parseFloat(this.props.data.amount).toFixed(4)),
currencyCode: this.props.data.currencyCode,
amountSats: pn(this.props.data.invoice_amount)}
)
}
</Typography>
</Grid>
@ -766,19 +761,21 @@ handleRatingRobosatsChange=(e)=>{
}
showFiatSentButton(){
const { t } = this.props;
return(
<Grid container spacing={1}>
<Grid item xs={12} align="center">
<Button defaultValue="confirm" variant='contained' color='secondary' onClick={this.handleClickConfirmButton}><Trans i18n="confirm_fiat_sent">Confirm {{currencyCode: this.props.data.currencyCode}} sent</Trans></Button>
<Button defaultValue="confirm" variant='contained' color='secondary' onClick={this.handleClickConfirmButton}>{t("Confirm {{currencyCode}} sent",{currencyCode: this.props.data.currencyCode})}</Button>
</Grid>
</Grid>
)
}
showFiatReceivedButton(){
const { t } = this.props;
return(
<Grid item xs={12} align="center">
<Button defaultValue="confirm" variant='contained' color='secondary' onClick={this.handleClickOpenConfirmFiatReceived}><Trans i18n="confirm_fiat_received">Confirm {{currencyCode: this.props.data.currencyCode}} received</Trans></Button>
<Button defaultValue="confirm" variant='contained' color='secondary' onClick={this.handleClickOpenConfirmFiatReceived}>{t("Confirm {{currencyCode}} received",{currencyCode: this.props.data.currencyCode})}</Button>
</Grid>
)
}
@ -844,7 +841,7 @@ handleRatingRobosatsChange=(e)=>{
{this.props.data.is_seller ?
<Typography component="body2" variant="body2" align="center">
{this.props.data.status == 9?
<Trans i18n="say_hi_seller">Say hi! Be helpful and concise. Let them know how to send you {{currencyCode: this.props.data.currencyCode}}.</Trans>
t("Say hi! Be helpful and concise. Let them know how to send you {{currencyCode}}.",{currencyCode: this.props.data.currencyCode})
:
t("The buyer has sent the fiat. Click 'Confirm Received' once you receive it.")
}
@ -976,9 +973,7 @@ handleRatingRobosatsChange=(e)=>{
</Grid>
<Grid item xs={12} align="center">
<Typography color="primary" component="subtitle1" variant="subtitle1">
<b> <Trans i18n="submit_invoice">
Submit an invoice for {{amountSats: pn(this.props.data.invoice_amount)}} Sats
</Trans></b>
<b> {t("Submit an invoice for {{amountSats}} Sats",{amountSats: pn(this.props.data.invoice_amount)})}</b>
</Typography>
</Grid>
<Grid item xs={12} align="center">

View File

@ -63,16 +63,78 @@
"Must be less than {{maxSats}": "Must be less than {{maxSats}}",
"Must be more than {{minSats}}": "Must be more than {{minSats}}",
"ORDER PAGE - OrderPage.js": "Order details page",
"Order Box":"Order Box",
"Contract":"Contract",
"Active":"Active",
"Seen recently":"Seen recently",
"Inactive":"Inactive",
"(Seller)":"(Seller)",
"(Buyer)":"(Buyer)",
"Order maker":"Order maker",
"Order taker":"Order taker",
"Order Details":"Order Details",
"Order status":"Order status",
"Waiting for maker bond":"Waiting for maker bond",
"Public":"Public",
"Waiting for taker bond":"Waiting for taker bond",
"Cancelled":"Cancelled",
"Expired":"Expired",
"Waiting for trade collateral and buyer invoice":"Waiting for trade collateral and buyer invoice",
"Waiting only for seller trade collateral":"Waiting only for seller trade collateral",
"Waiting only for buyer invoice":"Waiting only for buyer invoice",
"Sending fiat - In chatroom":"Sending fiat - In chatroom",
"Fiat sent - In chatroom":"Fiat sent - In chatroom",
"In dispute":"In dispute",
"Collaboratively cancelled":"Collaboratively cancelled",
"Sending satoshis to buyer":"Sending satoshis to buyer",
"Sucessful trade":"Sucessful trade",
"Failed lightning network routing":"Failed lightning network routing",
"Wait for dispute resolution":"Wait for dispute resolution",
"Maker lost dispute":"Maker lost dispute",
"Taker lost dispute":"Taker lost dispute",
"Amount range":"Amount range",
"Swap destination":"Swap destination",
"Accepted payment methods":"Accepted payment methods",
"{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%":"{{price}} {{currencyCode}}/BTC - Premium: {{premium}}%",
"Price and Premium":"Price and Premium",
"Amount of Satoshis":"Amount of Satoshis",
"Premium over market price":"Premium over market price",
"Order ID":"Order ID",
"Expires in":"Expires in",
"{{nickname}} is asking for a collaboratice cancel":"{{nickname}} is asking for a collaboratice cancel",
"You asked for a collaborative cancellation":"You asked for a collaborative cancellation",
"Invoice expired. You did not confirm publishing the order in time. Make a new order.":"Invoice expired. You did not confirm publishing the order in time. Make a new order.",
"Penalty lifted, good to go!":"Penalty lifted, good to go!",
"You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s":"You cannot take an order yet! Wait {{timeMin}}m {{timeSec}}s",
"Too low":"Too low",
"Too high":"Too high",
"Enter amount of fiat to exchange for bitcoin":"Enter amount of fiat to exchange for bitcoin",
"Amount {{currencyCode}}":"Amount {{currencyCode}}",
"You must specify an amount first":"You must specify an amount first",
"Take Order":"Take Order",
"Wait until you can take an order":"Wait until you can take an order",
"Cancel the order?":"Cancel the order?",
"If the order is cancelled now you will lose your bond.":"If the order is cancelled now you will lose your bond.",
"Confirm Cancel":"Confirm Cancel",
"The maker is away":"The maker is away",
"By taking this order you risk wasting your time. If the maker does not proceed in time, you will be compensated in satoshis for 50% of the maker bond.":"By taking this order you risk wasting your time. If the maker does not proceed in time, you will be compensated in satoshis for 50% of the maker bond.",
"Collaborative cancel the order?":"Collaborative cancel the order?",
"The trade escrow has been posted. The order can be cancelled only if both, maker and taker, agree to cancel.":"The trade escrow has been posted. The order can be cancelled only if both, maker and taker, agree to cancel.",
"Ask for Cancel":"Ask for Cancel",
"Cancel":"Cancel",
"Collaborative Cancel":"Collaborative Cancel",
"CONTRACT BOX - TradeBox.js": "The Contract Box that guides users trough the whole trade pipeline",
"Contract Box":"Contract Box",
"Robots show commitment to their peers": "Robots show commitment to their peers",
"lock_to_publish": "Lock {{amountSats}} Sats to PUBLISH order ",
"lock_to_take": "Lock {{amountSats}} Sats to TAKE the order ",
"lock_escrow": "Lock {{amountSats}} Sats as collateral",
"Lock {{amountSats}} Sats to PUBLISH order": "Lock {{amountSats}} Sats to PUBLISH order",
"Lock {{amountSats}} Sats to TAKE order": "Lock {{amountSats}} Sats to TAKE order",
"Lock {{amountSats}} Sats as collateral": "Lock {{amountSats}} Sats as collateral",
"Copy to clipboard":"Copy to clipboard",
"This is a hold invoice, it will freeze in your wallet. It will be charged only if you cancel or lose a dispute.":"This is a hold invoice, it will freeze in your wallet. It will be charged only if you cancel or lose a dispute.",
"hold_escrow_invoice_explanation":"This is a hold invoice, it will freeze in your wallet. It will be released to the buyer once you confirm to have received the {{currencyCode}}.",
"This is a hold invoice, it will freeze in your wallet. It will be released to the buyer once you confirm to have received the {{currencyCode}}.":"This is a hold invoice, it will freeze in your wallet. It will be released to the buyer once you confirm to have received the {{currencyCode}}.",
"Your maker bond is locked":"Your maker bond is locked",
"Your taker bond is locked":"Your taker bond is locked",
"Your maker bond was settled":"Your maker bond was settled",
@ -88,13 +150,13 @@
"Go back":"Go back",
"Enable":"Enable",
"Telegram enabled":"Telegram enabled",
"public_order_num_subtitle": "Public orders for {{currencyCode}}",
"Public orders for {{currencyCode}}":"Public orders for {{currencyCode}}",
"Premium rank": "Premium rank",
"among_public": "Among public {{currencyCode}} orders (higher is cheaper)",
"Among public {{currencyCode}} orders (higher is cheaper)": "Among public {{currencyCode}} orders (higher is cheaper)",
"A taker has been found!":"A taker has been found!",
"Please wait for the taker to lock a bond. If the taker does not lock a bond in time, the order will be made public again.":"Please wait for the taker to lock a bond. If the taker does not lock a bond in time, the order will be made public again.",
"submit_invoice":"Submit an invoice for {{amountSats}} Sats",
"submit_invoice_body":"The taker is committed! Before letting you send {{amountFiat}} {{currencyCode}}, we want to make sure you are able to receive the BTC. Please provide a valid invoice for {{amountSats}} Satoshis.",
"Submit an invoice for {{amountSats}} Sats":"Submit an invoice for {{amountSats}} Sats",
"The taker is committed! Before letting you send {{amountFiat}} {{currencyCode}}, we want to make sure you are able to receive the BTC. Please provide a valid invoice for {{amountSats}} Satoshis.":"The taker is committed! Before letting you send {{amountFiat}} {{currencyCode}}, we want to make sure you are able to receive the BTC. Please provide a valid invoice for {{amountSats}} Satoshis.",
"Payout Lightning Invoice":"Payout Lightning Invoice",
"Your invoice looks good!":"Your invoice looks good!",
"We are waiting for the seller lock the trade amount.":"We are waiting for the seller lock the trade amount.",
@ -102,18 +164,18 @@
"The trade collateral is locked!":"The trade collateral is locked!",
"We are waiting for the buyer to post a lightning invoice. Once he does, you will be able to directly communicate the fiat payment details.":"We are waiting for the buyer to post a lightning invoice. Once he does, you will be able to directly communicate the fiat payment details.",
"Just hang on for a moment. If the buyer does not cooperate, you will get back the trade collateral and your bond automatically. In addition, you will receive a compensation (check the rewards in your profile).":"Just hang on for a moment. If the buyer does not cooperate, you will get back the trade collateral and your bond automatically. In addition, you will receive a compensation (check the rewards in your profile).",
"confirm_fiat_sent":"Confirm {{currencyCode}} sent",
"confirm_fiat_received":"Confirm {{currencyCode}} received",
"Confirm {{currencyCode}} sent":"Confirm {{currencyCode}} sent",
"Confirm {{currencyCode}} received":"Confirm {{currencyCode}} received",
"Open Dispute":"Open Dispute",
"The order has expired":"The order has expired",
"Chat with the buyer":"Chat with the buyer",
"Chat with the seller":"Chat with the seller",
"say_hi_seller":"Say hi! Be helpful and concise. Let them know how to send you {{currencyCode}}.",
"Say hi! Be helpful and concise. Let them know how to send you {{currencyCode}}.":"Say hi! Be helpful and concise. Let them know how to send you {{currencyCode}}.",
"The buyer has sent the fiat. Click 'Confirm Received' once you receive it.":"The buyer has sent the fiat. Click 'Confirm Received' once you receive it.",
"Say hi! Ask for payment details and click 'Confirm Sent' as soon as the payment is sent.":"Say hi! Ask for payment details and click 'Confirm Sent' as soon as the payment is sent.",
"Wait for the seller to confirm he has received the payment.":"Wait for the seller to confirm he has received the payment.",
"confirm_fiat_received_title":"Confirm you received {{currencyCode}}?",
"confirm_fiat_received_dialog":"Confirming that you received the fiat will finalize the trade. The satoshis in the escrow will be released to the buyer. Only confirm after the {{currencyCode}} has arrived to your account. In addition, if you have received {{currencyCode}} and do not confirm the receipt, you risk losing your bond.",
"Confirm you received {{currencyCode}}?":"Confirm you received {{currencyCode}}?",
"Confirming that you received the fiat will finalize the trade. The satoshis in the escrow will be released to the buyer. Only confirm after the {{currencyCode}} has arrived to your account. In addition, if you have received {{currencyCode}} and do not confirm the receipt, you risk losing your bond.":"Confirming that you received the fiat will finalize the trade. The satoshis in the escrow will be released to the buyer. Only confirm after the {{currencyCode}} has arrived to your account. In addition, if you have received {{currencyCode}} and do not confirm the receipt, you risk losing your bond.",
"Confirm":"Confirm",
"🎉Trade finished!🥳":"🎉Trade finished!🥳",
"rate_robosats":"What do you think of 🤖<1>RoboSats</1>⚡?",

File diff suppressed because one or more lines are too long