diff --git a/qortal-ui-core/language/cn.json b/qortal-ui-core/language/cn.json index 005b7d19..f92967ad 100644 --- a/qortal-ui-core/language/cn.json +++ b/qortal-ui-core/language/cn.json @@ -544,5 +544,14 @@ "tchange3": "Confirm", "tchange4": "To", "tchange5": "Amount" + }, + "apipage": { + "achange1": "Add API key", + "achange2": "API key", + "achange3": "Please enter the API key for this node. It can be found in a file called “apikey.txt“ in the directory where the core is installed. Alternatively, click Cancel to use the core with reduced functionality.", + "achange4": "Cancel", + "achange5": "Add", + "achange6": "Successfully added API Key", + "achange7": "API key wrong, no API key added" } } \ No newline at end of file diff --git a/qortal-ui-core/language/de.json b/qortal-ui-core/language/de.json index 371fc389..268038e9 100644 --- a/qortal-ui-core/language/de.json +++ b/qortal-ui-core/language/de.json @@ -544,5 +544,14 @@ "tchange3": "Bestätigen", "tchange4": "Zu", "tchange5": "Menge" + }, + "apipage": { + "achange1": "Füge API-Schlüssel hinzu", + "achange2": "API-Schlüssel", + "achange3": "Bitte geben Sie den API-Schlüssel für diesen Knoten ein. Es kann in einer Datei namens “apikey.txt“ in dem Verzeichnis gefunden werden, in dem der Kern installiert ist. Klicken Sie alternativ auf Abbrechen, um den Kern mit eingeschränkter Funktionalität zu verwenden.", + "achange4": "Abbrechen", + "achange5": "Hinzufügen", + "achange6": "API-Schlüssel erfolgreich hinzugefügt", + "achange7": "API-Schlüssel falsch, kein API-Schlüssel hinzugefügt" } } \ No newline at end of file diff --git a/qortal-ui-core/language/fr.json b/qortal-ui-core/language/fr.json index 005b7d19..f92967ad 100644 --- a/qortal-ui-core/language/fr.json +++ b/qortal-ui-core/language/fr.json @@ -544,5 +544,14 @@ "tchange3": "Confirm", "tchange4": "To", "tchange5": "Amount" + }, + "apipage": { + "achange1": "Add API key", + "achange2": "API key", + "achange3": "Please enter the API key for this node. It can be found in a file called “apikey.txt“ in the directory where the core is installed. Alternatively, click Cancel to use the core with reduced functionality.", + "achange4": "Cancel", + "achange5": "Add", + "achange6": "Successfully added API Key", + "achange7": "API key wrong, no API key added" } } \ No newline at end of file diff --git a/qortal-ui-core/language/pl.json b/qortal-ui-core/language/pl.json index 005b7d19..f92967ad 100644 --- a/qortal-ui-core/language/pl.json +++ b/qortal-ui-core/language/pl.json @@ -544,5 +544,14 @@ "tchange3": "Confirm", "tchange4": "To", "tchange5": "Amount" + }, + "apipage": { + "achange1": "Add API key", + "achange2": "API key", + "achange3": "Please enter the API key for this node. It can be found in a file called “apikey.txt“ in the directory where the core is installed. Alternatively, click Cancel to use the core with reduced functionality.", + "achange4": "Cancel", + "achange5": "Add", + "achange6": "Successfully added API Key", + "achange7": "API key wrong, no API key added" } } \ No newline at end of file diff --git a/qortal-ui-core/language/sp.json b/qortal-ui-core/language/sp.json index 005b7d19..f92967ad 100644 --- a/qortal-ui-core/language/sp.json +++ b/qortal-ui-core/language/sp.json @@ -544,5 +544,14 @@ "tchange3": "Confirm", "tchange4": "To", "tchange5": "Amount" + }, + "apipage": { + "achange1": "Add API key", + "achange2": "API key", + "achange3": "Please enter the API key for this node. It can be found in a file called “apikey.txt“ in the directory where the core is installed. Alternatively, click Cancel to use the core with reduced functionality.", + "achange4": "Cancel", + "achange5": "Add", + "achange6": "Successfully added API Key", + "achange7": "API key wrong, no API key added" } } \ No newline at end of file diff --git a/qortal-ui-core/language/us.json b/qortal-ui-core/language/us.json index 005b7d19..f92967ad 100644 --- a/qortal-ui-core/language/us.json +++ b/qortal-ui-core/language/us.json @@ -544,5 +544,14 @@ "tchange3": "Confirm", "tchange4": "To", "tchange5": "Amount" + }, + "apipage": { + "achange1": "Add API key", + "achange2": "API key", + "achange3": "Please enter the API key for this node. It can be found in a file called “apikey.txt“ in the directory where the core is installed. Alternatively, click Cancel to use the core with reduced functionality.", + "achange4": "Cancel", + "achange5": "Add", + "achange6": "Successfully added API Key", + "achange7": "API key wrong, no API key added" } } \ No newline at end of file diff --git a/qortal-ui-core/src/functional-components/mykey-page.js b/qortal-ui-core/src/functional-components/mykey-page.js index 4c422891..b2291b94 100644 --- a/qortal-ui-core/src/functional-components/mykey-page.js +++ b/qortal-ui-core/src/functional-components/mykey-page.js @@ -2,6 +2,7 @@ import { LitElement, html, css } from 'lit' import { connect } from 'pwa-helpers' import { store } from '../store.js' import { testApiKey } from '../apiKeyUtils.js' +import { get, translate, translateUnsafeHTML } from 'lit-translate' import '@material/mwc-dialog' import '@material/mwc-button' @@ -23,6 +24,23 @@ class MykeyPage extends connect(store)(LitElement) { static get styles() { return css` + * { + --mdc-theme-primary: rgb(3, 169, 244); + --mdc-theme-secondary: var(--mdc-theme-primary); + --paper-input-container-focus-color: var(--mdc-theme-primary); + --mdc-theme-surface: var(--white); + --mdc-dialog-heading-ink-color: var(--black); + --mdc-dialog-content-ink-color: var(--black); + --lumo-primary-text-color: rgb(0, 167, 245); + --lumo-primary-color-50pct: rgba(0, 167, 245, 0.5); + --lumo-primary-color-10pct: rgba(0, 167, 245, 0.1); + --lumo-primary-color: hsl(199, 100%, 48%); + --lumo-base-color: var(--white); + --lumo-body-text-color: var(--black); + --_lumo-grid-border-color: var(--border); + --_lumo-grid-secondary-border-color: var(--border2); + } + .red { --mdc-theme-primary: red; } @@ -37,23 +55,23 @@ class MykeyPage extends connect(store)(LitElement) { render() { return html` - +
- -

Please enter the API key for this node. It can be found in a file called "apikey.txt" in the directory where the core is installed. Alternatively, click Cancel to use the core with reduced functionality.

+ +

${translate("apipage.achange3")}

- Cancel + ${translate("apipage.achange4")} - Add + ${translate("apipage.achange5")}
` @@ -77,15 +95,17 @@ class MykeyPage extends connect(store)(LitElement) { selectedNode.apiKey = mykeyInput; this.nodeConfig.knownNodes[this.nodeConfig.node] = selectedNode; localStorage.setItem('myQortalNodes', JSON.stringify(this.nodeConfig.knownNodes)); + let snackbar1 = get("apipage.achange6") snackbar.add({ - labelText: 'Successfully Added API Key', + labelText: `${snackbar1}`, dismiss: true }) this.shadowRoot.getElementById('mykeyInput').value = '' this.shadowRoot.querySelector('#mykeyDialog').close() } else { + let snackbar2 = get("apipage.achange7") snackbar.add({ - labelText: 'API Key Wrong, No Apikey Added', + labelText: `${snackbar2}`, dismiss: true }) this.shadowRoot.getElementById('mykeyInput').value = '' 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 3323d664..608f2786 100644 --- a/qortal-ui-plugins/plugins/core/wallet/wallet-app.src.js +++ b/qortal-ui-plugins/plugins/core/wallet/wallet-app.src.js @@ -1395,18 +1395,10 @@ class MultiWallet extends LitElement { 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")}` } @@ -1512,21 +1504,24 @@ class MultiWallet extends LitElement { if (parseFloat(amount) + parseFloat(0.001) > parseFloat(this.balance)) { this.sendMoneyLoading = false this.btnDisable = false - parentEpml.request('showSnackBar', this.renderFundsText()) + let snack1string = get("walletpage.wchange26") + parentEpml.request('showSnackBar', `${snack1string}`) return false } if (parseFloat(amount) <= 0) { this.sendMoneyLoading = false this.btnDisable = false - parentEpml.request('showSnackBar', this.renderInvalidText()) + let snack2string = get("walletpage.wchange27") + parentEpml.request('showSnackBar', `${snack2string}`) return false } if (recipient.length === 0) { this.sendMoneyLoading = false this.btnDisable = false - parentEpml.request('showSnackBar', this.renderEmptyText()) + let snack3string = get("walletpage.wchange28") + parentEpml.request('showSnackBar', `${snack3string}`) return false } @@ -1797,7 +1792,8 @@ class MultiWallet extends LitElement { }) .then((res) => { if (isNaN(Number(res))) { - parentEpml.request('showSnackBar', `${translate("walletpage.wchange32")}`) + let snack4string = get("walletpage.wchange32") + parentEpml.request('showSnackBar', `${snack4string}`) } else { if (this._selectedWallet == coin) { this.wallets.get(coin).balance = Number(res).toFixed(8) @@ -1824,7 +1820,9 @@ class MultiWallet extends LitElement { }) .then((res) => { if (isNaN(Number(res))) { - parentEpml.request('showSnackBar', `${translate("walletpage.wchange33")} ${coin.toLocaleUpperCase()} ${translate("walletpage.wchange34")}!`) + let snack5string = get("walletpage.wchange33") + let snack6string = get("walletpage.wchange34") + parentEpml.request('showSnackBar', `${snack5string} ${coin.toLocaleUpperCase()} ${snack6string}!`) } else { if (this._selectedWallet == coin) { this.wallets.get(this._selectedWallet).balance = (Number(res) / 1e8).toFixed(8)