From 8c3e57293422d670b93c2f2a19cfc47f3aecc7b1 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 23 Feb 2022 15:44:14 -0300 Subject: we are force to use i18n.Translate, otherwise pogen won't find the tag --- .../src/components/BankDetailsByPaytoType.tsx | 35 +++++++++++++++++----- .../src/components/DebugCheckbox.tsx | 10 ++++--- .../src/components/Diagnostics.tsx | 20 ++++++------- .../src/components/EditableText.tsx | 6 ++-- .../src/components/Loading.tsx | 4 +-- .../src/components/SelectList.tsx | 4 +-- .../src/components/TransactionItem.tsx | 6 ++-- 7 files changed, 53 insertions(+), 32 deletions(-) (limited to 'packages/taler-wallet-webextension/src/components') diff --git a/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx b/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx index 205413007..e9a32ebf7 100644 --- a/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx +++ b/packages/taler-wallet-webextension/src/components/BankDetailsByPaytoType.tsx @@ -14,7 +14,7 @@ GNU Taler; see the file COPYING. If not, see */ -import { PaytoUri, Translate } from "@gnu-taler/taler-util"; +import { PaytoUri, i18n } from "@gnu-taler/taler-util"; import { Fragment, h, VNode } from "preact"; import { useEffect, useState } from "preact/hooks"; import { CopiedIcon, CopyIcon } from "../svg"; @@ -34,23 +34,42 @@ export function BankDetailsByPaytoType({ amount, }: BankDetailsProps): VNode { const firstPart = !payto ? undefined : !payto.isKnown ? ( - Account} value={payto.targetPath} /> + Account} + value={payto.targetPath} + /> ) : payto.targetType === "x-taler-bank" ? ( - Bank host} value={payto.host} /> - Bank account} value={payto.account} /> + Bank host} + value={payto.host} + /> + Bank account} + value={payto.account} + /> ) : payto.targetType === "iban" ? ( - IBAN} value={payto.iban} /> + IBAN} value={payto.iban} /> ) : undefined; return (

Bank transfer details

{firstPart} - Exchange} value={exchangeBaseUrl} /> - Chosen amount} value={amount} /> - Subject} value={subject} literal /> + Exchange} + value={exchangeBaseUrl} + /> + Chosen amount} + value={amount} + /> + Subject} + value={subject} + literal + />
); diff --git a/packages/taler-wallet-webextension/src/components/DebugCheckbox.tsx b/packages/taler-wallet-webextension/src/components/DebugCheckbox.tsx index 522fbce98..b5ad7cda7 100644 --- a/packages/taler-wallet-webextension/src/components/DebugCheckbox.tsx +++ b/packages/taler-wallet-webextension/src/components/DebugCheckbox.tsx @@ -14,7 +14,7 @@ TALER; see the file COPYING. If not, see */ -import { Translate } from "@gnu-taler/taler-util"; +import { i18n } from "@gnu-taler/taler-util"; import { h, VNode } from "preact"; export function DebugCheckbox({ @@ -37,7 +37,9 @@ export function DebugCheckbox({ htmlFor="checkbox-perm" style={{ marginLeft: "0.5em", fontWeight: "bold" }} > - Automatically open wallet based on page content + + Automatically open wallet based on page content + ( - + Enabling this option below will make using the wallet faster, but requires more permissions from your browser. - + ) diff --git a/packages/taler-wallet-webextension/src/components/Diagnostics.tsx b/packages/taler-wallet-webextension/src/components/Diagnostics.tsx index 04b6abb55..b136ebc24 100644 --- a/packages/taler-wallet-webextension/src/components/Diagnostics.tsx +++ b/packages/taler-wallet-webextension/src/components/Diagnostics.tsx @@ -14,7 +14,7 @@ GNU Taler; see the file COPYING. If not, see */ -import { Translate, WalletDiagnostics } from "@gnu-taler/taler-util"; +import { i18n, WalletDiagnostics } from "@gnu-taler/taler-util"; import { Fragment, h, VNode } from "preact"; import { PageLink } from "../renderHtml"; @@ -27,9 +27,9 @@ export function Diagnostics({ timedOut, diagnostics }: Props): VNode { if (timedOut) { return (

- + Diagnostics timed out. Could not talk to the wallet backend. - +

); } @@ -48,7 +48,7 @@ export function Diagnostics({ timedOut, diagnostics }: Props): VNode { }} >

- Problems detected: + Problems detected:

    {diagnostics.errors.map((errMsg) => ( @@ -57,23 +57,23 @@ export function Diagnostics({ timedOut, diagnostics }: Props): VNode {
{diagnostics.firefoxIdbProblem ? (

- + Please check in your about:config settings that you have IndexedDB enabled (check the preference name{" "} dom.indexedDB.enabled). - +

) : null} {diagnostics.dbOutdated ? (

- + Your wallet database is outdated. Currently automatic migration is not supported. Please go{" "} - here + here {" "} to reset the wallet database. - +

) : null} @@ -82,7 +82,7 @@ export function Diagnostics({ timedOut, diagnostics }: Props): VNode { return (

- Running diagnostics ... + Running diagnostics ...

); } diff --git a/packages/taler-wallet-webextension/src/components/EditableText.tsx b/packages/taler-wallet-webextension/src/components/EditableText.tsx index c5d6e397e..8d45cae90 100644 --- a/packages/taler-wallet-webextension/src/components/EditableText.tsx +++ b/packages/taler-wallet-webextension/src/components/EditableText.tsx @@ -14,7 +14,7 @@ GNU Taler; see the file COPYING. If not, see */ -import { Translate } from "@gnu-taler/taler-util"; +import { i18n } from "@gnu-taler/taler-util"; import { h, VNode } from "preact"; import { useRef, useState } from "preact/hooks"; @@ -41,7 +41,7 @@ export function EditableText({

{value}

); @@ -57,7 +57,7 @@ export function EditableText({ onChange(ref.current.value).then(() => setEditing(false)); }} > - Confirm + Confirm ); diff --git a/packages/taler-wallet-webextension/src/components/Loading.tsx b/packages/taler-wallet-webextension/src/components/Loading.tsx index ff6d21376..7504034a0 100644 --- a/packages/taler-wallet-webextension/src/components/Loading.tsx +++ b/packages/taler-wallet-webextension/src/components/Loading.tsx @@ -13,13 +13,13 @@ You should have received a copy of the GNU General Public License along with TALER; see the file COPYING. If not, see */ -import { Translate } from "@gnu-taler/taler-util"; +import { i18n } from "@gnu-taler/taler-util"; import { h, VNode } from "preact"; export function Loading(): VNode { return (
- Loading... + Loading...
); } diff --git a/packages/taler-wallet-webextension/src/components/SelectList.tsx b/packages/taler-wallet-webextension/src/components/SelectList.tsx index a5f182d77..676fd672f 100644 --- a/packages/taler-wallet-webextension/src/components/SelectList.tsx +++ b/packages/taler-wallet-webextension/src/components/SelectList.tsx @@ -14,7 +14,7 @@ GNU Taler; see the file COPYING. If not, see */ -import { Translate } from "@gnu-taler/taler-util"; +import { i18n } from "@gnu-taler/taler-util"; import { Fragment, h, VNode } from "preact"; import { NiceSelect } from "./styled"; @@ -59,7 +59,7 @@ export function SelectList({ {value === undefined || (canBeNull && ( // ) : ( // diff --git a/packages/taler-wallet-webextension/src/components/TransactionItem.tsx b/packages/taler-wallet-webextension/src/components/TransactionItem.tsx index 5c8897006..abcca9c26 100644 --- a/packages/taler-wallet-webextension/src/components/TransactionItem.tsx +++ b/packages/taler-wallet-webextension/src/components/TransactionItem.tsx @@ -21,7 +21,7 @@ import { Timestamp, Transaction, TransactionType, - Translate, + i18n, } from "@gnu-taler/taler-util"; import { h, VNode } from "preact"; import imageBank from "../../static/img/ri-bank-line.svg"; @@ -134,7 +134,7 @@ function TransactionLayout(props: TransactionLayoutProps): VNode { {props.pending && ( - Waiting for confirmation + Waiting for confirmation )} @@ -198,7 +198,7 @@ function TransactionAmount(props: TransactionAmountProps): VNode { {props.pending && (
- PENDING + PENDING
)} -- cgit v1.2.3