Skip to content

Commit 18e9afd

Browse files
committed
fix: add missing bitcoin-mode translation keys
1 parent 397db8e commit 18e9afd

File tree

3 files changed

+30
-23
lines changed
  • apps/browser-extension-wallet/src/views/bitcoin-mode/features
  • packages/translation/src/lib/translations/browser-extension-wallet

3 files changed

+30
-23
lines changed

apps/browser-extension-wallet/src/views/bitcoin-mode/features/activity/components/Activity.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,17 @@ export const Activity = (): React.ReactElement => {
128128

129129
const walletAddress = addresses[0].address;
130130

131-
const groups = [...recentTransactions, ...pendingTransaction].reduce((acc, transaction) => {
132-
const dateKey = transaction.timestamp === 0 ? 'Pending' : formattedDate(new Date(transaction.timestamp * 1000));
133-
if (!acc[dateKey]) {
134-
acc[dateKey] = [];
135-
}
136-
acc[dateKey].push(transaction);
137-
return acc;
138-
}, {} as { [date: string]: Bitcoin.TransactionHistoryEntry[] });
131+
const groups = [...recentTransactions, ...pendingTransaction].reduce(
132+
(acc, transaction) => {
133+
const dateKey = transaction.timestamp === 0 ? 'Pending' : formattedDate(new Date(transaction.timestamp * 1000));
134+
if (!acc[dateKey]) {
135+
acc[dateKey] = [];
136+
}
137+
acc[dateKey].push(transaction);
138+
return acc;
139+
},
140+
{} as { [date: string]: Bitcoin.TransactionHistoryEntry[] }
141+
);
139142

140143
const sortedDates = Object.keys(groups).sort((a, b) => {
141144
if (a === 'Pending') return -1;
@@ -173,7 +176,7 @@ export const Activity = (): React.ReactElement => {
173176
id: transaction.transactionHash,
174177
formattedTimestamp:
175178
transaction.status === Bitcoin.TransactionStatus.Pending
176-
? 'PENDING'
179+
? t('browserView.activity.entry.name.pending')
177180
: formattedTimestamp(new Date(transaction.timestamp * 1000)),
178181
amount: `${new BigNumber(net.toString()).dividedBy(100_000_000).toFixed(8, BigNumber.ROUND_HALF_UP)} BTC`,
179182
fiatAmount: `${computeBalance(Number(net) / SATS_IN_BTC, fiatCurrency.code, bitcoinPrice)} ${

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

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ interface RecommendedFee {
3232
estimatedTime: string; // e.g. "~10 min"
3333
}
3434

35-
const fees: RecommendedFee[] = [
36-
{ key: 'fast', label: 'High', feeRate: 10, estimatedTime: '~10 min' },
37-
{ key: 'standard', label: 'Average', feeRate: 5, estimatedTime: '~30 min' },
38-
{ key: 'slow', label: 'Slow', feeRate: 1, estimatedTime: '~60 min' },
39-
{ key: 'custom', label: 'Custom', estimatedTime: '~?? min' }
40-
];
41-
4235
interface SendStepOneProps {
4336
amount: string;
4437
onAmountChange: (value: string) => void;
@@ -101,13 +94,23 @@ export const SendStepOne: React.FC<SendStepOneProps> = ({
10194
const [feeRate, setFeeRate] = useState<number>(1);
10295
const handleResolver = useHandleResolver();
10396

97+
const fees: RecommendedFee[] = useMemo(
98+
() => [
99+
{ key: 'fast', label: t('bitcoinSendMode.fee.high'), feeRate: 10, estimatedTime: '~10 min' },
100+
{ key: 'standard', label: t('bitcoinSendMode.fee.average'), feeRate: 5, estimatedTime: '~30 min' },
101+
{ key: 'slow', label: t('bitcoinSendMode.fee.slow'), feeRate: 1, estimatedTime: '~60 min' },
102+
{ key: 'custom', label: t('bitcoinSendMode.fee.custom'), estimatedTime: '~?? min' }
103+
],
104+
[t]
105+
);
106+
104107
const getFees = useCallback(
105108
() =>
106109
fees.map((fee) => ({
107110
...fee,
108111
feeRate: fee.key !== 'custom' ? feeMarkets?.[fee.key]?.feeRate || fee.feeRate : fee.feeRate
109112
})),
110-
[feeMarkets]
113+
[feeMarkets, fees]
111114
);
112115

113116
const [handleVerificationState, setHandleVerificationState] = useState<HandleVerificationState | undefined>();
@@ -332,11 +335,7 @@ export const SendStepOne: React.FC<SendStepOneProps> = ({
332335
<Flex flexDirection="column" w="$fill" className={mainStyles.container}>
333336
{isPopupView && <Text.Heading weight="$bold">{t('browserView.transaction.send.title')}</Text.Heading>}
334337
{hasUtxosInMempool && (
335-
<InputError
336-
marginBottom
337-
error="You cannot send transactions while previous transactions are still pending."
338-
isPopupView={isPopupView}
339-
/>
338+
<InputError marginBottom error={t('bitcoinSendMode.previousTxSendError')} isPopupView={isPopupView} />
340339
)}
341340

342341
<Search

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,5 +954,10 @@
954954
"dapp.connector.btc.error.closeButton": "Close",
955955
"languageChoice.english": "English",
956956
"languageChoice.japanese": "Japanese",
957-
"asset.searchPlaceholder": "Search by ID or name"
957+
"asset.searchPlaceholder": "Search by ID or name",
958+
"bitcoinSendMode.fee.high": "High",
959+
"bitcoinSendMode.fee.average": "Average",
960+
"bitcoinSendMode.fee.slow": "Slow",
961+
"bitcoinSendMode.fee.custom": "Custom",
962+
"bitcoinSendMode.previousTxSendError": "You cannot send transactions while previous transactions are still pending."
958963
}

0 commit comments

Comments
 (0)