From f3405375441a94c4e3a0e28ac33bcad4e1741654 Mon Sep 17 00:00:00 2001 From: Moody Salem Date: Sat, 29 May 2021 00:16:57 -0500 Subject: [PATCH] add a bunch of missing translations to the swap page --- src/components/Settings/index.tsx | 30 ++++--- src/components/TransactionSettings/index.tsx | 21 ++--- src/components/swap/SwapHeader.tsx | 3 +- src/locales/en-US.po | 85 ++++++++++++++++++++ 4 files changed, 117 insertions(+), 22 deletions(-) diff --git a/src/components/Settings/index.tsx b/src/components/Settings/index.tsx index 8b8b9f77aa..f59e0ee81d 100644 --- a/src/components/Settings/index.tsx +++ b/src/components/Settings/index.tsx @@ -1,3 +1,4 @@ +import { t, Trans } from '@lingui/macro' import React, { useContext, useRef, useState } from 'react' import { Settings, X } from 'react-feather' import ReactGA from 'react-ga' @@ -138,31 +139,34 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa
- Are you sure? + Are you sure? setShowConfirmation(false)} /> - Expert mode turns off the confirm transaction prompt and allows high slippage trades that often result - in bad rates and lost funds. + + Expert mode turns off the confirm transaction prompt and allows high slippage trades that often result + in bad rates and lost funds. + - ONLY USE THIS MODE IF YOU KNOW WHAT YOU ARE DOING. + ONLY USE THIS MODE IF YOU KNOW WHAT YOU ARE DOING. { - 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() setShowConfirmation(false) } }} > - Turn On Expert Mode + Turn On Expert Mode @@ -183,18 +187,20 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa - Transaction Settings + Transaction Settings - Interface Settings + Interface Settings - Toggle Expert Mode + Toggle Expert Mode - + - Disable Multihops + Disable Multihops - + - Slippage tolerance + Slippage tolerance - + @@ -206,10 +209,10 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction }} > {slippageError - ? 'Enter a valid slippage percentage' + ? t`Enter a valid slippage percentage` : tooLow - ? 'Your transaction may fail' - : 'Your transaction may be frontrun'} + ? t`Your transaction may fail` + : t`Your transaction may be frontrun`} ) : null} @@ -217,9 +220,9 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction - Transaction deadline + Transaction deadline - + @@ -241,7 +244,7 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction /> - minutes + minutes diff --git a/src/components/swap/SwapHeader.tsx b/src/components/swap/SwapHeader.tsx index 6d3d9329a9..9f88bc1321 100644 --- a/src/components/swap/SwapHeader.tsx +++ b/src/components/swap/SwapHeader.tsx @@ -1,3 +1,4 @@ +import { Trans } from '@lingui/macro' import React from 'react' import styled from 'styled-components/macro' import SettingsTab from '../Settings' @@ -18,7 +19,7 @@ export default function SwapHeader({ allowedSlippage }: { allowedSlippage: Perce - Swap{' '} + Swap diff --git a/src/locales/en-US.po b/src/locales/en-US.po index 317f984817..5c3b56dc12 100644 --- a/src/locales/en-US.po +++ b/src/locales/en-US.po @@ -211,6 +211,10 @@ msgstr "" msgid "Allow LP token migration" 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 msgid "Allow the Uniswap Protocol to use your {0}" msgstr "" @@ -255,6 +259,10 @@ msgstr "" msgid "Approving {0}" msgstr "" +#: src/components/Settings/index.tsx +msgid "Are you sure?" +msgstr "" + #: 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" 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." msgstr "" +#: src/components/TransactionSettings/index.tsx +msgid "Auto" +msgstr "Auto" + #: src/components/earn/StakingModal.tsx msgid "Available to deposit:" msgstr "" @@ -564,6 +576,10 @@ msgstr "" msgid "Details" msgstr "" +#: src/components/Settings/index.tsx +msgid "Disable Multihops" +msgstr "" + #: src/components/AccountDetails/index.tsx msgid "Disconnect" msgstr "" @@ -588,6 +604,10 @@ msgstr "" msgid "Earned UNI tokens represent voting shares in Uniswap governance." msgstr "" +#: src/components/TransactionSettings/index.tsx +msgid "Enter a valid slippage percentage" +msgstr "Enter a valid slippage percentage" + #: 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." msgstr "" @@ -626,6 +646,10 @@ msgstr "" msgid "Expanded results from inactive Token Lists" 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 msgid "Explore popular pools on Uniswap Analytics." msgstr "" @@ -718,6 +742,10 @@ msgstr "" msgid "Insufficient liquidity for this trade. Try enabling multi-hop trades." msgstr "" +#: src/components/Settings/index.tsx +msgid "Interface Settings" +msgstr "" + #: src/pages/PoolFinder/index.tsx msgid "Invalid pair." msgstr "" @@ -878,6 +906,10 @@ msgstr "" msgid "No results found." msgstr "" +#: src/components/Settings/index.tsx +msgid "ONLY USE THIS MODE IF YOU KNOW WHAT YOU ARE DOING." +msgstr "" + #: src/pages/AddLiquidityV2/index.tsx msgid "Once you are happy with the rate click supply to review." msgstr "" @@ -919,6 +951,10 @@ msgstr "" msgid "Please connect to the appropriate Ethereum network." 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/NavigationTabs/index.tsx msgid "Pool" @@ -1060,6 +1096,10 @@ msgstr "" msgid "Removing {0} {1} and {2} {3}" 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 msgid "Return" msgstr "" @@ -1124,6 +1164,10 @@ msgstr "" msgid "Simple" msgstr "" +#: src/components/TransactionSettings/index.tsx +msgid "Slippage tolerance" +msgstr "Slippage tolerance" + #: 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." msgstr "" @@ -1146,6 +1190,7 @@ msgstr "" #: src/components/Header/index.tsx #: src/components/NavigationTabs/index.tsx +#: src/components/swap/SwapHeader.tsx #: src/pages/Swap/index.tsx #: src/pages/Swap/index.tsx msgid "Swap" @@ -1193,6 +1238,10 @@ msgstr "" msgid "To (at least)" msgstr "" +#: src/components/Settings/index.tsx +msgid "Toggle Expert Mode" +msgstr "" + #: src/components/SearchModal/Manage.tsx msgid "Tokens" msgstr "" @@ -1217,6 +1266,10 @@ msgstr "" msgid "Total deposits" msgstr "" +#: src/components/Settings/index.tsx +msgid "Transaction Settings" +msgstr "" + #: src/components/TransactionConfirmationModal/index.tsx #: src/components/earn/ClaimRewardModal.tsx #: src/components/earn/StakingModal.tsx @@ -1226,10 +1279,18 @@ msgstr "" msgid "Transaction Submitted" msgstr "" +#: src/components/TransactionSettings/index.tsx +msgid "Transaction deadline" +msgstr "Transaction deadline" + #: src/components/WalletModal/PendingView.tsx msgid "Try Again" msgstr "" +#: src/components/Settings/index.tsx +msgid "Turn On Expert Mode" +msgstr "" + #: src/components/Header/UniBalanceContent.tsx msgid "UNI in circulation:" msgstr "" @@ -1553,6 +1614,22 @@ msgstr "" msgid "Your transaction cost will be much higher as it includes the gas to create the pool." 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 msgid "Your transactions will appear here..." msgstr "" @@ -1561,6 +1638,10 @@ msgstr "" msgid "Your unclaimed UNI" msgstr "" +#: src/components/Settings/index.tsx +msgid "confirm" +msgstr "confirm" + #: src/components/claim/AddressClaimModal.tsx msgid "for {0}" msgstr "" @@ -1569,6 +1650,10 @@ msgstr "" msgid "has socks emoji" msgstr "" +#: src/components/TransactionSettings/index.tsx +msgid "minutes" +msgstr "minutes" + #: src/components/SearchModal/ImportRow.tsx msgid "via {0}" msgstr ""