From c9364abb5f4ab77ad800c0dfd39d4d62417441ad Mon Sep 17 00:00:00 2001 From: gregs Date: Tue, 17 Oct 2023 14:52:14 -0300 Subject: [PATCH] fix some swap/bridge translations (#1059) --- .../TokenDropdown/TokenToBuySection.tsx | 4 +++- .../TokenDropdown/TokenToSellDropdown.tsx | 17 +++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/entries/popup/pages/swap/SwapTokenInput/TokenDropdown/TokenToBuySection.tsx b/src/entries/popup/pages/swap/SwapTokenInput/TokenDropdown/TokenToBuySection.tsx index 65ba0bdc98..b38c7af096 100644 --- a/src/entries/popup/pages/swap/SwapTokenInput/TokenDropdown/TokenToBuySection.tsx +++ b/src/entries/popup/pages/swap/SwapTokenInput/TokenDropdown/TokenToBuySection.tsx @@ -14,6 +14,7 @@ import { AssetToBuySection, AssetToBuySectionId, } from '~/entries/popup/hooks/useSearchCurrencyLists'; +import { useTranslationContext } from '~/entries/popup/hooks/useTranslationContext'; import { useVirtualizedAssets } from '~/entries/popup/hooks/useVirtualizedAssets'; import { TokenToBuyRow } from '../TokenRow/TokenToBuyRow'; @@ -113,6 +114,7 @@ export const TokenToBuySection = ({ onSelectAsset?: (asset: ParsedSearchAsset | null) => void; onDropdownChange: (open: boolean) => void; }) => { + const t = useTranslationContext(); const { containerRef, assetsRowVirtualizer } = useVirtualizedAssets({ assets: assetSection.data, size: 5, @@ -138,7 +140,7 @@ export const TokenToBuySection = ({ - {i18n.t('swap.tokens_input.nothing_found')} + {t('swap.tokens_input.nothing_found')} diff --git a/src/entries/popup/pages/swap/SwapTokenInput/TokenDropdown/TokenToSellDropdown.tsx b/src/entries/popup/pages/swap/SwapTokenInput/TokenDropdown/TokenToSellDropdown.tsx index 1c4de85719..78226dd799 100644 --- a/src/entries/popup/pages/swap/SwapTokenInput/TokenDropdown/TokenToSellDropdown.tsx +++ b/src/entries/popup/pages/swap/SwapTokenInput/TokenDropdown/TokenToSellDropdown.tsx @@ -1,10 +1,9 @@ import { motion } from 'framer-motion'; -import React from 'react'; -import { i18n } from '~/core/languages'; import { ParsedSearchAsset } from '~/core/types/assets'; import { Bleed, Box, Inline, Stack, Symbol, Text } from '~/design-system'; import { SortMethod } from '~/entries/popup/hooks/send/useSendAsset'; +import { useTranslationContext } from '~/entries/popup/hooks/useTranslationContext'; import { useVirtualizedAssets } from '~/entries/popup/hooks/useVirtualizedAssets'; import { dropdownContainerVariant } from '../../../../components/DropdownInputWrapper/DropdownInputWrapper'; @@ -39,6 +38,8 @@ export const TokenToSellDropdown = ({ size: 10, }); + const t = useTranslationContext(); + return ( @@ -51,7 +52,7 @@ export const TokenToSellDropdown = ({ size={14} /> - {i18n.t('swap.tokens_input.tokens')} + {t('swap.tokens_input.tokens')} @@ -68,7 +69,7 @@ export const TokenToSellDropdown = ({ size={14} /> - {i18n.t('swap.tokens_input.sort')} + {t('swap.tokens_input.sort')} @@ -97,7 +98,7 @@ export const TokenToSellDropdown = ({ - {i18n.t('swap.tokens_input.token_balance')} + {t('swap.tokens_input.token_balance')} @@ -115,7 +116,7 @@ export const TokenToSellDropdown = ({ - {i18n.t('swap.tokens_input.networks')} + {t('swap.tokens_input.networks')} @@ -161,7 +162,7 @@ export const TokenToSellDropdown = ({ weight="semibold" align="center" > - {i18n.t('swap.tokens_input.nothing_found')} + {t('swap.tokens_input.nothing_found')} - {i18n.t('swap.tokens_input.nothing_found_description')} + {t('swap.tokens_input.nothing_found_description')}