From 77f625127a40893305abe573bda6f197bb4d7fb5 Mon Sep 17 00:00:00 2001 From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com> Date: Mon, 11 Apr 2022 09:18:55 +0200 Subject: [PATCH] Translate Wallet Page --- qortal-ui-core/language/cn.json | 45 ++- qortal-ui-core/language/de.json | 44 +++ qortal-ui-core/language/fr.json | 45 ++- qortal-ui-core/language/pl.json | 44 +++ qortal-ui-core/language/sp.json | 44 +++ qortal-ui-core/language/us.json | 44 +++ .../plugins/core/wallet/wallet-app.src.js | 343 ++++++++++-------- 7 files changed, 465 insertions(+), 144 deletions(-) diff --git a/qortal-ui-core/language/cn.json b/qortal-ui-core/language/cn.json index 96a3fd48..de7faad7 100644 --- a/qortal-ui-core/language/cn.json +++ b/qortal-ui-core/language/cn.json @@ -122,7 +122,6 @@ "continue": "繼續", "save": "節省" }, - "mintingpage": { "mintingpage": { "mchange1": "General Minting Details", "mchange2": "Blockchain Statistics", @@ -162,5 +161,49 @@ "mchange36": "Your sponsor will issue you a ‘Sponsorship Key’ which you will use to add to your node, and begin minting (for no rewards until reaching level 1.) Once you reach level 1, you create/assign your own ‘Minting Key’ and begin earning rewards. You have XXXX blocks remaining in your sponsorship period.", "mchange37": "Simply reach out to a minter in Qortal who is high enough level to issue a sponsorship key, obtain that key, then come back here and input the key to begin your minting journey !", "mchange38": "in" + }, + "walletpage": { + "wchange1": "Fetching balance ...", + "wchange2": "Current Wallet", + "wchange3": "Copy wallet address to clipboard", + "wchange4": "Address copied to clipboard", + "wchange5": "Transaction Details", + "wchange6": "Transaction Type", + "wchange7": "OUT", + "wchange8": "IN", + "wchange9": "Sender", + "wchange10": "Receiver", + "wchange11": "Amount", + "wchange12": "Transaction Fee", + "wchange13": "Block", + "wchange14": "Time", + "wchange15": "Transaction Signature", + "wchange16": "Transaction Hash", + "wchange17": "Send", + "wchange18": "From address", + "wchange19": "Available balance", + "wchange20": "To (address or name)", + "wchange21": "Current static fee:", + "wchange22": "Wallets", + "wchange23": "To (address)", + "wchange24": "Current fee per byte", + "wchange25": "Low fees may result in slow or unconfirmed transactions.", + "wchange26": "Insufficient Funds!", + "wchange27": "Invalid Amount!", + "wchange28": "Receiver cannot be empty!", + "wchange29": "Inalid Receiver!", + "wchange30": "Transaction Successful!", + "wchange31": "Transaction Failed!", + "wchange32": "Failed to Fetch QORT Balance. Try again!", + "wchange33": "Failed to Fetch", + "wchange34": "Balance. Try again!", + "wchange35": "Type", + "wchange36": "Fee", + "wchange37": "Total Amount", + "wchange38": "Address has no transactions yet.", + "wchange39": "Unable to copy address.", + "wchange40": "PAYMENT", + "wchange41": "Status", + "wchange42": "Confirmations" } } \ No newline at end of file diff --git a/qortal-ui-core/language/de.json b/qortal-ui-core/language/de.json index f13f98ea..ba6fda79 100644 --- a/qortal-ui-core/language/de.json +++ b/qortal-ui-core/language/de.json @@ -161,5 +161,49 @@ "mchange36": "Ihr Sponsor stellt Ihnen einen „Sponsorship Key“ aus, den Sie zum Hinzufügen zu Ihrem Knoten verwenden und mit dem Prägen beginnen (keine Belohnungen bis zum Erreichen von Level 1). Sobald Sie Level 1 erreicht haben, erstellen/weisen Sie Ihren eigenen „Minting Key“ und Beginnen Sie mit dem Verdienen von Belohnungen. Sie haben noch XXXX-Blöcke in Ihrem Sponsoring-Zeitraum.", "mchange37": "Wenden Sie sich einfach an einen Minter in Qortal, der hoch genug ist, um einen Sponsoring-Schlüssel auszustellen, erhalten Sie diesen Schlüssel, kommen Sie dann hierher zurück und geben Sie den Schlüssel ein, um Ihre Minting-Reise zu beginnen!", "mchange38": "in" + }, + "walletpage": { + "wchange1": "Hole Kontostand ...", + "wchange2": "Aktuelle Brieftasche", + "wchange3": "Brieftaschenadresse in die Zwischenablage kopieren", + "wchange4": "Adresse in die Zwischenablage kopiert", + "wchange5": "Transaktionsdetails", + "wchange6": "Art der Transaktion", + "wchange7": "RAUS", + "wchange8": "REIN", + "wchange9": "Sender", + "wchange10": "Empfäner", + "wchange11": "Menge", + "wchange12": "Transaktionsgebühr", + "wchange13": "Block", + "wchange14": "Zeit", + "wchange15": "Transaktionssignatur", + "wchange16": "Transaktions-Hash", + "wchange17": "Sende", + "wchange18": "Von der Adresse", + "wchange19": "Verfügbares Guthaben", + "wchange20": "An (Adresse oder Name)", + "wchange21": "Aktuelle statische Gebühr", + "wchange22": "Geldbörsen", + "wchange23": "An (Adresse)", + "wchange24": "Aktuelle Gebühr pro Byte", + "wchange25": "Niedrige Gebühren können zu langsamen oder unbestätigten Transaktionen führen.", + "wchange26": "Unzureichendes Guthaben!", + "wchange27": "Ungültige Menge!", + "wchange28": "Empfänger darf nicht leer sein!", + "wchange29": "Ungültiger Empfänger!", + "wchange30": "Transaktion Erfolgreich!", + "wchange31": "Transaktion fehlgeschlagen!", + "wchange32": "QORT-Guthaben konnte nicht abgerufen werden. Versuchen Sie es nochmal!", + "wchange33": "Fehler beim Abrufen vom", + "wchange34": "Guthaben. Versuchen Sie es nochmal!", + "wchange35": "Typ", + "wchange36": "Gebühr", + "wchange37": "Gesamtsumme", + "wchange38": "Adresse hat noch keine Transaktionen.", + "wchange39": "Adresse kann nicht kopiert werden.", + "wchange40": "ZAHLUNG", + "wchange41": "Status", + "wchange42": "Bestätigungen" } } \ No newline at end of file diff --git a/qortal-ui-core/language/fr.json b/qortal-ui-core/language/fr.json index 506ee0eb..5afccd97 100644 --- a/qortal-ui-core/language/fr.json +++ b/qortal-ui-core/language/fr.json @@ -122,7 +122,6 @@ "continue": "Continuez", "save": "Sauver" }, - "mintingpage": { "mintingpage": { "mchange1": "General Minting Details", "mchange2": "Blockchain Statistics", @@ -162,5 +161,49 @@ "mchange36": "Your sponsor will issue you a ‘Sponsorship Key’ which you will use to add to your node, and begin minting (for no rewards until reaching level 1.) Once you reach level 1, you create/assign your own ‘Minting Key’ and begin earning rewards. You have XXXX blocks remaining in your sponsorship period.", "mchange37": "Simply reach out to a minter in Qortal who is high enough level to issue a sponsorship key, obtain that key, then come back here and input the key to begin your minting journey !", "mchange38": "in" + }, + "walletpage": { + "wchange1": "Fetching balance ...", + "wchange2": "Current Wallet", + "wchange3": "Copy wallet address to clipboard", + "wchange4": "Address copied to clipboard", + "wchange5": "Transaction Details", + "wchange6": "Transaction Type", + "wchange7": "OUT", + "wchange8": "IN", + "wchange9": "Sender", + "wchange10": "Receiver", + "wchange11": "Amount", + "wchange12": "Transaction Fee", + "wchange13": "Block", + "wchange14": "Time", + "wchange15": "Transaction Signature", + "wchange16": "Transaction Hash", + "wchange17": "Send", + "wchange18": "From address", + "wchange19": "Available balance", + "wchange20": "To (address or name)", + "wchange21": "Current static fee:", + "wchange22": "Wallets", + "wchange23": "To (address)", + "wchange24": "Current fee per byte", + "wchange25": "Low fees may result in slow or unconfirmed transactions.", + "wchange26": "Insufficient Funds!", + "wchange27": "Invalid Amount!", + "wchange28": "Receiver cannot be empty!", + "wchange29": "Inalid Receiver!", + "wchange30": "Transaction Successful!", + "wchange31": "Transaction Failed!", + "wchange32": "Failed to Fetch QORT Balance. Try again!", + "wchange33": "Failed to Fetch", + "wchange34": "Balance. Try again!", + "wchange35": "Type", + "wchange36": "Fee", + "wchange37": "Total Amount", + "wchange38": "Address has no transactions yet.", + "wchange39": "Unable to copy address.", + "wchange40": "PAYMENT", + "wchange41": "Status", + "wchange42": "Confirmations" } } \ No newline at end of file diff --git a/qortal-ui-core/language/pl.json b/qortal-ui-core/language/pl.json index 3103cec5..e0f1d0cb 100644 --- a/qortal-ui-core/language/pl.json +++ b/qortal-ui-core/language/pl.json @@ -161,5 +161,49 @@ "mchange36": "Your sponsor will issue you a ‘Sponsorship Key’ which you will use to add to your node, and begin minting (for no rewards until reaching level 1.) Once you reach level 1, you create/assign your own ‘Minting Key’ and begin earning rewards. You have XXXX blocks remaining in your sponsorship period.", "mchange37": "Simply reach out to a minter in Qortal who is high enough level to issue a sponsorship key, obtain that key, then come back here and input the key to begin your minting journey !", "mchange38": "in" + }, + "walletpage": { + "wchange1": "Fetching balance ...", + "wchange2": "Current Wallet", + "wchange3": "Copy wallet address to clipboard", + "wchange4": "Address copied to clipboard", + "wchange5": "Transaction Details", + "wchange6": "Transaction Type", + "wchange7": "OUT", + "wchange8": "IN", + "wchange9": "Sender", + "wchange10": "Receiver", + "wchange11": "Amount", + "wchange12": "Transaction Fee", + "wchange13": "Block", + "wchange14": "Time", + "wchange15": "Transaction Signature", + "wchange16": "Transaction Hash", + "wchange17": "Send", + "wchange18": "From address", + "wchange19": "Available balance", + "wchange20": "To (address or name)", + "wchange21": "Current static fee:", + "wchange22": "Wallets", + "wchange23": "To (address)", + "wchange24": "Current fee per byte", + "wchange25": "Low fees may result in slow or unconfirmed transactions.", + "wchange26": "Insufficient Funds!", + "wchange27": "Invalid Amount!", + "wchange28": "Receiver cannot be empty!", + "wchange29": "Inalid Receiver!", + "wchange30": "Transaction Successful!", + "wchange31": "Transaction Failed!", + "wchange32": "Failed to Fetch QORT Balance. Try again!", + "wchange33": "Failed to Fetch", + "wchange34": "Balance. Try again!", + "wchange35": "Type", + "wchange36": "Fee", + "wchange37": "Total Amount", + "wchange38": "Address has no transactions yet.", + "wchange39": "Unable to copy address.", + "wchange40": "PAYMENT", + "wchange41": "Status", + "wchange42": "Confirmations" } } diff --git a/qortal-ui-core/language/sp.json b/qortal-ui-core/language/sp.json index 48cedc00..885afb0a 100644 --- a/qortal-ui-core/language/sp.json +++ b/qortal-ui-core/language/sp.json @@ -161,5 +161,49 @@ "mchange36": "Your sponsor will issue you a ‘Sponsorship Key’ which you will use to add to your node, and begin minting (for no rewards until reaching level 1.) Once you reach level 1, you create/assign your own ‘Minting Key’ and begin earning rewards. You have XXXX blocks remaining in your sponsorship period.", "mchange37": "Simply reach out to a minter in Qortal who is high enough level to issue a sponsorship key, obtain that key, then come back here and input the key to begin your minting journey !", "mchange38": "in" + }, + "walletpage": { + "wchange1": "Fetching balance ...", + "wchange2": "Current Wallet", + "wchange3": "Copy wallet address to clipboard", + "wchange4": "Address copied to clipboard", + "wchange5": "Transaction Details", + "wchange6": "Transaction Type", + "wchange7": "OUT", + "wchange8": "IN", + "wchange9": "Sender", + "wchange10": "Receiver", + "wchange11": "Amount", + "wchange12": "Transaction Fee", + "wchange13": "Block", + "wchange14": "Time", + "wchange15": "Transaction Signature", + "wchange16": "Transaction Hash", + "wchange17": "Send", + "wchange18": "From address", + "wchange19": "Available balance", + "wchange20": "To (address or name)", + "wchange21": "Current static fee:", + "wchange22": "Wallets", + "wchange23": "To (address)", + "wchange24": "Current fee per byte", + "wchange25": "Low fees may result in slow or unconfirmed transactions.", + "wchange26": "Insufficient Funds!", + "wchange27": "Invalid Amount!", + "wchange28": "Receiver cannot be empty!", + "wchange29": "Inalid Receiver!", + "wchange30": "Transaction Successful!", + "wchange31": "Transaction Failed!", + "wchange32": "Failed to Fetch QORT Balance. Try again!", + "wchange33": "Failed to Fetch", + "wchange34": "Balance. Try again!", + "wchange35": "Type", + "wchange36": "Fee", + "wchange37": "Total Amount", + "wchange38": "Address has no transactions yet.", + "wchange39": "Unable to copy address.", + "wchange40": "PAYMENT", + "wchange41": "Status", + "wchange42": "Confirmations" } } \ No newline at end of file diff --git a/qortal-ui-core/language/us.json b/qortal-ui-core/language/us.json index 4200174c..38a3c981 100644 --- a/qortal-ui-core/language/us.json +++ b/qortal-ui-core/language/us.json @@ -161,5 +161,49 @@ "mchange36": "Your sponsor will issue you a ‘Sponsorship Key’ which you will use to add to your node, and begin minting (for no rewards until reaching level 1.) Once you reach level 1, you create/assign your own ‘Minting Key’ and begin earning rewards. You have XXXX blocks remaining in your sponsorship period.", "mchange37": "Simply reach out to a minter in Qortal who is high enough level to issue a sponsorship key, obtain that key, then come back here and input the key to begin your minting journey !", "mchange38": "in" + }, + "walletpage": { + "wchange1": "Fetching balance ...", + "wchange2": "Current Wallet", + "wchange3": "Copy wallet address to clipboard", + "wchange4": "Address copied to clipboard", + "wchange5": "Transaction Details", + "wchange6": "Transaction Type", + "wchange7": "OUT", + "wchange8": "IN", + "wchange9": "Sender", + "wchange10": "Receiver", + "wchange11": "Amount", + "wchange12": "Transaction Fee", + "wchange13": "Block", + "wchange14": "Time", + "wchange15": "Transaction Signature", + "wchange16": "Transaction Hash", + "wchange17": "Send", + "wchange18": "From address", + "wchange19": "Available balance", + "wchange20": "To (address or name)", + "wchange21": "Current static fee:", + "wchange22": "Wallets", + "wchange23": "To (address)", + "wchange24": "Current fee per byte", + "wchange25": "Low fees may result in slow or unconfirmed transactions.", + "wchange26": "Insufficient Funds!", + "wchange27": "Invalid Amount!", + "wchange28": "Receiver cannot be empty!", + "wchange29": "Invalid Receiver!", + "wchange30": "Transaction Successful!", + "wchange31": "Transaction Failed!", + "wchange32": "Failed to Fetch QORT Balance. Try again!", + "wchange33": "Failed to Fetch", + "wchange34": "Balance. Try again!", + "wchange35": "Type", + "wchange36": "Fee", + "wchange37": "Total Amount", + "wchange38": "Address has no transactions yet.", + "wchange39": "Unable to copy address.", + "wchange40": "PAYMENT", + "wchange41": "Status", + "wchange42": "Confirmations" } } \ No newline at end of file diff --git a/qortal-ui-plugins/plugins/core/wallet/wallet-app.src.js b/qortal-ui-plugins/plugins/core/wallet/wallet-app.src.js index ce41aeb2..77520bd3 100644 --- a/qortal-ui-plugins/plugins/core/wallet/wallet-app.src.js +++ b/qortal-ui-plugins/plugins/core/wallet/wallet-app.src.js @@ -1,6 +1,11 @@ import { LitElement, html, css } from 'lit' import { render } from 'lit/html.js' import { Epml } from '../../../epml.js' +import { use, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate' + +registerTranslateConfig({ + loader: lang => fetch(`/language/${lang}.json`).then(res => res.json()) +}) import '../components/ButtonIconCopy' import '@material/mwc-button' @@ -50,7 +55,7 @@ class MultiWallet extends LitElement { btcFeePerByte: { type: Number }, ltcFeePerByte: { type: Number }, dogeFeePerByte: { type: Number }, - balanceString: 'Fetching balance ...' + balanceString: { type: String } } } @@ -535,6 +540,7 @@ class MultiWallet extends LitElement { height: 0, } + this.balanceString = this.renderFetchText() this.selectedTransaction = {} this.isTextMenuOpen = false this.loading = true @@ -612,7 +618,7 @@ class MultiWallet extends LitElement { return html`
-
Wallets
+
${translate("walletpage.wchange22")}
@@ -635,13 +641,13 @@ class MultiWallet extends LitElement {

- Current Wallet + ${translate("walletpage.wchange2")}
${this.getSelectedWalletAddress()}
-

Transaction Details

+

${translate("walletpage.wchange5")}


- Transaction Type + ${translate("walletpage.wchange6")}
${this.selectedTransaction.type} - ${this.selectedTransaction.txnFlow === 'OUT' ? html`OUT` : html`IN`} + ${this.selectedTransaction.txnFlow === 'OUT' ? html`${translate("walletpage.wchange7")}` : html`${translate("walletpage.wchange8")}`}
- Sender + ${translate("walletpage.wchange9")}
${this.selectedTransaction.creatorAddress}
- Receiver + ${translate("walletpage.wchange10")}
${this.selectedTransaction.recipient}
${!this.selectedTransaction.amount ? '' : html` - Amount + ${translate("walletpage.wchange11")}
${this.selectedTransaction.amount} QORT
`} - Transaction Fee + ${translate("walletpage.wchange12")}
${this.selectedTransaction.fee}
- Block + ${translate("walletpage.wchange13")}
${this.selectedTransaction.blockHeight}
- Time + ${translate("walletpage.wchange14")}
${new Date(this.selectedTransaction.timestamp).toString()}
- Transaction Signature + ${translate("walletpage.wchange15")}
${this.selectedTransaction.signature}
@@ -702,46 +708,46 @@ class MultiWallet extends LitElement { dialogAction="cancel" class="red" > - Close + ${translate("general.close")}
-

Transaction Details

+

${translate("walletpage.wchange5")}


- Transaction Type + ${translate("walletpage.wchange6")}
- PAYMENT - ${this.selectedTransaction.btcTxnFlow === 'OUT' ? html`OUT` : html`IN`} + ${translate("walletpage.wchange40")} + ${this.selectedTransaction.btcTxnFlow === 'OUT' ? html`${translate("walletpage.wchange7")}` : html`${translate("walletpage.wchange8")}`}
- Sender + ${translate("walletpage.wchange9")}
${this.selectedTransaction.btcSender}
- Receiver + ${translate("walletpage.wchange10")}
${this.selectedTransaction.btcReceiver}
- Transaction Fee + ${translate("walletpage.wchange12")}
${(this.selectedTransaction.feeAmount / 1e8).toFixed(8)} BTC
- Total Amount + ${translate("walletpage.wchange37")}
${(this.selectedTransaction.totalAmount / 1e8).toFixed(8)} BTC
- Time + ${translate("walletpage.wchange14")}
${new Date(this.selectedTransaction.timestamp).toString()}
- Transaction Hash + ${translate("walletpage.wchange16")}
${this.selectedTransaction.txHash} @@ -752,46 +758,46 @@ class MultiWallet extends LitElement { dialogAction="cancel" class="red" > - Close + ${translate("general.close")}
-

Transaction Details

+

${translate("walletpage.wchange5")}


- Transaction Type + ${translate("walletpage.wchange6")}e
- PAYMENT - ${this.selectedTransaction.ltcTxnFlow === 'OUT' ? html`OUT` : html`IN`} + ${translate("walletpage.wchange40")} + ${this.selectedTransaction.ltcTxnFlow === 'OUT' ? html`${translate("walletpage.wchange7")}` : html`${translate("walletpage.wchange8")}`}
- Sender + ${translate("walletpage.wchange9")}
${this.selectedTransaction.ltcSender}
- Receiver + ${translate("walletpage.wchange10")}
- ${this.selectedTransaction.ltcReceiver} + ${this.selectedTransaction.ltcReceiver}
- Transaction Fee + ${translate("walletpage.wchange12")}
- ${(this.selectedTransaction.feeAmount / 1e8).toFixed(8)} LTC + ${(this.selectedTransaction.feeAmount / 1e8).toFixed(8)} LTC
- Total Amount + ${translate("walletpage.wchange37")}
- ${(this.selectedTransaction.totalAmount / 1e8).toFixed(8)} LTC + ${(this.selectedTransaction.totalAmount / 1e8).toFixed(8)} LTC
- Time + ${translate("walletpage.wchange14")}
${new Date(this.selectedTransaction.timestamp).toString()}
- Transaction Hash + ${translate("walletpage.wchange16")}
${this.selectedTransaction.txHash} @@ -802,46 +808,46 @@ class MultiWallet extends LitElement { dialogAction="cancel" class="red" > - Close + ${translate("general.close")}
-

Transaction Details

+

${translate("walletpage.wchange5")}


- Transaction Type + ${translate("walletpage.wchange6")}
- PAYMENT - ${this.selectedTransaction.dogeTxnFlow === 'OUT' ? html`OUT` : html`IN`} + ${translate("walletpage.wchange40")} + ${this.selectedTransaction.dogeTxnFlow === 'OUT' ? html`${translate("walletpage.wchange7")}` : html`${translate("walletpage.wchange8")}`}
- Sender + ${translate("walletpage.wchange9")}
${this.selectedTransaction.dogeSender}
- Receiver + ${translate("walletpage.wchange10")}
${this.selectedTransaction.dogeReceiver}
- Transaction Fee + ${translate("walletpage.wchange12")}
${(this.selectedTransaction.feeAmount / 1e8).toFixed(8)} DOGE
- Total Amount + ${translate("walletpage.wchange37")}
${(this.selectedTransaction.totalAmount / 1e8).toFixed(8)} DOGE
- Time + ${translate("walletpage.wchange14")}
${new Date(this.selectedTransaction.timestamp).toString()}
- Transaction Hash + ${translate("walletpage.wchange16")}
${this.selectedTransaction.txHash} @@ -852,7 +858,7 @@ class MultiWallet extends LitElement { dialogAction="cancel" class="red" > - Close + ${translate("general.close")} @@ -860,15 +866,15 @@ class MultiWallet extends LitElement {
-

Send QORT

+

${translate("walletpage.wchange17")} QORT


- From address:
+ ${translate("walletpage.wchange18")}:
${this.getSelectedWalletAddress()}

- Available balance:
+ ${translate("walletpage.wchange19")}:
${this.balanceString}

@@ -877,7 +883,7 @@ class MultiWallet extends LitElement { required @input="${(e) => { this._checkAmount(e) }}" id="amountInput" - label="Amount (QORT)" + label="${translate("walletpage.wchange11")} (QORT)" type="number" auto-validate="false" value="${this.amount}" @@ -889,14 +895,14 @@ class MultiWallet extends LitElement { style="width: 100%;" required id="recipient" - label="To (address or name)" + label="${translate("walletpage.wchange20")}" type="text" value="${this.recipient}" >

-

Current static fee: 0.001 QORT

+

${translate("walletpage.wchange21")} 0.001 QORT

${this.errorMessage}

${this.successMessage}

@@ -905,7 +911,7 @@ class MultiWallet extends LitElement {
this.sendQort()}> - Send QORT + ${translate("walletpage.wchange17")} QORT
@@ -915,7 +921,7 @@ class MultiWallet extends LitElement { dialogAction="cancel" class="red" > - Close + ${translate("general.close")} @@ -923,7 +929,7 @@ class MultiWallet extends LitElement {
-

Send BTC

+

${translate("walletpage.wchange17")} BTC


@@ -940,7 +946,7 @@ class MultiWallet extends LitElement { required @input="${(e) => { this._checkAmount(e) }}" id="btcAmountInput" - label="Amount (BTC)" + label="${translate("walletpage.wchange11")} (BTC)" type="number" auto-validate="false" value="${this.btcAmount}" @@ -959,7 +965,7 @@ class MultiWallet extends LitElement {

-

Current fee per byte: ${(this.btcFeePerByte / 1e8).toFixed(8)} BTC
Low fees may result in slow or unconfirmed transactions.

+

${translate("walletpage.wchange24")}: ${(this.btcFeePerByte / 1e8).toFixed(8)} BTC
${translate("walletpage.wchange25")}

this.sendBtc()}> - Send BTC + ${translate("walletpage.wchange17")} BTC
@@ -989,7 +995,7 @@ class MultiWallet extends LitElement { dialogAction="cancel" class="red" > - Close + ${translate("general.close")} @@ -997,15 +1003,15 @@ class MultiWallet extends LitElement {
-

Send LTC

+

${translate("walletpage.wchange17")} LTC


- From address:
+ ${translate("walletpage.wchange18")}:
${this.getSelectedWalletAddress()}

- Available balance:
+ ${translate("walletpage.wchange19")}:
${this.balanceString}

@@ -1014,7 +1020,7 @@ class MultiWallet extends LitElement { required @input="${(e) => { this._checkAmount(e) }}" id="ltcAmountInput" - label="Amount (LTC)" + label="${translate("walletpage.wchange11")} (LTC)" type="number" auto-validate="false" value="${this.ltcAmount}" @@ -1026,14 +1032,14 @@ class MultiWallet extends LitElement { style="width: 100%;" required id="ltcRecipient" - label="To (address)" + label="${translate("walletpage.wchange23")}" type="text" value="${this.ltcRecipient}" >

-

Current fee per byte: ${(this.ltcFeePerByte / 1e8).toFixed(8)} LTC
Low fees may result in slow or unconfirmed transactions.

+

${translate("walletpage.wchange24")}: ${(this.ltcFeePerByte / 1e8).toFixed(8)} LTC
${translate("walletpage.wchange25")}

this.sendLtc()}> - Send LTC + ${translate("walletpage.wchange17")} LTC
@@ -1063,7 +1069,7 @@ class MultiWallet extends LitElement { dialogAction="cancel" class="red" > - Close + ${translate("general.close")} @@ -1071,15 +1077,15 @@ class MultiWallet extends LitElement {
-

Send DOGE

+

${translate("walletpage.wchange17")} DOGE


- From address:
+ ${translate("walletpage.wchange18")}:
${this.getSelectedWalletAddress()}

- Available balance:
+ ${translate("walletpage.wchange19")}:
${this.balanceString}

@@ -1088,7 +1094,7 @@ class MultiWallet extends LitElement { required @input="${(e) => { this._checkAmount(e) }}" id="dogeAmountInput" - label="Amount (DOGE)" + label="${translate("walletpage.wchange11")} (DOGE)" type="number" auto-validate="false" value="${this.dogeAmount}" @@ -1100,7 +1106,7 @@ class MultiWallet extends LitElement { style="width: 100%;" required id="dogeRecipient" - label="To (address)" + label="${translate("walletpage.wchange23")}" type="text" value="${this.dogeRecipient}" > @@ -1108,7 +1114,7 @@ class MultiWallet extends LitElement {

- Current fee per byte: ${(this.dogeFeePerByte / 1e8).toFixed(8)} DOGE
Low fees may result in slow or unconfirmed transactions. + ${translate("walletpage.wchange24")}: ${(this.dogeFeePerByte / 1e8).toFixed(8)} DOGE
L${translate("walletpage.wchange25")}

this.sendDoge()}> - Send DOGE + ${translate("walletpage.wchange17")} DOGE
@@ -1139,7 +1145,7 @@ class MultiWallet extends LitElement { dialogAction="cancel" class="red" > - Close + ${translate("general.close")}
@@ -1154,6 +1160,12 @@ class MultiWallet extends LitElement { this.changeTheme(); }, 100) + this.changeLanguage() + + setInterval(() => { + this.changeLanguage() + }, 100) + setInterval(() => { this.errorMessage = ''; }, 5000) @@ -1374,6 +1386,42 @@ class MultiWallet extends LitElement { }) } + renderFetchText() { + return html`${translate("walletpage.wchange1")}` + } + + renderFundsText() { + return html`${translate("walletpage.wchange26")}` + } + + renderInvalidText() { + return html`${translate("walletpage.wchange27")}` + } + + renderEmptyText() { + return html`${translate("walletpage.wchange28")}` + } + + renderReceiverText() { + return html`${translate("walletpage.wchange29")}` + } + + renderSuccessText() { + return html`${translate("walletpage.wchange30")}` + } + + renderFailText() { + return html`${translate("walletpage.wchange31")}` + } + + renderOutText() { + return html`${translate("walletpage.wchange7")}` + } + + renderInText() { + return html`${translate("walletpage.wchange8")}` + } + selectWallet(event) { event.preventDefault() @@ -1401,7 +1449,7 @@ class MultiWallet extends LitElement { e.target.focus() e.target.invalid = true - e.target.validationMessage = 'Invalid Amount!' + e.target.validationMessage = this.renderInvalidText() } else { this.btnDisable = false } @@ -1412,7 +1460,7 @@ class MultiWallet extends LitElement { e.target.validityTransform = (newValue, nativeValidity) => { if (newValue.includes('-') === true) { this.btnDisable = true - target.validationMessage = 'Invalid Amount!' + target.validationMessage = this.renderInvalidText() return { valid: false, @@ -1422,7 +1470,7 @@ class MultiWallet extends LitElement { let myAmount = newValue.split('.') if (myAmount[1].length > 8) { this.btnDisable = true - target.validationMessage = 'Invalid Amount!' + target.validationMessage = this.renderInvalidText() } else { return { valid: true, @@ -1459,21 +1507,21 @@ class MultiWallet extends LitElement { if (parseFloat(amount) + parseFloat(0.001) > parseFloat(this.balance)) { this.sendMoneyLoading = false this.btnDisable = false - parentEpml.request('showSnackBar', 'Insufficient Funds!') + parentEpml.request('showSnackBar', this.renderFundsText()) return false } if (parseFloat(amount) <= 0) { this.sendMoneyLoading = false this.btnDisable = false - parentEpml.request('showSnackBar', 'Invalid Amount!') + parentEpml.request('showSnackBar', this.renderInvalidText()) return false } if (recipient.length === 0) { this.sendMoneyLoading = false this.btnDisable = false - parentEpml.request('showSnackBar', 'Receiver cannot be empty!') + parentEpml.request('showSnackBar', this.renderEmptyText()) return false } @@ -1525,8 +1573,8 @@ class MultiWallet extends LitElement { let myTransaction = await makeTransactionRequest(myNameAddress, lastRef) getTxnRequestResponse(myTransaction) } else { - console.error('INVALID_RECEIVER') - this.errorMessage = 'INVALID_RECEIVER' + console.error(this.renderReceiverText()) + this.errorMessage = this.renderReceiverText() this.sendMoneyLoading = false this.btnDisable = false } @@ -1562,7 +1610,7 @@ class MultiWallet extends LitElement { this.errorMessage = '' this.recipient = '' this.amount = 0 - this.successMessage = 'Transaction Successful!' + this.successMessage = this.renderReceiverText() this.sendMoneyLoading = false this.btnDisable = false } else { @@ -1602,11 +1650,11 @@ class MultiWallet extends LitElement { this.errorMessage = '' this.btcRecipient = '' this.btcAmount = 0 - this.successMessage = 'Transaction Successful!' + this.successMessage = this.renderSuccessText() this.sendMoneyLoading = false this.btnDisable = false } else if (response === false) { - this.errorMessage = 'Transaction Failed!' + this.errorMessage = this.renderFailText() this.sendMoneyLoading = false this.btnDisable = false throw new Error(txnResponse) @@ -1648,11 +1696,11 @@ class MultiWallet extends LitElement { this.errorMessage = '' this.ltcRecipient = '' this.ltcAmount = 0 - this.successMessage = 'Transaction Successful!' + this.successMessage = this.renderSuccessText() this.sendMoneyLoading = false this.btnDisable = false } else if (response === false) { - this.errorMessage = 'Transaction Failed!' + this.errorMessage = this.renderFailText() this.sendMoneyLoading = false this.btnDisable = false throw new Error(txnResponse) @@ -1694,11 +1742,11 @@ class MultiWallet extends LitElement { this.errorMessage = '' this.dogeRecipient = '' this.dogeAmount = 0 - this.successMessage = 'Transaction Successful!' + this.successMessage = this.renderSuccessText() this.sendMoneyLoading = false this.btnDisable = false } else if (response === false) { - this.errorMessage = 'Transaction Failed!' + this.errorMessage = this.renderFailText() this.sendMoneyLoading = false this.btnDisable = false throw new Error(txnResponse) @@ -1736,7 +1784,7 @@ class MultiWallet extends LitElement { } async fetchWalletDetails(coin) { - this.balanceString = "Fetching balance ..." + this.balanceString = this.renderFetchText() switch (coin) { case 'qort': parentEpml.request('apiCall', { @@ -1744,7 +1792,7 @@ class MultiWallet extends LitElement { }) .then((res) => { if (isNaN(Number(res))) { - parentEpml.request('showSnackBar', `Failed to Fetch QORT Balance. Try again!`) + parentEpml.request('showSnackBar', `${translate("walletpage.wchange32")}`) } else { if (this._selectedWallet == coin) { this.wallets.get(coin).balance = Number(res).toFixed(8) @@ -1771,7 +1819,7 @@ class MultiWallet extends LitElement { }) .then((res) => { if (isNaN(Number(res))) { - parentEpml.request('showSnackBar', `Failed to Fetch ${coin.toLocaleUpperCase()} Balance. Try again!`) + parentEpml.request('showSnackBar', `${translate("walletpage.wchange33")} ${coin.toLocaleUpperCase()} ${translate("walletpage.wchange34")}!`) } else { if (this._selectedWallet == coin) { this.wallets.get(this._selectedWallet).balance = (Number(res) / 1e8).toFixed(8) @@ -1804,13 +1852,13 @@ class MultiWallet extends LitElement { renderSendButton() { if ( this._selectedWallet === "qort" ) { - return html` this.openSendQort()}> Send QORT` + return html` this.openSendQort()}> ${translate("walletpage.wchange17")} QORT` } else if ( this._selectedWallet === "btc" ) { - return html` this.openSendBtc()}> Send BTC` + return html` this.openSendBtc()}> ${translate("walletpage.wchange17")} BTC` } else if ( this._selectedWallet === "ltc" ) { - return html` this.openSendLtc()}> Send LTC` + return html` this.openSendLtc()}> ${translate("walletpage.wchange17")} LTC` } else if ( this._selectedWallet === "doge" ) { - return html` this.openSendDoge()}> Send DOGE` + return html` this.openSendDoge()}> ${translate("walletpage.wchange17")} DOGE` } else { return html`` } @@ -1842,6 +1890,17 @@ class MultiWallet extends LitElement { document.querySelector('html').setAttribute('theme', this.theme); } + changeLanguage() { + const checkLanguage = localStorage.getItem('qortalLanguage') + + if (checkLanguage === null || checkLanguage.length === 0) { + localStorage.setItem('qortalLanguage', 'us') + use('us') + } else { + use(checkLanguage) + } + } + getSelectedWalletAddress() { return this._selectedWallet === 'qort' ? this.wallets.get(this._selectedWallet).wallet.address @@ -1915,20 +1974,20 @@ class MultiWallet extends LitElement { } return html` -
Address has no transactions yet.
+
${translate("walletpage.wchange38")}
{ if (!currentBlockHeight) { return render(html``, root) } const confirmed = data.item.confirmations >= requiredConfirmations if (confirmed) { - render(html`check`, root) + render(html`check`, root) } else { - render(html`schedule`, root) + render(html`schedule`, root) } }} > @@ -1936,20 +1995,20 @@ class MultiWallet extends LitElement { { - render(html` ${data.item.type} ${data.item.creatorAddress === this.wallets.get('qort').wallet.address ? html`OUT` : html`IN`} `, root) + render(html` ${data.item.type} ${data.item.creatorAddress === this.wallets.get('qort').wallet.address ? html`${translate("walletpage.wchange7")}` : html`${translate("walletpage.wchange8")}`} `, root) }} > - - - - + + + + { const time = new Date(data.item.timestamp) render(html` `, root) @@ -1963,11 +2022,11 @@ class MultiWallet extends LitElement { renderBtcTransactions(transactions, coin) { return html` -
Address has no transactions yet.
+
${translate("walletpage.wchange38")}
{ render(html`check`, root) }} @@ -1976,16 +2035,16 @@ class MultiWallet extends LitElement { { - render(html` PAYMENT ${data.item.inputs[0].address === this.wallets.get(this._selectedWallet).wallet.address ? html`OUT` : html`IN`} `, root) + render(html` ${translate("walletpage.wchange40")} ${data.item.inputs[0].address === this.wallets.get(this._selectedWallet).wallet.address ? html`${translate("walletpage.wchange7")}` : html`${translate("walletpage.wchange8")}`} `, root) }} > { render(html`${data.item.inputs[0].address}`, root) }} @@ -1994,17 +2053,17 @@ class MultiWallet extends LitElement { { render(html`${data.item.outputs[0].address}`, root) }} > - + { const amount = (Number(data.item.totalAmount) / 1e8).toFixed(8) render(html`${amount}`, root) @@ -2014,7 +2073,7 @@ class MultiWallet extends LitElement { { const time = new Date(data.item.timestamp * 1000) render(html` `, root) @@ -2028,11 +2087,11 @@ class MultiWallet extends LitElement { renderLtcTransactions(transactions, coin) { return html` -
Address has no transactions yet.
+
${translate("walletpage.wchange38")}
{ render(html`check`, root) }} @@ -2041,16 +2100,16 @@ class MultiWallet extends LitElement { { - render(html` PAYMENT ${data.item.inputs[0].address === this.wallets.get(this._selectedWallet).wallet.address ? html`OUT` : html`IN`} `, root) + render(html` ${translate("walletpage.wchange40")} ${data.item.inputs[0].address === this.wallets.get(this._selectedWallet).wallet.address ? html`${translate("walletpage.wchange7")}` : html`${translate("walletpage.wchange8")}`} `, root) }} > { render(html`${data.item.inputs[0].address}`, root) }} @@ -2059,17 +2118,17 @@ class MultiWallet extends LitElement { { render(html`${data.item.outputs[0].address}`, root) }} > - + { const amount = (Number(data.item.totalAmount) / 1e8).toFixed(8) render(html`${amount}`, root) @@ -2079,7 +2138,7 @@ class MultiWallet extends LitElement { { const time = new Date(data.item.timestamp * 1000) render(html` `, root) @@ -2093,11 +2152,11 @@ class MultiWallet extends LitElement { renderDogeTransactions(transactions, coin) { return html` -
Address has no transactions yet.
+
${translate("walletpage.wchange38")}
{ render(html`check`, root) }} @@ -2106,16 +2165,16 @@ class MultiWallet extends LitElement { { - render(html` PAYMENT ${data.item.inputs[0].address === this.wallets.get(this._selectedWallet).wallet.address ? html`OUT` : html`IN`} `, root) + render(html` ${translate("walletpage.wchange40")} ${data.item.inputs[0].address === this.wallets.get(this._selectedWallet).wallet.address ? html`${translate("walletpage.wchange7")}` : html`${translate("walletpage.wchange8")}`} `, root) }} > { render(html`${data.item.inputs[0].address}`, root) }} @@ -2124,17 +2183,17 @@ class MultiWallet extends LitElement { { render(html`${data.item.outputs[0].address}`, root) }} > - + { const amount = (Number(data.item.totalAmount) / 1e8).toFixed(8) render(html`${amount}`, root) @@ -2144,7 +2203,7 @@ class MultiWallet extends LitElement { { const time = new Date(data.item.timestamp * 1000) render(html` `, root)