From f9f2911c761af1c8ed1c323dcd414cbaa9eeae7c Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 13 Sep 2022 11:07:39 -0300 Subject: adding missing i18n --- .../src/components/BankDetailsByPaytoType.tsx | 8 +- .../src/components/Banner.tsx | 15 +- .../src/components/PendingTransactions.tsx | 4 +- .../src/components/ShowFullContractTermPopup.tsx | 101 ++++++++--- .../src/cta/InvoiceCreate/views.tsx | 10 +- .../src/cta/InvoicePay/views.tsx | 11 +- .../src/cta/TransferCreate/views.tsx | 6 +- .../src/popup/NoBalanceHelp.tsx | 5 +- .../src/popup/TalerActionFound.tsx | 8 +- .../src/wallet/DepositPage.tsx | 1 - .../src/wallet/DestinationSelection.tsx | 62 +++++-- .../src/wallet/ExchangeSelection/views.tsx | 184 +++++++++++++++------ .../src/wallet/History.tsx | 4 +- .../src/wallet/QrReader.tsx | 17 +- .../src/wallet/Settings.tsx | 6 +- .../src/wallet/Transaction.tsx | 162 ++++++++++++------ 16 files changed, 427 insertions(+), 177 deletions(-) diff --git a/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx b/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx index 609c82e10..3a15cf1fb 100644 --- a/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx +++ b/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx @@ -54,7 +54,9 @@ export function BankDetailsByPaytoType({ borderRadius: 4, }} > -

Bitcoin transfer details

+

+ Bitcoin transfer details +

The exchange need a transaction with 3 output, one output is the @@ -140,7 +142,9 @@ export function BankDetailsByPaytoType({ borderRadius: 4, }} > -

Bank transfer details

+

+ Bank transfer details +

{accountPart} { - title?: string; + titleHead?: VNode; elements: { icon?: VNode; description: VNode; @@ -34,15 +34,18 @@ interface Props extends JSX.HTMLAttributes { }; } -export function Banner({ title, elements, confirm, ...rest }: Props): VNode { +export function Banner({ + titleHead, + elements, + confirm, + ...rest +}: Props): VNode { return ( - {title && ( + {titleHead && ( - - {title} - + {titleHead} )} diff --git a/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx b/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx index 05995395b..e9688da21 100644 --- a/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx +++ b/packages/taler-wallet-webextension/src/components/PendingTransactions.tsx @@ -21,6 +21,7 @@ import { } from "@gnu-taler/taler-util"; import { Fragment, h, JSX, VNode } from "preact"; import { useEffect } from "preact/hooks"; +import { useTranslationContext } from "../context/translation.js"; import { useAsyncAsHook } from "../hooks/useAsyncAsHook.js"; import { Avatar } from "../mui/Avatar.js"; import { Typography } from "../mui/Typography.js"; @@ -67,9 +68,10 @@ export function PendingTransactionsView({ goToTransaction: (id: string) => Promise; transactions: Transaction[]; }): VNode { + const { i18n } = useTranslationContext(); return ( PENDING OPERATIONS} style={{ backgroundColor: "lightcyan", maxHeight: 150, diff --git a/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.tsx b/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.tsx index b7d8376bd..7c1d2c6fc 100644 --- a/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.tsx +++ b/packages/taler-wallet-webextension/src/components/ShowFullContractTermPopup.tsx @@ -172,39 +172,54 @@ export function HiddenView({ showHandler }: States.Hidden): VNode { export function ShowView({ contractTerms, hideHandler }: States.Show): VNode { const createdAt = AbsoluteTime.fromTimestamp(contractTerms.timestamp); + const { i18n } = useTranslationContext(); return (
- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + {/* @@ -327,19 +366,25 @@ export function ShowView({ contractTerms, hideHandler }: States.Show): VNode { */} - + - + - + {/* @@ -349,11 +394,15 @@ export function ShowView({ contractTerms, hideHandler }: States.Show): VNode { */} - + - + - + - - - + + + -

Withdrawals

+

+ Withdrawals +

- - - + + + -

Refunds

+

+ Refunds +

- - - + + + {" "} -

Refresh

+

+ Refresh +

- - - + + + @@ -246,8 +290,12 @@ export function ComparingView({
Order Id + Order Id + {contractTerms.orderId}
Summary + Summary + {contractTerms.summary}
Amount + Amount +
Merchant name + Merchant name + {contractTerms.merchant.name}
Merchant jurisdiction + Merchant jurisdiction + {locationAsText(contractTerms.merchant.jurisdiction)}
Merchant address + Merchant address + {locationAsText(contractTerms.merchant.address)}
Merchant logo + Merchant logo +
Merchant website + Merchant website + {contractTerms.merchant.website}
Merchant email + Merchant email + {contractTerms.merchant.email}
Merchant public key + Merchant public key + {contractTerms.merchantPub.substring(0, 6)}... @@ -231,7 +252,9 @@ export function ShowView({ contractTerms, hideHandler }: States.Show): VNode {
Delivery date + Delivery date + {contractTerms.deliveryDate && (
Delivery location + Delivery location + {locationAsText(contractTerms.deliveryLocation)}
Products + Products + {!contractTerms.products || contractTerms.products.length === 0 ? "none" @@ -258,7 +285,9 @@ export function ShowView({ contractTerms, hideHandler }: States.Show): VNode {
Created at + Created at + {contractTerms.timestamp && (
Refund deadline + Refund deadline + {
Auto refund + Auto refund + {
Pay deadline + Pay deadline + {
Fulfillment URL + Fulfillment URL + {contractTerms.fulfillmentUrl}
Fulfillment message + Fulfillment message + {contractTerms.fulfillmentMessage}
{contractTerms.public_reorder_url}
Max deposit fee + Max deposit fee +
Max fee + Max fee +
Minimum age + Minimum age + {contractTerms.minimumAge}
Wire fee amortization + Wire fee amortization + {contractTerms.wireFeeAmortization}
Auditors + Auditors + {(contractTerms.allowedAuditors || []).map((e) => ( @@ -366,7 +415,9 @@ export function ShowView({ contractTerms, hideHandler }: States.Show): VNode {
Exchanges + Exchanges + {(contractTerms.allowedExchanges || []).map((e) => ( diff --git a/packages/taler-wallet-webextension/src/cta/InvoiceCreate/views.tsx b/packages/taler-wallet-webextension/src/cta/InvoiceCreate/views.tsx index 18e593283..c5ed9a4cf 100644 --- a/packages/taler-wallet-webextension/src/cta/InvoiceCreate/views.tsx +++ b/packages/taler-wallet-webextension/src/cta/InvoiceCreate/views.tsx @@ -58,12 +58,16 @@ export function CreatedView({ Digital cash invoice
-

Show this QR to pay the invoice

+

+ Show this QR to pay the invoice +

or - +
@@ -155,7 +159,7 @@ export function ReadyView({ variant="contained" color="success" > - Create + Create
diff --git a/packages/taler-wallet-webextension/src/cta/InvoicePay/views.tsx b/packages/taler-wallet-webextension/src/cta/InvoicePay/views.tsx index 21b666abd..8484680bf 100644 --- a/packages/taler-wallet-webextension/src/cta/InvoicePay/views.tsx +++ b/packages/taler-wallet-webextension/src/cta/InvoicePay/views.tsx @@ -14,23 +14,16 @@ GNU Taler; see the file COPYING. If not, see */ -import { Amounts, PreparePayResultType } from "@gnu-taler/taler-util"; import { Fragment, h, VNode } from "preact"; import { Amount } from "../../components/Amount.js"; import { ErrorTalerOperation } from "../../components/ErrorTalerOperation.js"; import { LoadingError } from "../../components/LoadingError.js"; import { LogoHeader } from "../../components/LogoHeader.js"; import { Part } from "../../components/Part.js"; -import { - Link, - SubTitle, - WalletAction, - WarningBox, -} from "../../components/styled/index.js"; +import { Link, SubTitle, WalletAction } from "../../components/styled/index.js"; import { Time } from "../../components/Time.js"; import { useTranslationContext } from "../../context/translation.js"; -import { Button } from "../../mui/Button.js"; -import { ButtonsSection, PayWithMobile } from "../Payment/views.js"; +import { ButtonsSection } from "../Payment/views.js"; import { State } from "./index.js"; export function LoadingUriView({ error }: State.LoadingUriError): VNode { diff --git a/packages/taler-wallet-webextension/src/cta/TransferCreate/views.tsx b/packages/taler-wallet-webextension/src/cta/TransferCreate/views.tsx index 51121d4ca..433980621 100644 --- a/packages/taler-wallet-webextension/src/cta/TransferCreate/views.tsx +++ b/packages/taler-wallet-webextension/src/cta/TransferCreate/views.tsx @@ -116,14 +116,16 @@ export function ReadyView({ />
-

How do you want to transfer?

+

+ How do you want to transfer? +

diff --git a/packages/taler-wallet-webextension/src/popup/NoBalanceHelp.tsx b/packages/taler-wallet-webextension/src/popup/NoBalanceHelp.tsx index 161296b97..7d2e15726 100644 --- a/packages/taler-wallet-webextension/src/popup/NoBalanceHelp.tsx +++ b/packages/taler-wallet-webextension/src/popup/NoBalanceHelp.tsx @@ -15,11 +15,11 @@ */ import { css } from "@linaria/core"; import { Fragment, h, VNode } from "preact"; +import { useTranslationContext } from "../context/translation.js"; import { Alert } from "../mui/Alert.js"; import { Button } from "../mui/Button.js"; import { ButtonHandler } from "../mui/handlers.js"; import { Paper } from "../mui/Paper.js"; -import { Typography } from "../mui/Typography.js"; const margin = css` margin: 1em; @@ -30,6 +30,7 @@ export function NoBalanceHelp({ }: { goToWalletManualWithdraw: ButtonHandler; }): VNode { + const { i18n } = useTranslationContext(); return ( @@ -39,7 +40,7 @@ export function NoBalanceHelp({ variant="outlined" onClick={goToWalletManualWithdraw.onClick} > - Get digital cash + Get digital cash diff --git a/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx b/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx index 097ed529d..3eccad93e 100644 --- a/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx +++ b/packages/taler-wallet-webextension/src/popup/TalerActionFound.tsx @@ -21,14 +21,10 @@ import { classifyTalerUri, TalerUriType } from "@gnu-taler/taler-util"; import { Fragment, h, VNode } from "preact"; -import { platform } from "../platform/api.js"; -import { - ButtonPrimary, - ButtonSuccess, - Title, -} from "../components/styled/index.js"; +import { Title } from "../components/styled/index.js"; import { useTranslationContext } from "../context/translation.js"; import { Button } from "../mui/Button.js"; +import { platform } from "../platform/api.js"; export interface Props { url: string; diff --git a/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx b/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx index d67fa413a..0cd375b7c 100644 --- a/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/DepositPage.tsx @@ -18,7 +18,6 @@ import { AmountJson, Amounts, PaytoUri } from "@gnu-taler/taler-util"; import { DepositGroupFees } from "@gnu-taler/taler-wallet-core/src/operations/deposits"; import { Fragment, h, VNode } from "preact"; import { useState } from "preact/hooks"; -import { Amount } from "../components/Amount.js"; import { Loading } from "../components/Loading.js"; import { LoadingError } from "../components/LoadingError.js"; import { SelectList } from "../components/SelectList.js"; diff --git a/packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx b/packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx index fa1a606f7..3143aafa1 100644 --- a/packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx +++ b/packages/taler-wallet-webextension/src/wallet/DestinationSelection.tsx @@ -329,14 +329,16 @@ export function DestinationSelectionGetCash({ }} /> {previous.length > 0 ? ( -

Use previous origins:

+

+ Use previous origins: +

@@ -354,35 +356,45 @@ export function DestinationSelectionGetCash({ ) : undefined} {previous.length > 0 ? ( -

Or specify a new origin for the money

+

+ + Or specify the origin of the money + +

) : ( -

Specify a origin for the money

+

+ Specify the origin of the money +

)} -

From my bank account

+

+ From my bank account +

-

From another wallet

+

+ From another wallet +

@@ -428,7 +440,11 @@ export function DestinationSelectionSendCash({ const previous = previous1; if (!currency) { - return
currency not provided
; + return ( +
+ currency not provided +
+ ); } const currencyAndAmount = `${currency}:${amount}`; const parsedAmount = Amounts.parse(currencyAndAmount); @@ -459,7 +475,9 @@ export function DestinationSelectionSendCash({ {previous.length > 0 ? ( -

Use previous destinations:

+

+ Use previous destinations: +

@@ -477,33 +495,45 @@ export function DestinationSelectionSendCash({ ) : undefined} {previous.length > 0 ? ( -

Or specify a new destination for the money

+

+ + Or specify the destination of the money + +

) : ( -

Specify a destination for the money

+

+ + Specify the destination of the money + +

)} -

To my bank account

+

+ To my bank account +

-

To another wallet

+

+ To another wallet +

diff --git a/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/views.tsx b/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/views.tsx index a6bd2e7dc..4cd90700f 100644 --- a/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/views.tsx +++ b/packages/taler-wallet-webextension/src/wallet/ExchangeSelection/views.tsx @@ -114,7 +114,11 @@ export function LoadingUriView({ error }: State.LoadingUriError): VNode { export function NoExchangesView(state: State.NoExchanges): VNode { const { i18n } = useTranslationContext(); - return
no exchanges
; + return ( +
+ no exchanges +
+ ); } export function ComparingView({ @@ -157,19 +161,23 @@ export function ComparingView({

-
Auditors
+
+ Auditors +
{selected.auditors.length === 0 ? ( -
Doesn't have auditors
+
+ Doesn't have auditors +
) : ( selected.auditors.map((a) => {
{a.auditor_url}
; @@ -178,63 +186,99 @@ export function ComparingView({
- +
currency + currency + {selected.currency}
-

Operations

-

Deposits

+

+ Operations +

+

+ Deposits +

 DenominationFeeUntil + Denomination + + Fee + + Until +
 DenominationFeeUntil + Denomination + + Fee + + Until +
 DenominationFeeUntil + Denomination + + Fee + + Until +
 DenominationFeeUntil + Denomination + + Fee + + Until +
- - + + @@ -331,7 +379,7 @@ export function ReadyView({

@@ -339,7 +387,9 @@ export function ReadyView({
Auditors
{selected.auditors.length === 0 ? ( -
Doesn't have auditors
+
+ Doesn't have auditors +
) : ( selected.auditors.map((a) => {
{a.auditor_url}
; @@ -348,63 +398,99 @@ export function ReadyView({
Wallet operationsFee + Wallet operations + + Fee +
- +
currency + currency + {selected.currency}
-

Operations

-

Deposits

+

+ Operations +

+

+ Deposits +

  - Denomination - Fee - Until + + Denomination + + + Fee + + + Until + -

Withdrawals

+

+ Withdrawals +

  - Denomination - Fee - Until + + Denomination + + + Fee + + + Until + -

Refunds

+

+ Refunds +

  - Denomination - Fee - Until + + Denomination + + + Fee + + + Until + {" "} -

Refresh

+

+ Refresh +

  - Denomination - Fee - Until + + Denomination + + + Fee + + + Until + @@ -416,8 +502,12 @@ export function ReadyView({ - - + + diff --git a/packages/taler-wallet-webextension/src/wallet/History.tsx b/packages/taler-wallet-webextension/src/wallet/History.tsx index e885a216d..6a8362ddb 100644 --- a/packages/taler-wallet-webextension/src/wallet/History.tsx +++ b/packages/taler-wallet-webextension/src/wallet/History.tsx @@ -231,7 +231,9 @@ export function HistoryView({ {datesWithTransaction.length === 0 ? (
- There is no history for this currency + + Your transaction history is empty for this currency. +
) : (
diff --git a/packages/taler-wallet-webextension/src/wallet/QrReader.tsx b/packages/taler-wallet-webextension/src/wallet/QrReader.tsx index c574050e0..06897338d 100644 --- a/packages/taler-wallet-webextension/src/wallet/QrReader.tsx +++ b/packages/taler-wallet-webextension/src/wallet/QrReader.tsx @@ -19,6 +19,7 @@ import { styled } from "@linaria/react"; import { Fragment, h, VNode } from "preact"; import { Ref, useEffect, useRef, useState } from "preact/hooks"; import QrScanner from "qr-scanner"; +import { useTranslationContext } from "../context/translation.js"; import { Alert } from "../mui/Alert.js"; import { Button } from "../mui/Button.js"; import { TextField } from "../mui/TextField.js"; @@ -49,6 +50,7 @@ export function QrReaderPage({ onDetected }: Props): VNode { const qrScanner = useRef(null); const [value, onChange] = useState(""); const [active, setActive] = useState(false); + const { i18n } = useTranslationContext(); function start(): void { qrScanner.current!.start(); @@ -96,14 +98,17 @@ export function QrReaderPage({ onDetected }: Props): VNode { }, []); const isValid = check(value); - return ( {/* scanImage(imageRef, f)}> Read QR from file
*/} -

Scan a QR code or enter taler:// URI below

+

+ + Scan a QR code or enter taler:// URI below + +

{isValid && ( )} {!active && !isValid && ( - URI is not valid. Taler URI should start with `taler://` + + URI is not valid. Taler URI should start with `taler://` + )} diff --git a/packages/taler-wallet-webextension/src/wallet/Settings.tsx b/packages/taler-wallet-webextension/src/wallet/Settings.tsx index 5219bbb38..28ee229eb 100644 --- a/packages/taler-wallet-webextension/src/wallet/Settings.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Settings.tsx @@ -231,13 +231,15 @@ export function SettingsView({
- Troubleshooting + + Troubleshooting + Developer mode} name="devMode" description={ - (More options and information useful for debugging) + More options and information useful for debugging } enabled={developerMode} diff --git a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx index c1f5861e8..3d2a16e8f 100644 --- a/packages/taler-wallet-webextension/src/wallet/Transaction.tsx +++ b/packages/taler-wallet-webextension/src/wallet/Transaction.tsx @@ -385,21 +385,25 @@ export function TransactionView({ return (
); @@ -588,16 +592,24 @@ export function TransactionView({ return (
- - + +
); } return (
{text.substring(0, 64)}...
- - + +
); } @@ -612,7 +624,7 @@ export function TransactionView({ total={total} kind="positive" > - Invoice + Invoice {transaction.info.summary ? ( @@ -659,7 +671,7 @@ export function TransactionView({ total={total} kind="negative" > - Invoice + Invoice {transaction.info.summary ? ( @@ -698,7 +710,7 @@ export function TransactionView({ total={total} kind="negative" > - Transfer + Transfer {transaction.info.summary ? ( @@ -745,7 +757,7 @@ export function TransactionView({ total={total} kind="positive" > - Transfer + Transfer {transaction.info.summary ? ( @@ -922,7 +934,9 @@ function DeliveryDetails({ {date && ( - + - + @@ -973,7 +989,9 @@ export function InvoiceDetails({ amount }: { amount: AmountWithFee }): VNode { {Amounts.isNonZero(fee) && ( - + @@ -985,7 +1003,9 @@ export function InvoiceDetails({ amount }: { amount: AmountWithFee }): VNode { - + @@ -1006,7 +1026,9 @@ export function TransferDetails({ amount }: { amount: AmountWithFee }): VNode { return ( - + @@ -1014,7 +1036,9 @@ export function TransferDetails({ amount }: { amount: AmountWithFee }): VNode { {Amounts.isNonZero(fee) && ( - + @@ -1026,7 +1050,9 @@ export function TransferDetails({ amount }: { amount: AmountWithFee }): VNode { - + @@ -1047,7 +1073,9 @@ export function WithdrawDetails({ amount }: { amount: AmountWithFee }): VNode { return ( - + @@ -1055,7 +1083,9 @@ export function WithdrawDetails({ amount }: { amount: AmountWithFee }): VNode { {Amounts.isNonZero(fee) && ( - + @@ -1067,7 +1097,9 @@ export function WithdrawDetails({ amount }: { amount: AmountWithFee }): VNode { - + @@ -1113,7 +1145,9 @@ export function PurchaseDetails({ return ( - + @@ -1121,7 +1155,9 @@ export function PurchaseDetails({ {refund && Amounts.isNonZero(refund.raw) && ( - + @@ -1129,7 +1165,9 @@ export function PurchaseDetails({ )} {Amounts.isNonZero(fee) && ( - + @@ -1141,7 +1179,9 @@ export function PurchaseDetails({ - + @@ -1218,7 +1258,9 @@ function RefundDetails({ return ( - + @@ -1226,7 +1268,9 @@ function RefundDetails({ {Amounts.isNonZero(fee) && ( - + @@ -1238,7 +1282,9 @@ function RefundDetails({ - + @@ -1264,7 +1310,9 @@ function DepositDetails({ return ( - + @@ -1272,7 +1320,9 @@ function DepositDetails({ {Amounts.isNonZero(fee) && ( - + @@ -1284,7 +1334,9 @@ function DepositDetails({ - + @@ -1310,13 +1362,17 @@ function RefreshDetails({ return ( - + - + @@ -1327,7 +1383,9 @@ function RefreshDetails({ - + @@ -1350,7 +1408,9 @@ function TipDetails({ transaction }: { transaction: TransactionTip }): VNode { return ( - + @@ -1358,7 +1418,9 @@ function TipDetails({ transaction }: { transaction: TransactionTip }): VNode { {Amounts.isNonZero(fee) && ( - + @@ -1370,7 +1432,9 @@ function TipDetails({ transaction }: { transaction: TransactionTip }): VNode { - + -- cgit v1.2.3
Wallet operationsFee + Wallet operations + + Fee +
- {}{" "} - - was refunded - {" "} - on{" "} - { -
Date + Date +
Invoice + Invoice +
Transaction fees + Transaction fees +
Total + Total +
Transfer + Transfer +
Transaction fees + Transaction fees +
Total + Total +
Withdraw + Withdraw +
Transaction fees + Transaction fees +
Total + Total +
Price + Price +
Refunded + Refunded +
Transaction fees + Transaction fees +
Total + Total +
Amount + Amount +
Transaction fees + Transaction fees +
Total + Total +
Amount + Amount +
Transaction fees + Transaction fees +
Total transfer + Total transfer +
Amount + Amount +
Transaction fees + Transaction fees +
Total + Total +
Amount + Amount +
Transaction fees + Transaction fees +
Total + Total +