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`
- 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 {@@ -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")}
- 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")}
- 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")}