Commit 4b72d757 authored by Moody Salem's avatar Moody Salem

chore: add a bunch of missing translation keys

parent 63affd98
...@@ -235,7 +235,7 @@ export default function CurrencyInputPanel({ ...@@ -235,7 +235,7 @@ export default function CurrencyInputPanel({
? currency.symbol.slice(0, 4) + ? currency.symbol.slice(0, 4) +
'...' + '...' +
currency.symbol.slice(currency.symbol.length - 5, currency.symbol.length) currency.symbol.slice(currency.symbol.length - 5, currency.symbol.length)
: currency?.symbol) || t`Select a token`} : currency?.symbol) || <Trans>Select a token</Trans>}
</StyledTokenName> </StyledTokenName>
)} )}
</RowFixed> </RowFixed>
......
import { Trans } from '@lingui/macro'
import React, { ErrorInfo } from 'react' import React, { ErrorInfo } from 'react'
import store, { AppState } from '../../state' import store, { AppState } from '../../state'
import { ExternalLink, ThemedBackground, TYPE } from '../../theme' import { ExternalLink, ThemedBackground, TYPE } from '../../theme'
...@@ -74,7 +75,7 @@ export default class ErrorBoundary extends React.Component<unknown, ErrorBoundar ...@@ -74,7 +75,7 @@ export default class ErrorBoundary extends React.Component<unknown, ErrorBoundar
<AutoColumn gap={'md'}> <AutoColumn gap={'md'}>
<SomethingWentWrongWrapper> <SomethingWentWrongWrapper>
<TYPE.label fontSize={24} fontWeight={600}> <TYPE.label fontSize={24} fontWeight={600}>
Something went wrong <Trans>Something went wrong</Trans>
</TYPE.label> </TYPE.label>
</SomethingWentWrongWrapper> </SomethingWentWrongWrapper>
<CodeBlockWrapper> <CodeBlockWrapper>
...@@ -92,7 +93,7 @@ export default class ErrorBoundary extends React.Component<unknown, ErrorBoundar ...@@ -92,7 +93,7 @@ export default class ErrorBoundary extends React.Component<unknown, ErrorBoundar
target="_blank" target="_blank"
> >
<TYPE.link fontSize={16}> <TYPE.link fontSize={16}>
Create an issue on GitHub <Trans>Create an issue on GitHub</Trans>
<span></span> <span></span>
</TYPE.link> </TYPE.link>
</ExternalLink> </ExternalLink>
...@@ -100,7 +101,7 @@ export default class ErrorBoundary extends React.Component<unknown, ErrorBoundar ...@@ -100,7 +101,7 @@ export default class ErrorBoundary extends React.Component<unknown, ErrorBoundar
<LinkWrapper> <LinkWrapper>
<ExternalLink id="get-support-on-discord" href="https://discord.gg/FCfyBSbCU5" target="_blank"> <ExternalLink id="get-support-on-discord" href="https://discord.gg/FCfyBSbCU5" target="_blank">
<TYPE.link fontSize={16}> <TYPE.link fontSize={16}>
Get support on Discord <Trans>Get support on Discord</Trans>
<span></span> <span></span>
</TYPE.link> </TYPE.link>
</ExternalLink> </ExternalLink>
......
import { BigNumber } from '@ethersproject/bignumber' import { BigNumber } from '@ethersproject/bignumber'
import { t } from '@lingui/macro'
import { Router, Trade as V2Trade } from '@uniswap/v2-sdk' import { Router, Trade as V2Trade } from '@uniswap/v2-sdk'
import { SwapRouter, Trade as V3Trade } from '@uniswap/v3-sdk' import { SwapRouter, Trade as V3Trade } from '@uniswap/v3-sdk'
import { Currency, Percent, TradeType } from '@uniswap/sdk-core' import { Currency, Percent, TradeType } from '@uniswap/sdk-core'
...@@ -201,28 +202,28 @@ export function swapErrorToUserReadableMessage(error: any): string { ...@@ -201,28 +202,28 @@ export function swapErrorToUserReadableMessage(error: any): string {
switch (reason) { switch (reason) {
case 'UniswapV2Router: EXPIRED': case 'UniswapV2Router: EXPIRED':
return 'The transaction could not be sent because the deadline has passed. Please check that your transaction deadline is not too low.' return t`The transaction could not be sent because the deadline has passed. Please check that your transaction deadline is not too low.`
case 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT': case 'UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT':
case 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT': case 'UniswapV2Router: EXCESSIVE_INPUT_AMOUNT':
return 'This transaction will not succeed either due to price movement or fee on transfer. Try increasing your slippage tolerance.' return t`This transaction will not succeed either due to price movement or fee on transfer. Try increasing your slippage tolerance.`
case 'TransferHelper: TRANSFER_FROM_FAILED': case 'TransferHelper: TRANSFER_FROM_FAILED':
return 'The input token cannot be transferred. There may be an issue with the input token.' return t`The input token cannot be transferred. There may be an issue with the input token.`
case 'UniswapV2: TRANSFER_FAILED': case 'UniswapV2: TRANSFER_FAILED':
return 'The output token cannot be transferred. There may be an issue with the output token.' return t`The output token cannot be transferred. There may be an issue with the output token.`
case 'UniswapV2: K': case 'UniswapV2: K':
return 'The Uniswap invariant x*y=k was not satisfied by the swap. This usually means one of the tokens you are swapping incorporates custom behavior on transfer.' return t`The Uniswap invariant x*y=k was not satisfied by the swap. This usually means one of the tokens you are swapping incorporates custom behavior on transfer.`
case 'Too little received': case 'Too little received':
case 'Too much requested': case 'Too much requested':
case 'STF': case 'STF':
return 'This transaction will not succeed due to price movement. Try increasing your slippage tolerance. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.' return t`This transaction will not succeed due to price movement. Try increasing your slippage tolerance. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.`
case 'TF': case 'TF':
return 'The output token cannot be transferred. There may be an issue with the output token. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.' return t`The output token cannot be transferred. There may be an issue with the output token. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.`
default: default:
if (reason?.indexOf('undefined is not an object') !== -1) { if (reason?.indexOf('undefined is not an object') !== -1) {
console.error(error, reason) console.error(error, reason)
return 'An error occurred when trying to execute this swap. You may need to increase your slippage tolerance. If that does not work, there may be an incompatibility with the token you are trading. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.' return t`An error occurred when trying to execute this swap. You may need to increase your slippage tolerance. If that does not work, there may be an incompatibility with the token you are trading. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.`
} }
return `Unknown error${ return t`Unknown error${
reason ? `: "${reason}"` : '' reason ? `: "${reason}"` : ''
}. Try increasing your slippage tolerance. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.` }. Try increasing your slippage tolerance. Note fee on transfer and rebase tokens are incompatible with Uniswap V3.`
} }
......
import React, { useContext, useMemo } from 'react' import React, { ReactNode, useContext, useMemo } from 'react'
import { Pair } from '@uniswap/v2-sdk' import { Pair } from '@uniswap/v2-sdk'
import { Token } from '@uniswap/sdk-core' import { Token } from '@uniswap/sdk-core'
import { ThemeContext } from 'styled-components' import { ThemeContext } from 'styled-components'
...@@ -20,7 +20,7 @@ import { getCreate2Address } from '@ethersproject/address' ...@@ -20,7 +20,7 @@ import { getCreate2Address } from '@ethersproject/address'
import { pack, keccak256 } from '@ethersproject/solidity' import { pack, keccak256 } from '@ethersproject/solidity'
import { t, Trans } from '@lingui/macro' import { t, Trans } from '@lingui/macro'
function EmptyState({ message }: { message: string }) { function EmptyState({ message }: { message: ReactNode }) {
return ( return (
<AutoColumn style={{ minHeight: 200, justifyContent: 'center', alignItems: 'center' }}> <AutoColumn style={{ minHeight: 200, justifyContent: 'center', alignItems: 'center' }}>
<TYPE.body>{message}</TYPE.body> <TYPE.body>{message}</TYPE.body>
...@@ -160,7 +160,7 @@ export default function MigrateV2() { ...@@ -160,7 +160,7 @@ export default function MigrateV2() {
})} })}
</> </>
) : ( ) : (
<EmptyState message="No V2 Liquidity found." /> <EmptyState message={<Trans>No V2 Liquidity found.</Trans>} />
)} )}
<AutoColumn justify={'center'} gap="md"> <AutoColumn justify={'center'} gap="md">
......
import { t } from '@lingui/macro'
import JSBI from 'jsbi' import JSBI from 'jsbi'
import { Trade as V3Trade } from '@uniswap/v3-sdk' import { Trade as V3Trade } from '@uniswap/v3-sdk'
import { useBestV3TradeExactIn, useBestV3TradeExactOut, V3TradeState } from '../../hooks/useBestV3Trade' import { useBestV3TradeExactIn, useBestV3TradeExactOut, V3TradeState } from '../../hooks/useBestV3Trade'
...@@ -173,27 +174,27 @@ export function useDerivedSwapInfo(toggledVersion: Version): { ...@@ -173,27 +174,27 @@ export function useDerivedSwapInfo(toggledVersion: Version): {
let inputError: string | undefined let inputError: string | undefined
if (!account) { if (!account) {
inputError = 'Connect Wallet' inputError = t`Connect Wallet`
} }
if (!parsedAmount) { if (!parsedAmount) {
inputError = inputError ?? 'Enter an amount' inputError = inputError ?? t`Enter an amount`
} }
if (!currencies[Field.INPUT] || !currencies[Field.OUTPUT]) { if (!currencies[Field.INPUT] || !currencies[Field.OUTPUT]) {
inputError = inputError ?? 'Select a token' inputError = inputError ?? t`Select a token`
} }
const formattedTo = isAddress(to) const formattedTo = isAddress(to)
if (!to || !formattedTo) { if (!to || !formattedTo) {
inputError = inputError ?? 'Enter a recipient' inputError = inputError ?? t`Enter a recipient`
} else { } else {
if ( if (
BAD_RECIPIENT_ADDRESSES[formattedTo] || BAD_RECIPIENT_ADDRESSES[formattedTo] ||
(bestV2TradeExactIn && involvesAddress(bestV2TradeExactIn, formattedTo)) || (bestV2TradeExactIn && involvesAddress(bestV2TradeExactIn, formattedTo)) ||
(bestV2TradeExactOut && involvesAddress(bestV2TradeExactOut, formattedTo)) (bestV2TradeExactOut && involvesAddress(bestV2TradeExactOut, formattedTo))
) { ) {
inputError = inputError ?? 'Invalid recipient' inputError = inputError ?? t`Invalid recipient`
} }
} }
...@@ -204,7 +205,7 @@ export function useDerivedSwapInfo(toggledVersion: Version): { ...@@ -204,7 +205,7 @@ export function useDerivedSwapInfo(toggledVersion: Version): {
const [balanceIn, amountIn] = [currencyBalances[Field.INPUT], v2Trade?.maximumAmountIn(allowedSlippage)] const [balanceIn, amountIn] = [currencyBalances[Field.INPUT], v2Trade?.maximumAmountIn(allowedSlippage)]
if (balanceIn && amountIn && balanceIn.lessThan(amountIn)) { if (balanceIn && amountIn && balanceIn.lessThan(amountIn)) {
inputError = 'Insufficient ' + amountIn.currency.symbol + ' balance' inputError = t`Insufficient ${amountIn.currency.symbol} balance`
} }
return { return {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment