@rango-dev/widget-embedded 0.12.1-next.25 → 0.12.1-next.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
  2. package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
  3. package/dist/components/NoRoutes/NoRoutes.helper.d.ts.map +1 -1
  4. package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
  5. package/dist/components/RouteErrors/RouteErrorsModal.d.ts.map +1 -1
  6. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  7. package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -1
  8. package/dist/index.js +1 -1
  9. package/dist/index.js.map +3 -3
  10. package/dist/pages/Home.d.ts.map +1 -1
  11. package/dist/utils/swap.d.ts.map +1 -1
  12. package/dist/utils/time.d.ts +2 -2
  13. package/dist/utils/time.d.ts.map +1 -1
  14. package/package.json +2 -2
  15. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +34 -13
  16. package/src/components/ConfirmWalletsModal/WalletList.tsx +41 -9
  17. package/src/components/NoRoutes/NoRoutes.helper.ts +4 -2
  18. package/src/components/NotificationContent/NotificationContent.tsx +2 -1
  19. package/src/components/RouteErrors/RouteErrorsModal.tsx +6 -5
  20. package/src/components/Slippage/Slippage.tsx +1 -1
  21. package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +5 -5
  22. package/src/components/SwapDetails/SwapDetails.tsx +28 -11
  23. package/src/components/SwapsGroup/SwapsGroup.tsx +3 -2
  24. package/src/pages/ConfirmSwapPage.tsx +7 -7
  25. package/src/pages/HistoryPage.tsx +1 -1
  26. package/src/pages/Home.tsx +16 -7
  27. package/src/pages/LanguagePage.tsx +1 -1
  28. package/src/pages/SettingsPage.tsx +1 -1
  29. package/src/pages/ThemePage.tsx +1 -1
  30. package/src/utils/swap.ts +67 -27
  31. package/src/utils/time.ts +69 -36
@@ -1 +1 @@
1
- {"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../src/pages/Home.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAsC,MAAM,OAAO,CAAC;AA6E3D,wBAAgB,IAAI,sBA6XnB"}
1
+ {"version":3,"file":"Home.d.ts","sourceRoot":"","sources":["../../src/pages/Home.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAsC,MAAM,OAAO,CAAC;AA6E3D,wBAAgB,IAAI,sBAsYnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/utils/swap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EAChB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,KAAK,EACN,MAAM,WAAW,CAAC;AAGnB,OAAO,SAAS,MAAM,cAAc,CAAC;AAoBrC,wBAAgB,cAAc,CAC5B,aAAa,EAAE,SAAS,GAAG,IAAI,EAC/B,cAAc,EAAE,SAAS,GAAG,IAAI,iBAWjC;AAED,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,SAAS,GAAG,IAAI,EAC/B,WAAW,EAAE,SAAS,GAAG,CAAC,GACzB,OAAO,CAQT;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI,GAAG,OAAO,CAgB1E;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,iBAAiB,GAAG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B,wBAAwB,CACtC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GACd,OAAO,CAMT;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,OAAO,EACjB,qBAAqB,EAAE,OAAO,EAC9B,iBAAiB,EAAE,MAAM,EACzB,SAAS,EAAE,iBAAiB,GAAG,IAAI,EACnC,eAAe,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,EACxD,oBAAoB,CAAC,EAAE,cAAc,uBActC"}
@@ -1,4 +1,4 @@
1
- import { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
2
- export declare function timeSince(timeMillis: number): string;
1
+ import type { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
2
+ export declare function timeSince(millisecond: number): string;
3
3
  export declare function getSwapDate(pendingSwap: PendingSwap): string;
4
4
  //# sourceMappingURL=time.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEpE,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAqCpD;AAED,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,UAInD"}
1
+ {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAWzE,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAqDrD;AAED,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,UAYnD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.12.1-next.25",
3
+ "version": "0.12.1-next.26",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -23,7 +23,7 @@
23
23
  "@rango-dev/queue-manager-core": "^0.15.1-next.2",
24
24
  "@rango-dev/queue-manager-rango-preset": "^0.15.1-next.6",
25
25
  "@rango-dev/queue-manager-react": "^0.15.1-next.4",
26
- "@rango-dev/ui": "^0.15.1-next.16",
26
+ "@rango-dev/ui": "^0.15.1-next.17",
27
27
  "@rango-dev/wallets-react": "^0.1.1-next.6",
28
28
  "@rango-dev/wallets-shared": "^0.15.1-next.4",
29
29
  "bignumber.js": "^9.1.1",
@@ -2,6 +2,7 @@ import type { PropTypes } from './ConfirmWalletsModal.types';
2
2
  import type { ConnectedWallet } from '../../store/wallets';
3
3
  import type { ConfirmSwapWarnings, Wallet } from '../../types';
4
4
 
5
+ import { i18n } from '@lingui/core';
5
6
  import {
6
7
  Alert,
7
8
  BalanceErrors,
@@ -276,9 +277,13 @@ export function ConfirmWalletsModal(props: PropTypes) {
276
277
  onClick={setShowMoreWalletFor.bind(null, '')}>
277
278
  <ChevronLeftIcon size={16} />
278
279
  </NavigateBack>
279
- <Typography
280
- variant="headline"
281
- size="small">{`Your ${showMoreWalletFor} wallets`}</Typography>
280
+ <Typography variant="headline" size="small">
281
+ {i18n.t({
282
+ id: 'yourWallets',
283
+ message: 'Your {blockchainName} wallets',
284
+ values: { blockchainName: showMoreWalletFor },
285
+ })}
286
+ </Typography>
282
287
  </ShowMoreHeader>
283
288
  ),
284
289
  })}
@@ -288,7 +293,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
288
293
  onClose={setBalanceWarnings.bind(null, [])}
289
294
  container={modalContainer}>
290
295
  <MessageBox
291
- title="Insufficient account balance"
296
+ title={i18n.t('Insufficient account balance')}
292
297
  type="error"
293
298
  description={<BalanceErrors messages={balanceWarnings ?? []} />}>
294
299
  <Button
@@ -297,7 +302,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
297
302
  type="primary"
298
303
  fullWidth
299
304
  onClick={onConfirmBalance}>
300
- Proceed anyway
305
+ {i18n.t('Proceed anyway')}
301
306
  </Button>
302
307
  </MessageBox>
303
308
  </Modal>
@@ -320,7 +325,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
320
325
  <>
321
326
  {error && (
322
327
  <>
323
- <Alert variant="alarm" type="error" title={error} />
328
+ <Alert variant="alarm" type="error" title={i18n.t(error)} />
324
329
  <Divider size={12} />
325
330
  </>
326
331
  )}
@@ -346,13 +351,24 @@ export function ConfirmWalletsModal(props: PropTypes) {
346
351
  return (
347
352
  <div key={key}>
348
353
  <Title>
349
- <Typography
350
- variant="title"
351
- size="xmedium">{`Your ${blockchain?.displayName} wallets`}</Typography>
354
+ <Typography variant="title" size="xmedium">
355
+ {i18n.t({
356
+ id: 'yourWallets',
357
+ message: 'Your {blockchainName} wallets',
358
+ values: { blockchainName: blockchain?.displayName },
359
+ })}
360
+ </Typography>
352
361
  <Typography
353
362
  variant="label"
354
363
  color="$neutral900"
355
- size="medium">{`You need to connect a ${blockchain?.displayName} wallet.`}</Typography>
364
+ size="medium">
365
+ {i18n.t({
366
+ id: 'needConnect',
367
+ message:
368
+ 'You need to connect a {blockchainName} wallet.',
369
+ values: { blockchainName: blockchain?.displayName },
370
+ })}
371
+ </Typography>
356
372
  </Title>
357
373
  <Divider size={24} />
358
374
  <ListContainer>
@@ -420,7 +436,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
420
436
  <WalletIcon size={18} color="info" />
421
437
  <Divider size={4} direction="horizontal" />
422
438
  <Typography variant="label" size="medium">
423
- Send to a different address
439
+ {i18n.t('Send to a different address')}
424
440
  </Typography>
425
441
  </div>
426
442
  </CustomDestinationButton>
@@ -430,7 +446,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
430
446
  <Divider size={4} />
431
447
  <StyledTextField
432
448
  autoFocus
433
- placeholder="Your destination address"
449
+ placeholder={i18n.t('Your destination address')}
434
450
  value={destination}
435
451
  onChange={(e) => {
436
452
  setDestination(e.target.value);
@@ -444,7 +460,12 @@ export function ConfirmWalletsModal(props: PropTypes) {
444
460
  <Alert
445
461
  variant="alarm"
446
462
  type="error"
447
- title={`Address '${destination}' doesn't match the blockchain address pattern.`}
463
+ title={i18n.t({
464
+ id: 'addressMatch',
465
+ values: { destination },
466
+ message:
467
+ "Address {destination} doesn't match the blockchain address pattern.",
468
+ })}
448
469
  />
449
470
  </div>
450
471
  )}
@@ -4,6 +4,7 @@ import type { Wallet } from '../../types';
4
4
  import type { WalletInfo } from '@rango-dev/ui';
5
5
  import type { WalletType } from '@rango-dev/wallets-shared';
6
6
 
7
+ import { i18n } from '@lingui/core';
7
8
  import {
8
9
  Button,
9
10
  Divider,
@@ -129,7 +130,11 @@ export function WalletList(props: PropTypes) {
129
130
  wallet.state === WalletState.CONNECTED;
130
131
 
131
132
  const connectedWalletDescription = couldAddExperimentalChain
132
- ? `Add ${chain} chain`
133
+ ? i18n.t({
134
+ id: 'addChain',
135
+ message: 'Add {chain} chain',
136
+ values: { chain },
137
+ })
133
138
  : conciseAddress;
134
139
 
135
140
  const onClick = () => {
@@ -177,9 +182,18 @@ export function WalletList(props: PropTypes) {
177
182
  setExperimentalChainWallet(null);
178
183
  }}>
179
184
  <MessageBox
180
- title={`Add ${blockchainDisplayName} Chain`}
185
+ title={i18n.t({
186
+ id: 'addBlockchain',
187
+ message: 'Add {blockchainDisplayName} Chain',
188
+ values: { blockchainDisplayName },
189
+ })}
181
190
  type="warning"
182
- description={`You should connect a ${blockchainDisplayName} supported wallet or choose a different ${blockchainDisplayName} address`}>
191
+ description={i18n.t({
192
+ id: 'addBlockchainDescription',
193
+ message:
194
+ 'You should connect a {blockchainDisplayName} supported wallet or choose a different {blockchainDisplayName} address',
195
+ values: { blockchainDisplayName },
196
+ })}>
183
197
  <Divider size={18} />
184
198
  <Divider size={32} />
185
199
  <Button
@@ -191,7 +205,7 @@ export function WalletList(props: PropTypes) {
191
205
  type="primary"
192
206
  fullWidth
193
207
  size="large">
194
- Confirm
208
+ {i18n.t('Confirm')}
195
209
  </Button>
196
210
  </MessageBox>
197
211
  </Modal>
@@ -204,8 +218,17 @@ export function WalletList(props: PropTypes) {
204
218
  {addingExperimentalChainStatus === 'in-progress' ? (
205
219
  <MessageBox
206
220
  type="loading"
207
- title={`Add ${blockchainDisplayName} Chain`}
208
- description={`You should connect a ${blockchainDisplayName} supported wallet or choose a different ${blockchainDisplayName} address.`}
221
+ title={i18n.t({
222
+ id: 'addBlockchain',
223
+ message: 'Add {blockchainDisplayName} Chain',
224
+ values: { blockchainDisplayName },
225
+ })}
226
+ description={i18n.t({
227
+ id: 'addBlockchainDescription',
228
+ message:
229
+ 'You should connect a {blockchainDisplayName} supported wallet or choose a different {blockchainDisplayName} address',
230
+ values: { blockchainDisplayName },
231
+ })}
209
232
  icon={
210
233
  <LogoContainer>
211
234
  <WalletImageContainer>
@@ -218,8 +241,17 @@ export function WalletList(props: PropTypes) {
218
241
  ) : (
219
242
  <MessageBox
220
243
  type="success"
221
- title={`${blockchainDisplayName} Chain Added`}
222
- description={`${blockchainDisplayName} is added to your wallet, you can use it to swap.`}
244
+ title={i18n.t({
245
+ id: 'blockchainAdded',
246
+ message: '{blockchainDisplayName} Chain Added',
247
+ values: { blockchainDisplayName },
248
+ })}
249
+ description={i18n.t({
250
+ id: 'blockchainAddedDescription',
251
+ message:
252
+ '{blockchainDisplayName} is added to your wallet, you can use it to swap.',
253
+ values: { blockchainDisplayName },
254
+ })}
223
255
  />
224
256
  )}
225
257
  <Divider direction="vertical" size={32} />
@@ -238,7 +270,7 @@ export function WalletList(props: PropTypes) {
238
270
  {shouldShowMoreWallets && (
239
271
  <WalletButton selected={false} onClick={onShowMore.bind(null)}>
240
272
  <Typography variant="label" size="medium">
241
- Show more wallets
273
+ {i18n.t('Show more wallets')}
242
274
  <Typography variant="label" size="medium" color="$primary">
243
275
  &nbsp;+{numberOfSupportedWallets - (limit ?? 0)}
244
276
  </Typography>
@@ -1,5 +1,7 @@
1
1
  import type { Info } from './NoRoutes.types';
2
2
 
3
+ import { i18n } from '@lingui/core';
4
+
3
5
  import { errorMessages } from '../../constants/errors';
4
6
 
5
7
  export function makeInfo(
@@ -16,7 +18,7 @@ export function makeInfo(
16
18
  text: errorMessages.genericServerError,
17
19
  action: {
18
20
  onClick: refetchBestRoute,
19
- title: 'Retry',
21
+ title: i18n.t('Retry'),
20
22
  },
21
23
  },
22
24
  description: '',
@@ -37,7 +39,7 @@ export function makeInfo(
37
39
  text: errorMessages.liquiditySourcesError.title,
38
40
  action: {
39
41
  onClick: () => toggleAllLiquiditySources(true),
40
- title: 'Reset',
42
+ title: i18n.t('Reset'),
41
43
  },
42
44
  },
43
45
  description: errorMessages.liquiditySourcesError.description,
@@ -1,5 +1,6 @@
1
1
  import type { Notification } from '../../types/notification';
2
2
 
3
+ import { i18n } from '@lingui/core';
3
4
  import {
4
5
  ChainToken,
5
6
  ChevronRightIcon,
@@ -72,7 +73,7 @@ export function NotificationContent() {
72
73
  onClick={() => handleOnClick(notificationItem.requestId)}
73
74
  title={
74
75
  <Typography variant="body" size="small" color="$neutral900">
75
- {notificationItem.event.message}
76
+ {i18n.t(notificationItem.event.message)}
76
77
  </Typography>
77
78
  }
78
79
  id={notificationItem.requestId}
@@ -1,5 +1,6 @@
1
1
  import type { ModalPropTypes } from './RouteErrors.types';
2
2
 
3
+ import { i18n } from '@lingui/core';
3
4
  import {
4
5
  Button,
5
6
  Divider,
@@ -44,7 +45,7 @@ export function RouteErrorsModal(props: ModalPropTypes) {
44
45
  : 'warning';
45
46
  const highValueLossData = [
46
47
  {
47
- title: 'Swapping',
48
+ title: i18n.t('Swapping'),
48
49
  value: numberToString(
49
50
  inputUsdValue,
50
51
  USD_VALUE_MIN_DECIMALS,
@@ -52,7 +53,7 @@ export function RouteErrorsModal(props: ModalPropTypes) {
52
53
  ),
53
54
  },
54
55
  {
55
- title: 'Gas cost',
56
+ title: i18n.t('Gas cost'),
56
57
  value: numberToString(
57
58
  totalFeeInUsd,
58
59
  GAS_FEE_MIN_DECIMALS,
@@ -60,7 +61,7 @@ export function RouteErrorsModal(props: ModalPropTypes) {
60
61
  ),
61
62
  },
62
63
  {
63
- title: 'Receiving',
64
+ title: i18n.t('Receiving'),
64
65
  value: numberToString(
65
66
  outputUsdValue,
66
67
  USD_VALUE_MIN_DECIMALS,
@@ -68,7 +69,7 @@ export function RouteErrorsModal(props: ModalPropTypes) {
68
69
  ),
69
70
  },
70
71
  {
71
- title: 'Price impact',
72
+ title: i18n.t('Price impact'),
72
73
  value: numberToString(
73
74
  percentageChange,
74
75
  PERCENTAGE_CHANGE_MIN_DECIMALS,
@@ -100,7 +101,7 @@ export function RouteErrorsModal(props: ModalPropTypes) {
100
101
  <Flex>
101
102
  <Divider size={20} />
102
103
  <Typography size="small" variant="title">
103
- Details
104
+ {i18n.t('Details')}
104
105
  </Typography>
105
106
  <Flex>
106
107
  {highValueLossData.map((item, index) => {
@@ -86,7 +86,7 @@ export function Slippage() {
86
86
  </Typography>
87
87
  )
88
88
  }
89
- placeholder="Custom"
89
+ placeholder={i18n.t('Custom')}
90
90
  />
91
91
  </SlippageChipsContainer>
92
92
  </BaseContainer>
@@ -66,11 +66,11 @@ export function SwapDetailsPlaceholder(props: SwapDetailsPlaceholderPropTypes) {
66
66
  <PlaceholderContainer>
67
67
  <NotFound
68
68
  title={i18n.t('Not found')}
69
- description={i18n.t(
70
- 'swapNotFound',
71
- { requestId },
72
- { message: 'Swap with request ID = ${requestId} not found.' }
73
- )}
69
+ description={i18n.t({
70
+ id: 'swapNotFound',
71
+ values: { requestId },
72
+ message: 'Swap with request ID = {requestId} not found.',
73
+ })}
74
74
  />
75
75
  </PlaceholderContainer>
76
76
  )}
@@ -212,19 +212,36 @@ export function SwapDetails(props: SwapDetailsProps) {
212
212
 
213
213
  const completeModalDesc =
214
214
  swap.status === 'success'
215
- ? `You have received ${numberToString(
216
- outputAmount,
217
- TOKEN_AMOUNT_MIN_DECIMALS,
218
- TOKEN_AMOUNT_MAX_DECIMALS
219
- )} ${
220
- steps[numberOfSteps - 1].to.token.displayName
221
- } in ${getConciseAddress(
222
- swap.wallets[steps[numberOfSteps - 1].to.chain.displayName]
223
- ?.address || ''
224
- )} wallet on ${steps[numberOfSteps - 1].to.chain.displayName} chain.`
215
+ ? i18n.t({
216
+ id: 'receivedMessage',
217
+ message:
218
+ 'You have received {amount} {token} in {conciseAddress} wallet on {chain} chain.',
219
+ values: {
220
+ amount: numberToString(
221
+ outputAmount,
222
+ TOKEN_AMOUNT_MIN_DECIMALS,
223
+ TOKEN_AMOUNT_MAX_DECIMALS
224
+ ),
225
+ token: steps[numberOfSteps - 1].to.token.displayName,
226
+ conciseAddress: getConciseAddress(
227
+ swap.wallets[steps[numberOfSteps - 1].to.chain.displayName]
228
+ ?.address || ''
229
+ ),
230
+ chain: steps[numberOfSteps - 1].to.chain.displayName,
231
+ },
232
+ })
225
233
  : `${i18n.t('Transaction was not sent.')} ${
226
234
  lastConvertedTokenInFailedSwap
227
- ? `${lastConvertedTokenInFailedSwap.outputAmount} ${lastConvertedTokenInFailedSwap.symbol} on ${lastConvertedTokenInFailedSwap.blockchain} remain in your wallet`
235
+ ? i18n.t({
236
+ id: 'remainSymbol',
237
+ message:
238
+ '{amount} {symbol} on {blockchain} remain in your wallet',
239
+ values: {
240
+ amount: lastConvertedTokenInFailedSwap.outputAmount,
241
+ symbol: lastConvertedTokenInFailedSwap.symbol,
242
+ blockchain: lastConvertedTokenInFailedSwap.blockchain,
243
+ },
244
+ })
228
245
  : ''
229
246
  }`;
230
247
 
@@ -1,5 +1,6 @@
1
1
  import type { PropTypes } from './SwapsGroup.types';
2
2
 
3
+ import { i18n } from '@lingui/core';
3
4
  import { Divider, SwapListItem, Typography } from '@rango-dev/ui';
4
5
  import React from 'react';
5
6
 
@@ -35,7 +36,7 @@ export function SwapsGroup(props: PropTypes) {
35
36
  size="medium"
36
37
  color="neutral800"
37
38
  className="group-title">
38
- {group.title}
39
+ {i18n.t(group.title)}
39
40
  </Typography>
40
41
  </Time>
41
42
  <Divider size={4} />
@@ -69,7 +70,7 @@ export function SwapsGroup(props: PropTypes) {
69
70
  size="medium"
70
71
  color="neutral800"
71
72
  className="group-title">
72
- {group.title}
73
+ {i18n.t(group.title)}
73
74
  </Typography>
74
75
  </Time>
75
76
  <Divider size={4} />
@@ -314,7 +314,7 @@ export function ConfirmSwapPage(props: PropTypes) {
314
314
  return (
315
315
  <Layout
316
316
  header={{
317
- title: 'Confirm Swap',
317
+ title: i18n.t('Confirm Swap'),
318
318
  onBack: navigate.bind(null, -1),
319
319
  hasConnectWallet: true,
320
320
  suffix: (
@@ -342,7 +342,7 @@ export function ConfirmSwapPage(props: PropTypes) {
342
342
  loading={fetchingConfirmationRoute}
343
343
  disabled={!!confirmSwapResult.error}
344
344
  onClick={onStartConfirmSwap}>
345
- Start Swap
345
+ {i18n.t('Start Swap')}
346
346
  </Button>
347
347
  </div>
348
348
  <IconButton
@@ -364,7 +364,7 @@ export function ConfirmSwapPage(props: PropTypes) {
364
364
  variant="ghost"
365
365
  onClick={() => navigate('/' + navigationRoutes.settings)}>
366
366
  <Typography variant="label" size="medium" color="$neutral900">
367
- Change settings
367
+ {i18n.t('Change settings')}
368
368
  </Typography>
369
369
  </Button>
370
370
  }
@@ -376,8 +376,8 @@ export function ConfirmSwapPage(props: PropTypes) {
376
376
  title={
377
377
  confirmSwapResult.warnings.slippage.type ===
378
378
  SlippageWarningType.HIGH_SLIPPAGE
379
- ? 'High slippage'
380
- : 'Low slippage'
379
+ ? i18n.t('High slippage')
380
+ : i18n.t('Low slippage')
381
381
  }
382
382
  description={
383
383
  confirmSwapResult.warnings.slippage.type ===
@@ -411,7 +411,7 @@ export function ConfirmSwapPage(props: PropTypes) {
411
411
  variant="contained"
412
412
  fullWidth
413
413
  onClick={onConfirm}>
414
- Confirm anyway
414
+ {i18n.t('Confirm anyway')}
415
415
  </Button>
416
416
  </MessageBox>
417
417
  )}
@@ -430,7 +430,7 @@ export function ConfirmSwapPage(props: PropTypes) {
430
430
  <Container>
431
431
  <div className="description">
432
432
  <Typography variant="title" size="small">
433
- You get
433
+ {i18n.t('You get')}
434
434
  </Typography>
435
435
  <Button
436
436
  style={{ padding: '0' }}
@@ -86,7 +86,7 @@ export function HistoryPage() {
86
86
  setValue={setSearchedFor}
87
87
  fullWidth
88
88
  variant="contained"
89
- placeholder="Search Transaction"
89
+ placeholder={i18n.t('Search Transaction')}
90
90
  autoFocus
91
91
  onChange={searchHandler}
92
92
  value={searchedFor}
@@ -250,11 +250,18 @@ export function Home() {
250
250
  </Typography>
251
251
  <Divider direction="horizontal" size={8} />
252
252
  <Typography size="xsmall" variant="body" color="neutral900">
253
- {`Yours: ${numberToString(
254
- swapHasError?.fromAmount || null,
255
- TOKEN_AMOUNT_MIN_DECIMALS,
256
- TOKEN_AMOUNT_MAX_DECIMALS
257
- )} ${swap?.from.symbol}`}
253
+ {i18n.t({
254
+ id: 'yourSymbol',
255
+ message: 'Yours: {amount} {symbol}',
256
+ values: {
257
+ amount: numberToString(
258
+ swapHasError?.fromAmount || null,
259
+ TOKEN_AMOUNT_MIN_DECIMALS,
260
+ TOKEN_AMOUNT_MAX_DECIMALS
261
+ ),
262
+ symbol: swap?.from.symbol,
263
+ },
264
+ })}
258
265
  </Typography>
259
266
  </FooterAlert>
260
267
  }
@@ -313,7 +320,8 @@ export function Home() {
313
320
  <InputsContainer>
314
321
  <FromContainer>
315
322
  <SwapInput
316
- label="From"
323
+ label={i18n.t('From')}
324
+ mode="From"
317
325
  onInputChange={setInputAmount}
318
326
  balance={tokenBalance}
319
327
  chain={{
@@ -350,7 +358,8 @@ export function Home() {
350
358
  </FromContainer>
351
359
  <SwapInput
352
360
  sharpBottomStyle={!!bestRoute?.result || fetchingBestRoute}
353
- label="To"
361
+ label={i18n.t('To')}
362
+ mode="To"
354
363
  chain={{
355
364
  displayName: toBlockchain?.displayName || '',
356
365
  image: toBlockchain?.logo || '',
@@ -69,7 +69,7 @@ export function LanguagePage() {
69
69
  <List
70
70
  type={
71
71
  <ListItemButton
72
- title="language"
72
+ title={i18n.t('language')}
73
73
  id="_"
74
74
  onClick={() => console.log()}
75
75
  />
@@ -60,7 +60,7 @@ export function SettingsPage({ supportedSwappers, singleTheme }: PropTypes) {
60
60
  case 'failed':
61
61
  return (
62
62
  <Typography variant="body" size="medium" color="$error500">
63
- Loading failed
63
+ {i18n.t('Loading failed')}
64
64
  </Typography>
65
65
  );
66
66
  default:
@@ -82,7 +82,7 @@ export function ThemePage() {
82
82
  <List
83
83
  type={
84
84
  <ListItemButton
85
- title="Theme"
85
+ title={i18n.t('Theme')}
86
86
  id="_"
87
87
  onClick={() => console.log()}
88
88
  />