add a bunch of missing translations to the swap page

This commit is contained in:
Moody Salem 2021-05-29 00:16:57 -05:00
parent 3e9289dc35
commit f340537544
No known key found for this signature in database
GPG Key ID: 8CB5CD10385138DB
4 changed files with 117 additions and 22 deletions

@ -1,3 +1,4 @@
import { t, Trans } from '@lingui/macro'
import React, { useContext, useRef, useState } from 'react' import React, { useContext, useRef, useState } from 'react'
import { Settings, X } from 'react-feather' import { Settings, X } from 'react-feather'
import ReactGA from 'react-ga' import ReactGA from 'react-ga'
@ -138,31 +139,34 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa
<RowBetween style={{ padding: '0 2rem' }}> <RowBetween style={{ padding: '0 2rem' }}>
<div /> <div />
<Text fontWeight={500} fontSize={20}> <Text fontWeight={500} fontSize={20}>
Are you sure? <Trans>Are you sure?</Trans>
</Text> </Text>
<StyledCloseIcon onClick={() => setShowConfirmation(false)} /> <StyledCloseIcon onClick={() => setShowConfirmation(false)} />
</RowBetween> </RowBetween>
<Break /> <Break />
<AutoColumn gap="lg" style={{ padding: '0 2rem' }}> <AutoColumn gap="lg" style={{ padding: '0 2rem' }}>
<Text fontWeight={500} fontSize={20}> <Text fontWeight={500} fontSize={20}>
<Trans>
Expert mode turns off the confirm transaction prompt and allows high slippage trades that often result Expert mode turns off the confirm transaction prompt and allows high slippage trades that often result
in bad rates and lost funds. in bad rates and lost funds.
</Trans>
</Text> </Text>
<Text fontWeight={600} fontSize={20}> <Text fontWeight={600} fontSize={20}>
ONLY USE THIS MODE IF YOU KNOW WHAT YOU ARE DOING. <Trans>ONLY USE THIS MODE IF YOU KNOW WHAT YOU ARE DOING.</Trans>
</Text> </Text>
<ButtonError <ButtonError
error={true} error={true}
padding={'12px'} padding={'12px'}
onClick={() => { onClick={() => {
if (window.prompt(`Please type the word "confirm" to enable expert mode.`) === 'confirm') { const confirmWord = t`confirm`
if (window.prompt(t`Please type the word "${confirmWord}" to enable expert mode.`) === confirmWord) {
toggleExpertMode() toggleExpertMode()
setShowConfirmation(false) setShowConfirmation(false)
} }
}} }}
> >
<Text fontSize={20} fontWeight={500} id="confirm-expert-mode"> <Text fontSize={20} fontWeight={500} id="confirm-expert-mode">
Turn On Expert Mode <Trans>Turn On Expert Mode</Trans>
</Text> </Text>
</ButtonError> </ButtonError>
</AutoColumn> </AutoColumn>
@ -183,18 +187,20 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa
<MenuFlyout> <MenuFlyout>
<AutoColumn gap="md" style={{ padding: '1rem' }}> <AutoColumn gap="md" style={{ padding: '1rem' }}>
<Text fontWeight={600} fontSize={14}> <Text fontWeight={600} fontSize={14}>
Transaction Settings <Trans>Transaction Settings</Trans>
</Text> </Text>
<TransactionSettings placeholderSlippage={placeholderSlippage} /> <TransactionSettings placeholderSlippage={placeholderSlippage} />
<Text fontWeight={600} fontSize={14}> <Text fontWeight={600} fontSize={14}>
Interface Settings <Trans>Interface Settings</Trans>
</Text> </Text>
<RowBetween> <RowBetween>
<RowFixed> <RowFixed>
<TYPE.black fontWeight={400} fontSize={14} color={theme.text2}> <TYPE.black fontWeight={400} fontSize={14} color={theme.text2}>
Toggle Expert Mode <Trans>Toggle Expert Mode</Trans>
</TYPE.black> </TYPE.black>
<QuestionHelper text="Allow high price impact trades and skip the confirm screen. Use at your own risk." /> <QuestionHelper
text={t`Allow high price impact trades and skip the confirm screen. Use at your own risk.`}
/>
</RowFixed> </RowFixed>
<Toggle <Toggle
id="toggle-expert-mode-button" id="toggle-expert-mode-button"
@ -215,9 +221,9 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa
<RowBetween> <RowBetween>
<RowFixed> <RowFixed>
<TYPE.black fontWeight={400} fontSize={14} color={theme.text2}> <TYPE.black fontWeight={400} fontSize={14} color={theme.text2}>
Disable Multihops <Trans>Disable Multihops</Trans>
</TYPE.black> </TYPE.black>
<QuestionHelper text="Restricts swaps to direct pairs only." /> <QuestionHelper text={t`Restricts swaps to direct pairs only.`} />
</RowFixed> </RowFixed>
<Toggle <Toggle
id="toggle-disable-multihop-button" id="toggle-disable-multihop-button"

@ -1,3 +1,4 @@
import { t, Trans } from '@lingui/macro'
import React, { useState, useContext } from 'react' import React, { useState, useContext } from 'react'
import { Percent } from '@uniswap/sdk-core' import { Percent } from '@uniswap/sdk-core'
import styled, { ThemeContext } from 'styled-components' import styled, { ThemeContext } from 'styled-components'
@ -155,9 +156,11 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
<AutoColumn gap="sm"> <AutoColumn gap="sm">
<RowFixed> <RowFixed>
<TYPE.black fontWeight={400} fontSize={14} color={theme.text2}> <TYPE.black fontWeight={400} fontSize={14} color={theme.text2}>
Slippage tolerance <Trans>Slippage tolerance</Trans>
</TYPE.black> </TYPE.black>
<QuestionHelper text="Your transaction will revert if the price changes unfavorably by more than this percentage." /> <QuestionHelper
text={t`Your transaction will revert if the price changes unfavorably by more than this percentage.`}
/>
</RowFixed> </RowFixed>
<RowBetween> <RowBetween>
<Option <Option
@ -166,7 +169,7 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
}} }}
active={userSlippageTolerance === 'auto'} active={userSlippageTolerance === 'auto'}
> >
Auto <Trans>Auto</Trans>
</Option> </Option>
<OptionCustom active={userSlippageTolerance !== 'auto'} warning={!!slippageError} tabIndex={-1}> <OptionCustom active={userSlippageTolerance !== 'auto'} warning={!!slippageError} tabIndex={-1}>
<RowBetween> <RowBetween>
@ -206,10 +209,10 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
}} }}
> >
{slippageError {slippageError
? 'Enter a valid slippage percentage' ? t`Enter a valid slippage percentage`
: tooLow : tooLow
? 'Your transaction may fail' ? t`Your transaction may fail`
: 'Your transaction may be frontrun'} : t`Your transaction may be frontrun`}
</RowBetween> </RowBetween>
) : null} ) : null}
</AutoColumn> </AutoColumn>
@ -217,9 +220,9 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
<AutoColumn gap="sm"> <AutoColumn gap="sm">
<RowFixed> <RowFixed>
<TYPE.black fontSize={14} fontWeight={400} color={theme.text2}> <TYPE.black fontSize={14} fontWeight={400} color={theme.text2}>
Transaction deadline <Trans>Transaction deadline</Trans>
</TYPE.black> </TYPE.black>
<QuestionHelper text="Your transaction will revert if it is pending for more than this period of time." /> <QuestionHelper text={t`Your transaction will revert if it is pending for more than this period of time.`} />
</RowFixed> </RowFixed>
<RowFixed> <RowFixed>
<OptionCustom style={{ width: '80px' }} warning={!!deadlineError} tabIndex={-1}> <OptionCustom style={{ width: '80px' }} warning={!!deadlineError} tabIndex={-1}>
@ -241,7 +244,7 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
/> />
</OptionCustom> </OptionCustom>
<TYPE.body style={{ paddingLeft: '8px' }} fontSize={14}> <TYPE.body style={{ paddingLeft: '8px' }} fontSize={14}>
minutes <Trans>minutes</Trans>
</TYPE.body> </TYPE.body>
</RowFixed> </RowFixed>
</AutoColumn> </AutoColumn>

@ -1,3 +1,4 @@
import { Trans } from '@lingui/macro'
import React from 'react' import React from 'react'
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import SettingsTab from '../Settings' import SettingsTab from '../Settings'
@ -18,7 +19,7 @@ export default function SwapHeader({ allowedSlippage }: { allowedSlippage: Perce
<RowBetween> <RowBetween>
<RowFixed> <RowFixed>
<TYPE.black fontWeight={500} fontSize={16} style={{ marginRight: '8px' }}> <TYPE.black fontWeight={500} fontSize={16} style={{ marginRight: '8px' }}>
Swap{' '} <Trans>Swap</Trans>
</TYPE.black> </TYPE.black>
</RowFixed> </RowFixed>
<RowFixed> <RowFixed>

@ -211,6 +211,10 @@ msgstr ""
msgid "Allow LP token migration" msgid "Allow LP token migration"
msgstr "" msgstr ""
#: src/components/Settings/index.tsx
msgid "Allow high price impact trades and skip the confirm screen. Use at your own risk."
msgstr "Allow high price impact trades and skip the confirm screen. Use at your own risk."
#: src/pages/Swap/index.tsx #: src/pages/Swap/index.tsx
msgid "Allow the Uniswap Protocol to use your {0}" msgid "Allow the Uniswap Protocol to use your {0}"
msgstr "" msgstr ""
@ -255,6 +259,10 @@ msgstr ""
msgid "Approving {0}" msgid "Approving {0}"
msgstr "" msgstr ""
#: src/components/Settings/index.tsx
msgid "Are you sure?"
msgstr ""
#: src/components/claim/ClaimModal.tsx #: src/components/claim/ClaimModal.tsx
msgid "As a member of the Uniswap community you may claim UNI to be used for voting and governance.<0/><1/><2>Read more about UNI</2>" msgid "As a member of the Uniswap community you may claim UNI to be used for voting and governance.<0/><1/><2>Read more about UNI</2>"
msgstr "" msgstr ""
@ -263,6 +271,10 @@ msgstr ""
msgid "At least {0} {1} and {2} {3} will be refunded to your wallet due to selected price range." msgid "At least {0} {1} and {2} {3} will be refunded to your wallet due to selected price range."
msgstr "" msgstr ""
#: src/components/TransactionSettings/index.tsx
msgid "Auto"
msgstr "Auto"
#: src/components/earn/StakingModal.tsx #: src/components/earn/StakingModal.tsx
msgid "Available to deposit:" msgid "Available to deposit:"
msgstr "" msgstr ""
@ -564,6 +576,10 @@ msgstr ""
msgid "Details" msgid "Details"
msgstr "" msgstr ""
#: src/components/Settings/index.tsx
msgid "Disable Multihops"
msgstr ""
#: src/components/AccountDetails/index.tsx #: src/components/AccountDetails/index.tsx
msgid "Disconnect" msgid "Disconnect"
msgstr "" msgstr ""
@ -588,6 +604,10 @@ msgstr ""
msgid "Earned UNI tokens represent voting shares in Uniswap governance." msgid "Earned UNI tokens represent voting shares in Uniswap governance."
msgstr "" msgstr ""
#: src/components/TransactionSettings/index.tsx
msgid "Enter a valid slippage percentage"
msgstr "Enter a valid slippage percentage"
#: src/components/claim/AddressClaimModal.tsx #: src/components/claim/AddressClaimModal.tsx
msgid "Enter an address to trigger a UNI claim. If the address has any claimable UNI it will be sent to them on submission." msgid "Enter an address to trigger a UNI claim. If the address has any claimable UNI it will be sent to them on submission."
msgstr "" msgstr ""
@ -626,6 +646,10 @@ msgstr ""
msgid "Expanded results from inactive Token Lists" msgid "Expanded results from inactive Token Lists"
msgstr "" msgstr ""
#: src/components/Settings/index.tsx
msgid "Expert mode turns off the confirm transaction prompt and allows high slippage trades that often result in bad rates and lost funds."
msgstr ""
#: src/pages/Pool/CTACards.tsx #: src/pages/Pool/CTACards.tsx
msgid "Explore popular pools on Uniswap Analytics." msgid "Explore popular pools on Uniswap Analytics."
msgstr "" msgstr ""
@ -718,6 +742,10 @@ msgstr ""
msgid "Insufficient liquidity for this trade. Try enabling multi-hop trades." msgid "Insufficient liquidity for this trade. Try enabling multi-hop trades."
msgstr "" msgstr ""
#: src/components/Settings/index.tsx
msgid "Interface Settings"
msgstr ""
#: src/pages/PoolFinder/index.tsx #: src/pages/PoolFinder/index.tsx
msgid "Invalid pair." msgid "Invalid pair."
msgstr "" msgstr ""
@ -878,6 +906,10 @@ msgstr ""
msgid "No results found." msgid "No results found."
msgstr "" msgstr ""
#: src/components/Settings/index.tsx
msgid "ONLY USE THIS MODE IF YOU KNOW WHAT YOU ARE DOING."
msgstr ""
#: src/pages/AddLiquidityV2/index.tsx #: src/pages/AddLiquidityV2/index.tsx
msgid "Once you are happy with the rate click supply to review." msgid "Once you are happy with the rate click supply to review."
msgstr "" msgstr ""
@ -919,6 +951,10 @@ msgstr ""
msgid "Please connect to the appropriate Ethereum network." msgid "Please connect to the appropriate Ethereum network."
msgstr "" msgstr ""
#: src/components/Settings/index.tsx
msgid "Please type the word \"{confirmWord}\" to enable expert mode."
msgstr "Please type the word \"{confirmWord}\" to enable expert mode."
#: src/components/Header/index.tsx #: src/components/Header/index.tsx
#: src/components/NavigationTabs/index.tsx #: src/components/NavigationTabs/index.tsx
msgid "Pool" msgid "Pool"
@ -1060,6 +1096,10 @@ msgstr ""
msgid "Removing {0} {1} and {2} {3}" msgid "Removing {0} {1} and {2} {3}"
msgstr "" msgstr ""
#: src/components/Settings/index.tsx
msgid "Restricts swaps to direct pairs only."
msgstr "Restricts swaps to direct pairs only."
#: src/components/TransactionConfirmationModal/index.tsx #: src/components/TransactionConfirmationModal/index.tsx
msgid "Return" msgid "Return"
msgstr "" msgstr ""
@ -1124,6 +1164,10 @@ msgstr ""
msgid "Simple" msgid "Simple"
msgstr "" msgstr ""
#: src/components/TransactionSettings/index.tsx
msgid "Slippage tolerance"
msgstr "Slippage tolerance"
#: src/components/swap/UnsupportedCurrencyFooter.tsx #: src/components/swap/UnsupportedCurrencyFooter.tsx
msgid "Some assets are not available through this interface because they may not work well with the smart contracts or we are unable to allow trading for legal reasons." msgid "Some assets are not available through this interface because they may not work well with the smart contracts or we are unable to allow trading for legal reasons."
msgstr "" msgstr ""
@ -1146,6 +1190,7 @@ msgstr ""
#: src/components/Header/index.tsx #: src/components/Header/index.tsx
#: src/components/NavigationTabs/index.tsx #: src/components/NavigationTabs/index.tsx
#: src/components/swap/SwapHeader.tsx
#: src/pages/Swap/index.tsx #: src/pages/Swap/index.tsx
#: src/pages/Swap/index.tsx #: src/pages/Swap/index.tsx
msgid "Swap" msgid "Swap"
@ -1193,6 +1238,10 @@ msgstr ""
msgid "To (at least)" msgid "To (at least)"
msgstr "" msgstr ""
#: src/components/Settings/index.tsx
msgid "Toggle Expert Mode"
msgstr ""
#: src/components/SearchModal/Manage.tsx #: src/components/SearchModal/Manage.tsx
msgid "Tokens" msgid "Tokens"
msgstr "" msgstr ""
@ -1217,6 +1266,10 @@ msgstr ""
msgid "Total deposits" msgid "Total deposits"
msgstr "" msgstr ""
#: src/components/Settings/index.tsx
msgid "Transaction Settings"
msgstr ""
#: src/components/TransactionConfirmationModal/index.tsx #: src/components/TransactionConfirmationModal/index.tsx
#: src/components/earn/ClaimRewardModal.tsx #: src/components/earn/ClaimRewardModal.tsx
#: src/components/earn/StakingModal.tsx #: src/components/earn/StakingModal.tsx
@ -1226,10 +1279,18 @@ msgstr ""
msgid "Transaction Submitted" msgid "Transaction Submitted"
msgstr "" msgstr ""
#: src/components/TransactionSettings/index.tsx
msgid "Transaction deadline"
msgstr "Transaction deadline"
#: src/components/WalletModal/PendingView.tsx #: src/components/WalletModal/PendingView.tsx
msgid "Try Again" msgid "Try Again"
msgstr "" msgstr ""
#: src/components/Settings/index.tsx
msgid "Turn On Expert Mode"
msgstr ""
#: src/components/Header/UniBalanceContent.tsx #: src/components/Header/UniBalanceContent.tsx
msgid "UNI in circulation:" msgid "UNI in circulation:"
msgstr "" msgstr ""
@ -1553,6 +1614,22 @@ msgstr ""
msgid "Your transaction cost will be much higher as it includes the gas to create the pool." msgid "Your transaction cost will be much higher as it includes the gas to create the pool."
msgstr "" msgstr ""
#: src/components/TransactionSettings/index.tsx
msgid "Your transaction may be frontrun"
msgstr "Your transaction may be frontrun"
#: src/components/TransactionSettings/index.tsx
msgid "Your transaction may fail"
msgstr "Your transaction may fail"
#: src/components/TransactionSettings/index.tsx
msgid "Your transaction will revert if it is pending for more than this period of time."
msgstr "Your transaction will revert if it is pending for more than this period of time."
#: src/components/TransactionSettings/index.tsx
msgid "Your transaction will revert if the price changes unfavorably by more than this percentage."
msgstr "Your transaction will revert if the price changes unfavorably by more than this percentage."
#: src/components/AccountDetails/index.tsx #: src/components/AccountDetails/index.tsx
msgid "Your transactions will appear here..." msgid "Your transactions will appear here..."
msgstr "" msgstr ""
@ -1561,6 +1638,10 @@ msgstr ""
msgid "Your unclaimed UNI" msgid "Your unclaimed UNI"
msgstr "" msgstr ""
#: src/components/Settings/index.tsx
msgid "confirm"
msgstr "confirm"
#: src/components/claim/AddressClaimModal.tsx #: src/components/claim/AddressClaimModal.tsx
msgid "for {0}" msgid "for {0}"
msgstr "" msgstr ""
@ -1569,6 +1650,10 @@ msgstr ""
msgid "has socks emoji" msgid "has socks emoji"
msgstr "" msgstr ""
#: src/components/TransactionSettings/index.tsx
msgid "minutes"
msgstr "minutes"
#: src/components/SearchModal/ImportRow.tsx #: src/components/SearchModal/ImportRow.tsx
msgid "via {0}" msgid "via {0}"
msgstr "" msgstr ""