Skip to content

Commit 95d3bfc

Browse files
committed
fix: add missing translations
1 parent ad4bcc5 commit 95d3bfc

File tree

12 files changed

+54
-33
lines changed

12 files changed

+54
-33
lines changed

apps/browser-extension-wallet/src/components/MainLoader/MainLoader.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@ import { useTranslation } from 'react-i18next';
55
import styles from './MainLoader.module.scss';
66

77
export interface MainLoaderProps {
8-
text?: string;
98
overlay?: boolean;
109
}
1110

12-
export const MainLoader = ({ text, overlay = false }: MainLoaderProps): React.ReactElement => {
11+
export const MainLoader = ({ overlay = false }: MainLoaderProps): React.ReactElement => {
1312
const { t } = useTranslation();
1413

1514
return (
1615
<div className={classNames([styles.loaderContainer, { [styles.overlay]: overlay }])} data-testid="main-loader">
1716
<Loader className={styles.loader} data-testid="main-loader-image" />
1817
<p className={styles.loaderText} data-testid="main-loader-text">
19-
{text ?? t('general.loading')}
18+
{t('general.loading')}
2019
</p>
2120
</div>
2221
);

apps/browser-extension-wallet/src/views/bitcoin-mode/features/multi-wallet/restore-wallet/steps/EnterPgpPrivateKey.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { TextArea } from '@lace/common';
1919
import { ShieldedPgpKeyData } from '@src/types';
2020
import { useWalletOnboarding } from '../../walletOnboardingContext';
2121
import { useAnalyticsContext } from '@providers';
22+
import { useTranslation } from 'react-i18next';
2223

2324
interface Validation {
2425
error?: string;
@@ -53,6 +54,7 @@ const decryptQrCodeMnemonicWithPrivateKey = async ({ pgpInfo }: DecryptProps): P
5354
};
5455

5556
export const EnterPgpPrivateKey: VFC = () => {
57+
const { t } = useTranslation();
5658
const { postHogActions } = useWalletOnboarding();
5759
const analytics = useAnalyticsContext();
5860
const { back, createWalletData, next, pgpInfo, setPgpInfo, setMnemonic } = useRestoreWallet();
@@ -74,7 +76,7 @@ export const EnterPgpPrivateKey: VFC = () => {
7476
pgpPrivateKey: e.target.value,
7577
privateKeyIsDecrypted: privateKey.isDecrypted()
7678
});
77-
setValidation({ success: 'valid PGP private key' });
79+
setValidation({ success: t('pgp.validPrivateKey') });
7880
} catch (error) {
7981
if (error.message === 'Misformed armored text') {
8082
setValidation({ error: i18n.t('pgp.error.misformedArmoredText') });
@@ -84,7 +86,7 @@ export const EnterPgpPrivateKey: VFC = () => {
8486
}
8587
}
8688
},
87-
[setValidation, pgpInfo, setPgpInfo]
89+
[setValidation, pgpInfo, setPgpInfo, t]
8890
);
8991

9092
const handleNext = () => {
@@ -127,7 +129,7 @@ export const EnterPgpPrivateKey: VFC = () => {
127129
pgpPrivateKey: fileinfo as string,
128130
privateKeyIsDecrypted: pk.isDecrypted()
129131
});
130-
setValidation({ error: null, success: 'valid PGP private key' });
132+
setValidation({ error: null, success: t('pgp.validPrivateKey') });
131133
setPrivateKeyFile(keyFile?.name);
132134
})
133135
.catch((error) => {
@@ -145,7 +147,7 @@ export const EnterPgpPrivateKey: VFC = () => {
145147
setValidation({ error: error.message });
146148
}
147149
},
148-
[setValidation, setPrivateKeyFile, setPgpInfo, pgpInfo]
150+
[setValidation, setPrivateKeyFile, setPgpInfo, pgpInfo, t]
149151
);
150152

151153
useEffect(() => {

apps/browser-extension-wallet/src/views/bitcoin-mode/features/multi-wallet/restore-wallet/steps/ScanShieldedMessage.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
} from '@input-output-hk/lace-ui-toolkit';
1919
import { i18n } from '@lace/translation';
2020
import jsQR, { QRCode } from 'jsqr';
21-
import { Trans } from 'react-i18next';
21+
import { Trans, useTranslation } from 'react-i18next';
2222
import styles from './ScanShieldedMessage.module.scss';
2323
import cn from 'classnames';
2424
import { useAnalyticsContext } from '@providers';
@@ -46,6 +46,7 @@ interface ByteChunk<T> {
4646
type ScannedCode = [ByteChunk<null>, ByteChunk<string>, ByteChunk<Wallet.ChainName>];
4747

4848
export const ScanShieldedMessage: VFC = () => {
49+
const { t } = useTranslation();
4950
const { postHogActions } = useWalletOnboarding();
5051
const analytics = useAnalyticsContext();
5152
const { back, next, pgpInfo, setPgpInfo, setWalletMetadata } = useRestoreWallet();
@@ -59,7 +60,7 @@ export const ScanShieldedMessage: VFC = () => {
5960

6061
const endVideoTracks = () => {
6162
if (streamRef.current) {
62-
streamRef.current.getVideoTracks().forEach((t) => t.stop());
63+
streamRef.current.getVideoTracks().forEach((track) => track.stop());
6364
streamRef.current = null;
6465
}
6566
};
@@ -155,7 +156,7 @@ export const ScanShieldedMessage: VFC = () => {
155156
// User may have scanned the wallet address QR code
156157
if (Wallet.Cardano.Address.fromString(code.data)) {
157158
setValidation({
158-
error: { title: 'Wrong QR code identified', description: 'Scan paper wallet private QR code' }
159+
error: { title: t('pgp.wrongQrCodeHeading'), description: t('pgp.scanWalletPrivateQrCode') }
159160
});
160161
void analytics.sendEventToPostHog(postHogActions.restore.SCAN_QR_CODE_READ_ERROR);
161162
} else if (isCodeDataCorrectFormatForPaperWallet) {
@@ -164,12 +165,14 @@ export const ScanShieldedMessage: VFC = () => {
164165
next();
165166
// Immediately move to next step
166167
} else {
167-
setValidation({ error: { title: 'Unidentified QR code', description: 'Scan your Lace paper wallet' } });
168+
setValidation({
169+
error: { title: t('pgp.unidentifiedQrCodeHeading'), description: t('pgp.scanWalletPrivateQrCode') }
170+
});
168171
await analytics.sendEventToPostHog(postHogActions.restore.SCAN_QR_CODE_READ_ERROR);
169172
}
170173
setScanState('scanning');
171174
},
172-
[next, setValidation, setScanState, onScanSuccess, analytics, postHogActions.restore.SCAN_QR_CODE_READ_ERROR]
175+
[next, setValidation, setScanState, onScanSuccess, analytics, postHogActions.restore.SCAN_QR_CODE_READ_ERROR, t]
173176
);
174177

175178
useEffect(() => {

apps/browser-extension-wallet/src/views/bitcoin-mode/features/multi-wallet/restore-wallet/steps/WalletOverview.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import styles from './WalletOverview.module.scss';
2626
import { useAnalyticsContext } from '@providers';
2727
import { useWalletOnboarding } from '../../walletOnboardingContext';
2828
import { useFetchCoinPrice } from '@hooks';
29+
import { useTranslation } from 'react-i18next';
2930

3031
const TOAST_DEFAULT_DURATION = 3;
3132

@@ -34,6 +35,7 @@ const handleOpenCoingeckoLink = () => {
3435
};
3536

3637
export const WalletOverview = (): JSX.Element => {
38+
const { t } = useTranslation();
3739
const coinPricing = useFetchCoinPrice();
3840
const { postHogActions } = useWalletOnboarding();
3941
const analytics = useAnalyticsContext();
@@ -136,10 +138,10 @@ export const WalletOverview = (): JSX.Element => {
136138

137139
let subtitle = `${Wallet.util.lovelacesToAdaString(walletBalances.ada.toString())} ${adaSymbol}`;
138140
if (walletBalances.otherItems.size > 0) {
139-
subtitle += ` +${walletBalances.otherItems.size} other asset(s)`;
141+
subtitle += ` +${walletBalances.otherItems.size} ${t('generic.otherAssets')}`;
140142
}
141143
return subtitle;
142-
}, [walletBalances.ada, walletBalances.otherItems, walletMetadata.chain, walletBalances.fetched, isLoading]);
144+
}, [walletBalances.ada, walletBalances.otherItems, walletMetadata.chain, walletBalances.fetched, isLoading, t]);
143145

144146
return (
145147
<WalletSetupStepLayoutRevamp

apps/browser-extension-wallet/src/views/bitcoin-mode/features/send/components/TransactionSuccess.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const TransactionSuccess: React.FC<TransactionSuccessProps> = ({
4242
<SummaryExpander
4343
onClick={() => setIsSummaryOpen(!isSummaryOpen)}
4444
open={isSummaryOpen}
45-
title="Transaction hash"
45+
title={t('generic.transactionHash')}
4646
plain
4747
>
4848
<Flex justifyContent="center">

apps/browser-extension-wallet/src/views/browser-view/features/multi-wallet/restore-wallet/steps/EnterPgpPrivateKey.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { TextArea } from '@lace/common';
1919
import { ShieldedPgpKeyData } from '@src/types';
2020
import { useWalletOnboarding } from '../../walletOnboardingContext';
2121
import { useAnalyticsContext } from '@providers';
22+
import { useTranslation } from 'react-i18next';
2223

2324
interface Validation {
2425
error?: string;
@@ -53,6 +54,7 @@ const decryptQrCodeMnemonicWithPrivateKey = async ({ pgpInfo }: DecryptProps): P
5354
};
5455

5556
export const EnterPgpPrivateKey: VFC = () => {
57+
const { t } = useTranslation();
5658
const { postHogActions } = useWalletOnboarding();
5759
const analytics = useAnalyticsContext();
5860
const { back, createWalletData, next, pgpInfo, setPgpInfo, setMnemonic } = useRestoreWallet();
@@ -74,7 +76,7 @@ export const EnterPgpPrivateKey: VFC = () => {
7476
pgpPrivateKey: e.target.value,
7577
privateKeyIsDecrypted: privateKey.isDecrypted()
7678
});
77-
setValidation({ success: 'valid PGP private key' });
79+
setValidation({ success: t('pgp.validPrivateKey') });
7880
} catch (error) {
7981
if (error.message === 'Misformed armored text') {
8082
setValidation({ error: i18n.t('pgp.error.misformedArmoredText') });
@@ -84,7 +86,7 @@ export const EnterPgpPrivateKey: VFC = () => {
8486
}
8587
}
8688
},
87-
[setValidation, pgpInfo, setPgpInfo]
89+
[setValidation, pgpInfo, setPgpInfo, t]
8890
);
8991

9092
const handleNext = () => {
@@ -127,7 +129,7 @@ export const EnterPgpPrivateKey: VFC = () => {
127129
pgpPrivateKey: fileinfo as string,
128130
privateKeyIsDecrypted: pk.isDecrypted()
129131
});
130-
setValidation({ error: null, success: 'valid PGP private key' });
132+
setValidation({ error: null, success: t('pgp.validPrivateKey') });
131133
setPrivateKeyFile(keyFile?.name);
132134
})
133135
.catch((error) => {
@@ -145,7 +147,7 @@ export const EnterPgpPrivateKey: VFC = () => {
145147
setValidation({ error: error.message });
146148
}
147149
},
148-
[setValidation, setPrivateKeyFile, setPgpInfo, pgpInfo]
150+
[setValidation, setPrivateKeyFile, setPgpInfo, pgpInfo, t]
149151
);
150152

151153
useEffect(() => {

apps/browser-extension-wallet/src/views/browser-view/features/multi-wallet/restore-wallet/steps/WalletOverview.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import styles from './WalletOverview.module.scss';
2626
import { useAnalyticsContext } from '@providers';
2727
import { useWalletOnboarding } from '../../walletOnboardingContext';
2828
import { useFetchCoinPrice } from '@hooks';
29+
import { useTranslation } from 'react-i18next';
2930

3031
const TOAST_DEFAULT_DURATION = 3;
3132

@@ -34,6 +35,7 @@ const handleOpenCoingeckoLink = () => {
3435
};
3536

3637
export const WalletOverview = (): JSX.Element => {
38+
const { t } = useTranslation();
3739
const coinPricing = useFetchCoinPrice();
3840
const { postHogActions } = useWalletOnboarding();
3941
const analytics = useAnalyticsContext();
@@ -136,10 +138,10 @@ export const WalletOverview = (): JSX.Element => {
136138

137139
let subtitle = `${Wallet.util.lovelacesToAdaString(walletBalances.ada.toString())} ${adaSymbol}`;
138140
if (walletBalances.otherItems.size > 0) {
139-
subtitle += ` +${walletBalances.otherItems.size} other asset(s)`;
141+
subtitle += ` +${walletBalances.otherItems.size} ${t('generic.otherAssets')}`;
140142
}
141143
return subtitle;
142-
}, [walletBalances.ada, walletBalances.otherItems, walletMetadata.chain, walletBalances.fetched, isLoading]);
144+
}, [walletBalances.ada, walletBalances.otherItems, walletMetadata.chain, walletBalances.fetched, isLoading, t]);
143145

144146
return (
145147
<WalletSetupStepLayoutRevamp

packages/core/src/shared-wallets/transaction/CoSignEntry/CoSignEntry.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,8 @@ export const CoSignEntry = ({ onCancel, onContinue, onImportError }: CoSignEntry
9191
<>
9292
<Flex gap="$32" flexDirection="column" h="$fill">
9393
<Flex gap="$8" flexDirection="column">
94-
<Text.SubHeading>Import transaction</Text.SubHeading>
95-
<Text.Body.Normal>
96-
To co-sign a transaction initiated by another shared wallet member, upload the transaction JSON file you
97-
received.
98-
</Text.Body.Normal>
94+
<Text.SubHeading>{t('core.sharedWallets.importTransaction')}</Text.SubHeading>
95+
<Text.Body.Normal>{t('core.sharedWallets.importTransactionDescription')}</Text.Body.Normal>
9996
</Flex>
10097
<Flex h="$fill" w="$fill">
10198
<FileUpload
@@ -111,8 +108,8 @@ export const CoSignEntry = ({ onCancel, onContinue, onImportError }: CoSignEntry
111108
}
112109
accept="application/json"
113110
onChange={onFileChange}
114-
supportedFormats="Supported formats: JSON"
115-
removeButtonLabel="Remove"
111+
supportedFormats={t('core.sharedWallets.importTransactionSupportedFormat')}
112+
removeButtonLabel={t('core.sharedWallets.removeBtnLabel')}
116113
files={loadedFileName ? [loadedFileName] : undefined}
117114
onRemove={() => setLoadedFileName('')}
118115
/>

packages/staking/src/features/Drawer/preferences/PoolDetailsCard/PoolDetailsCard.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ export const PoolDetailsCard = ({
8080
/>
8181
<Flex gap="$28" p="$32" pt="$20" flexDirection="column" alignItems="center">
8282
<Flex justifyContent="space-between" alignItems="center" w="$fill">
83-
<Text.Body.Large data-testid="pool-details-card-edit-ratio-title">Edit saved ratio</Text.Body.Large>
83+
<Text.Body.Large data-testid="pool-details-card-edit-ratio-title">
84+
{t('details.editSavedRatio')}
85+
</Text.Body.Large>
8486
<Flex alignItems="center" gap="$12">
85-
<Text.Body.Large data-testid="pool-details-card-ratio-title">Ratio</Text.Body.Large>
87+
<Text.Body.Large data-testid="pool-details-card-ratio-title">{t('details.ratio')}</Text.Body.Large>
8688
<RatioInput
8789
onUpdate={updatePercentage}
8890
value={localValue}

packages/translation/src/lib/translations/browser-extension-wallet/en.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,5 +958,11 @@
958958
"bitcoinSendMode.fee.average": "Average",
959959
"bitcoinSendMode.fee.slow": "Slow",
960960
"bitcoinSendMode.fee.custom": "Custom",
961-
"bitcoinSendMode.previousTxSendError": "You cannot send transactions while previous transactions are still pending."
961+
"bitcoinSendMode.previousTxSendError": "You cannot send transactions while previous transactions are still pending.",
962+
"pgp.validPrivateKey": "valid PGP private key",
963+
"generic.otherAssets": "other asset(s)",
964+
"pgp.wrongQrCodeHeading": "Wrong QR code identified",
965+
"pgp.scanWalletPrivateQrCode": "Scan paper wallet private QR code",
966+
"pgp.unidentifiedQrCodeHeading": "Unidentified QR code",
967+
"generic.transactionHash": "Transaction hash"
962968
}

0 commit comments

Comments
 (0)