diff options
author | Sebastian <sebasjm@gmail.com> | 2022-02-23 15:44:14 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2022-02-24 12:50:52 -0300 |
commit | 8c3e57293422d670b93c2f2a19cfc47f3aecc7b1 (patch) | |
tree | 3a44e6284d088632523567ce9f7a9c033d775a7e /packages/taler-wallet-webextension/src/components | |
parent | 8e01ea5433f67679178f5f5ddebbee897878e198 (diff) | |
download | wallet-core-8c3e57293422d670b93c2f2a19cfc47f3aecc7b1.tar.gz wallet-core-8c3e57293422d670b93c2f2a19cfc47f3aecc7b1.tar.bz2 wallet-core-8c3e57293422d670b93c2f2a19cfc47f3aecc7b1.zip |
we are force to use i18n.Translate, otherwise pogen won't find the tag
Diffstat (limited to 'packages/taler-wallet-webextension/src/components')
7 files changed, 53 insertions, 32 deletions
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 <http://www.gnu.org/licenses/> */ -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 ? ( - <Row name={<Translate>Account</Translate>} value={payto.targetPath} /> + <Row + name={<i18n.Translate>Account</i18n.Translate>} + value={payto.targetPath} + /> ) : payto.targetType === "x-taler-bank" ? ( <Fragment> - <Row name={<Translate>Bank host</Translate>} value={payto.host} /> - <Row name={<Translate>Bank account</Translate>} value={payto.account} /> + <Row + name={<i18n.Translate>Bank host</i18n.Translate>} + value={payto.host} + /> + <Row + name={<i18n.Translate>Bank account</i18n.Translate>} + value={payto.account} + /> </Fragment> ) : payto.targetType === "iban" ? ( - <Row name={<Translate>IBAN</Translate>} value={payto.iban} /> + <Row name={<i18n.Translate>IBAN</i18n.Translate>} value={payto.iban} /> ) : undefined; return ( <div style={{ textAlign: "left" }}> <p>Bank transfer details</p> <table> {firstPart} - <Row name={<Translate>Exchange</Translate>} value={exchangeBaseUrl} /> - <Row name={<Translate>Chosen amount</Translate>} value={amount} /> - <Row name={<Translate>Subject</Translate>} value={subject} literal /> + <Row + name={<i18n.Translate>Exchange</i18n.Translate>} + value={exchangeBaseUrl} + /> + <Row + name={<i18n.Translate>Chosen amount</i18n.Translate>} + value={amount} + /> + <Row + name={<i18n.Translate>Subject</i18n.Translate>} + value={subject} + literal + /> </table> </div> ); 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 <http://www.gnu.org/licenses/> */ -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" }} > - <Translate>Automatically open wallet based on page content</Translate> + <i18n.Translate> + Automatically open wallet based on page content + </i18n.Translate> </label> <span style={{ @@ -48,10 +50,10 @@ export function DebugCheckbox({ }} > ( - <Translate> + <i18n.Translate> Enabling this option below will make using the wallet faster, but requires more permissions from your browser. - </Translate> + </i18n.Translate> ) </span> </div> 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 <http://www.gnu.org/licenses/> */ -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 ( <p> - <Translate> + <i18n.Translate> Diagnostics timed out. Could not talk to the wallet backend. - </Translate> + </i18n.Translate> </p> ); } @@ -48,7 +48,7 @@ export function Diagnostics({ timedOut, diagnostics }: Props): VNode { }} > <p> - <Translate>Problems detected:</Translate> + <i18n.Translate>Problems detected:</i18n.Translate> </p> <ol> {diagnostics.errors.map((errMsg) => ( @@ -57,23 +57,23 @@ export function Diagnostics({ timedOut, diagnostics }: Props): VNode { </ol> {diagnostics.firefoxIdbProblem ? ( <p> - <Translate> + <i18n.Translate> Please check in your <code>about:config</code> settings that you have IndexedDB enabled (check the preference name{" "} <code>dom.indexedDB.enabled</code>). - </Translate> + </i18n.Translate> </p> ) : null} {diagnostics.dbOutdated ? ( <p> - <Translate> + <i18n.Translate> Your wallet database is outdated. Currently automatic migration is not supported. Please go{" "} <PageLink pageName="/reset-required"> - <Translate>here</Translate> + <i18n.Translate>here</i18n.Translate> </PageLink>{" "} to reset the wallet database. - </Translate> + </i18n.Translate> </p> ) : null} </div> @@ -82,7 +82,7 @@ export function Diagnostics({ timedOut, diagnostics }: Props): VNode { return ( <p> - <Translate>Running diagnostics</Translate> ... + <i18n.Translate>Running diagnostics</i18n.Translate> ... </p> ); } 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 <http://www.gnu.org/licenses/> */ -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({ <div style={{ display: "flex", justifyContent: "space-between" }}> <p>{value}</p> <button onClick={() => setEditing(true)}> - <Translate>Edit</Translate> + <i18n.Translate>Edit</i18n.Translate> </button> </div> ); @@ -57,7 +57,7 @@ export function EditableText({ onChange(ref.current.value).then(() => setEditing(false)); }} > - <Translate>Confirm</Translate> + <i18n.Translate>Confirm</i18n.Translate> </button> </div> ); 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 <http://www.gnu.org/licenses/> */ -import { Translate } from "@gnu-taler/taler-util"; +import { i18n } from "@gnu-taler/taler-util"; import { h, VNode } from "preact"; export function Loading(): VNode { return ( <div> - <Translate>Loading</Translate>... + <i18n.Translate>Loading</i18n.Translate>... </div> ); } 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 <http://www.gnu.org/licenses/> */ -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 && ( <option selected disabled> - <Translate>Select one option</Translate> + <i18n.Translate>Select one option</i18n.Translate> </option> // ) : ( // <option selected>{list[value]}</option> 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 { </LargeText> {props.pending && ( <LightText style={{ marginTop: 5, marginBottom: 5 }}> - <Translate>Waiting for confirmation</Translate> + <i18n.Translate>Waiting for confirmation</i18n.Translate> </LightText> )} <SmallLightText style={{ marginTop: 5 }}> @@ -198,7 +198,7 @@ function TransactionAmount(props: TransactionAmountProps): VNode { </ExtraLargeText> {props.pending && ( <div> - <Translate>PENDING</Translate> + <i18n.Translate>PENDING</i18n.Translate> </div> )} </Column> |