diff options
author | Sebastian <sebasjm@gmail.com> | 2021-06-08 16:01:41 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2021-06-08 17:18:24 -0300 |
commit | 1d55c551bb9e9322a822895c7ff9c9378bc43a92 (patch) | |
tree | 21e1928b26541f272efc5854f744a158b45c4641 /packages/taler-wallet-webextension/src/pages | |
parent | 2e1438eb048e48ec7aa71246878b1125c9e34694 (diff) | |
download | wallet-core-1d55c551bb9e9322a822895c7ff9c9378bc43a92.tar.xz |
moving strings from wallet-core to web-extension
Diffstat (limited to 'packages/taler-wallet-webextension/src/pages')
4 files changed, 24 insertions, 20 deletions
diff --git a/packages/taler-wallet-webextension/src/pages/pay.tsx b/packages/taler-wallet-webextension/src/pages/pay.tsx index fd8b0f3ae..e958cd484 100644 --- a/packages/taler-wallet-webextension/src/pages/pay.tsx +++ b/packages/taler-wallet-webextension/src/pages/pay.tsx @@ -22,14 +22,14 @@ /** * Imports. */ -import * as i18n from "../i18n"; +// import * as i18n from "../i18n"; import { renderAmount, ProgressButton } from "../renderHtml"; import * as wxApi from "../wxApi"; import { useState, useEffect } from "preact/hooks"; -import { getJsonI18n } from "@gnu-taler/taler-wallet-core"; +import { getJsonI18n, i18n } from "@gnu-taler/taler-util"; import { PreparePayResult, ConfirmPayResult, @@ -171,19 +171,19 @@ export function TalerPayDialog({ talerPayUri }: Props): JSX.Element { return ( <div> <p> - <i18n.Translate wrap="p"> + <i18n.Translate> The merchant <span>{merchantName}</span> offers you to purchase: </i18n.Translate> <div style={{ textAlign: "center" }}> <strong>{contractTerms.summary}</strong> </div> {totalFees ? ( - <i18n.Translate wrap="p"> + <i18n.Translate> The total price is <span>{amount} </span> (plus <span>{renderAmount(totalFees)}</span> fees). </i18n.Translate> ) : ( - <i18n.Translate wrap="p"> + <i18n.Translate> The total price is <span>{amount}</span>. </i18n.Translate> )} diff --git a/packages/taler-wallet-webextension/src/pages/popup.stories.tsx b/packages/taler-wallet-webextension/src/pages/popup.stories.tsx index 1aec771a2..0cb51a336 100644 --- a/packages/taler-wallet-webextension/src/pages/popup.stories.tsx +++ b/packages/taler-wallet-webextension/src/pages/popup.stories.tsx @@ -19,8 +19,13 @@ * @author Sebastian Javier Marchano (sebasjm) */ -import { PaymentStatus, TransactionPayment, TransactionType, TransactionWithdrawal, TransactionDeposit, TransactionRefresh, TransactionTip, TransactionRefund, WithdrawalType, TransactionCommon } from '@gnu-taler/taler-util'; -import { Fragment, h } from 'preact'; +import { + PaymentStatus, + TransactionCommon, TransactionDeposit, TransactionPayment, + TransactionRefresh, TransactionRefund, TransactionTip, TransactionType, + TransactionWithdrawal, + WithdrawalType +} from '@gnu-taler/taler-util'; import { WalletTransactionView as Component } from './popup'; export default { @@ -174,7 +179,7 @@ export const Refund = dynamic({ }); export const RefundPending = dynamic({ - transaction: { ...exampleData.refund , pending: true } + transaction: { ...exampleData.refund, pending: true } }); export const RefundWithProducts = dynamic({ diff --git a/packages/taler-wallet-webextension/src/pages/popup.tsx b/packages/taler-wallet-webextension/src/pages/popup.tsx index 5fb08b77e..d6c03e074 100644 --- a/packages/taler-wallet-webextension/src/pages/popup.tsx +++ b/packages/taler-wallet-webextension/src/pages/popup.tsx @@ -37,13 +37,13 @@ import { AmountString, Timestamp, amountFractionalBase, + i18n, } from "@gnu-taler/taler-util"; import { format } from "date-fns"; import { Component, ComponentChildren, Fragment, JSX } from "preact"; import { route, Route, Router } from 'preact-router'; import { Match } from 'preact-router/match'; import { useEffect, useState } from "preact/hooks"; -import * as i18n from "../i18n"; import { PageLink, renderAmount } from "../renderHtml"; import * as wxApi from "../wxApi"; import { PermissionsCheckbox, useExtendedPermissions, Diagnostics } from "./welcome"; @@ -92,10 +92,10 @@ function bigAmount(amount: AmountJson): JSX.Element { function EmptyBalanceView(): JSX.Element { return ( - <i18n.Translate wrap="p"> + <p><i18n.Translate> You have no balance to show. Need some{" "} <PageLink pageName="/welcome">help</PageLink> getting started? - </i18n.Translate> + </i18n.Translate></p> ); } @@ -166,13 +166,13 @@ class WalletBalanceView extends Component<any, any> { if (!Amounts.isZero(pendingIncoming)) { incoming = ( - <i18n.Translate wrap="span"> + <span><i18n.Translate> <span style={{ color: "darkgreen" }}> {"+"} {renderAmount(entry.pendingIncoming)} </span>{" "} incoming - </i18n.Translate> + </i18n.Translate></span> ); } @@ -436,14 +436,14 @@ interface WalletTransactionProps { export function WalletTransactionView({ transaction, onDelete, onBack }: WalletTransactionProps) { if (!transaction) { - return <div>Loading ...</div>; + return <div><i18n.Translate>Loading ...</i18n.Translate></div>; } function Footer() { return <footer style={{ marginTop: 'auto', display: 'flex' }}> - <button onClick={onBack}>back</button> + <button onClick={onBack}><i18n.Translate>back</i18n.Translate></button> <div style={{ width: '100%', flexDirection: 'row', justifyContent: 'flex-end', display: 'flex' }}> - <button onClick={onDelete}>remove</button> + <button onClick={onDelete}><i18n.Translate>remove</i18n.Translate></button> </div> diff --git a/packages/taler-wallet-webextension/src/pages/withdraw.tsx b/packages/taler-wallet-webextension/src/pages/withdraw.tsx index 7b6a06d20..6bdafd94c 100644 --- a/packages/taler-wallet-webextension/src/pages/withdraw.tsx +++ b/packages/taler-wallet-webextension/src/pages/withdraw.tsx @@ -21,8 +21,7 @@ * @author Florian Dold */ -import * as i18n from "../i18n"; - +import { i18n } from '@gnu-taler/taler-util' import { renderAmount } from "../renderHtml"; import { useState, useEffect } from "preact/hooks"; @@ -64,11 +63,11 @@ export function View({ talerWithdrawUri, details, cancelled, selectedExchange, a return ( <div> <h1>Digital Cash Withdrawal</h1> - <i18n.Translate wrap="p"> + <p><i18n.Translate> You are about to withdraw{" "} <strong>{renderAmount(details.amount)}</strong> from your bank account into your wallet. - </i18n.Translate> + </i18n.Translate></p> {selectedExchange ? ( <p> The exchange <strong>{selectedExchange}</strong> will be used as the |