From 60f77a6ffaf3cf39b3806038b91cfb619dc1f137 Mon Sep 17 00:00:00 2001 From: Abhishek Naidu Date: Mon, 1 May 2023 21:13:07 +0530 Subject: [PATCH] chore: remove all translations code (#907) * chore: remove all translations * chore: remove more things * chore: remove i18 * change yarn lock --- package.json | 2 - src/components/banks/ApproveToken/index.tsx | 5 +- src/components/banks/Deposit/index.tsx | 17 +- src/components/banks/EtherScanLink/index.tsx | 4 +- src/components/banks/SignInButton/index.tsx | 5 +- src/components/common/LoadingPopUp/index.tsx | 7 +- src/components/common/TextInput/index.tsx | 4 +- src/components/common/WalletButton/index.tsx | 4 +- src/components/layout/CoinBalance/index.tsx | 5 +- src/components/layout/CoinRateForm/index.tsx | 6 +- src/components/layout/InvestNav/index.tsx | 30 +- src/components/layout/MobileMenu/index.tsx | 10 +- src/components/layout/PanelChange/index.tsx | 32 +- .../layout/UpgradeDowngradeButtons/index.tsx | 15 +- src/components/layout/UserSettings/index.tsx | 13 +- src/containers/main/HeaderContainer/index.tsx | 22 +- .../main/InvestContainer/InvestMarket.tsx | 18 +- src/containers/main/InvestContainer/index.tsx | 10 +- .../main/RecentActivityContainer/index.tsx | 5 +- src/containers/main/ReferContainer/index.tsx | 27 +- .../main/UpgradeContainer/index.tsx | 25 +- src/containers/modal/ModalMetamask/index.tsx | 4 +- src/containers/modal/ModalNetwork/index.tsx | 10 +- .../modal/ModalSelectToken/index.tsx | 13 +- src/hooks/useLang.ts | 16 - src/i18n/de/index.ts | 7 - src/i18n/de/main.json | 3 - src/i18n/en/index.ts | 7 - src/i18n/en/main.json | 146 - src/i18n/index.ts | 8 - src/i18n/utils/index.ts | 57 - src/index.tsx | 1 - src/pages/ClaimPage/index.tsx | 1 - .../referralValidationRedirectPage.tsx | 8 +- src/pages/WalletPage/index.tsx | 4 +- yarn.lock | 7967 ++++++++--------- 36 files changed, 4058 insertions(+), 4460 deletions(-) delete mode 100644 src/hooks/useLang.ts delete mode 100644 src/i18n/de/index.ts delete mode 100644 src/i18n/de/main.json delete mode 100644 src/i18n/en/index.ts delete mode 100644 src/i18n/en/main.json delete mode 100644 src/i18n/index.ts delete mode 100644 src/i18n/utils/index.ts diff --git a/package.json b/package.json index dbfd793..cf47277 100644 --- a/package.json +++ b/package.json @@ -64,14 +64,12 @@ "eslint-config-react-app": "6", "ethers": "^5.5.4", "graphql": "^16.3.0", - "i18next": "^21.3.2", "javascript-time-ago": "^2.3.11", "ramda": "^0.27.1", "react": "^17.0.2", "react-cookie": "^4.1.1", "react-dom": "^17.0.2", "react-flow-renderer": "^10.3.1", - "react-i18next": "^11.18.1", "react-loading-skeleton": "^3.1.0", "react-modal": "3.12.1", "react-popper": "^2.3.0", diff --git a/src/components/banks/ApproveToken/index.tsx b/src/components/banks/ApproveToken/index.tsx index eafe21c..00aabc0 100644 --- a/src/components/banks/ApproveToken/index.tsx +++ b/src/components/banks/ApproveToken/index.tsx @@ -1,7 +1,6 @@ import React, { FC } from 'react'; import { Button } from 'components/common/Button'; import { LoadingWrapper } from 'components/common/LoadingWrapper'; -import { useTranslation } from 'react-i18next'; import styles from './styles.module.scss'; type Props = { @@ -10,12 +9,10 @@ type Props = { }; export const ApproveToken: FC = ({ isLoadingApprove, onApproveClick }) => { - const { t } = useTranslation(); - return (
-
); diff --git a/src/components/banks/Deposit/index.tsx b/src/components/banks/Deposit/index.tsx index 8a5812e..c14e60a 100644 --- a/src/components/banks/Deposit/index.tsx +++ b/src/components/banks/Deposit/index.tsx @@ -5,7 +5,6 @@ import { ApproveToken } from 'components/banks/ApproveToken'; import { LoadingWrapper } from 'components/common/LoadingWrapper'; import { EtherscanLink } from 'components/banks/EtherScanLink'; import { Button } from 'components/common/Button'; -import { useTranslation } from 'react-i18next'; import styles from './styles.module.scss'; type Props = { @@ -34,7 +33,6 @@ export const Deposit: FC = ({ error, }) => { const needsUnlock = +vaultData.depositAmount > +bank.collateralToken.unlockedAmount && !localApproved; - const { t } = useTranslation(); return ( <> @@ -42,9 +40,7 @@ export const Deposit: FC = ({

- {`${t('How much')} ${vaultData.collateralToken} ${t( - 'do you want to lock up as collateral?', - )}`} + {`${'How much'} ${vaultData.collateralToken} ${'do you want to lock up as collateral?'}`}

= ({ {needsUnlock ? ( <>

- {t('Please give allowance for your collateral to continue.')} + {'Please give allowance for your collateral to continue.'}

) : null}
-
diff --git a/src/components/banks/EtherScanLink/index.tsx b/src/components/banks/EtherScanLink/index.tsx index b76ff81..8c32255 100644 --- a/src/components/banks/EtherScanLink/index.tsx +++ b/src/components/banks/EtherScanLink/index.tsx @@ -1,6 +1,5 @@ import React, { FC } from 'react'; import cx from 'classnames'; -import { useTranslation } from 'react-i18next'; import styles from './styles.module.scss'; type Props = { @@ -26,12 +25,11 @@ export const EtherscanLink: FC = ({ path, hash, className }) => { } } }; - const { t } = useTranslation(); return ( ); diff --git a/src/components/banks/SignInButton/index.tsx b/src/components/banks/SignInButton/index.tsx index ff6e885..62b4250 100644 --- a/src/components/banks/SignInButton/index.tsx +++ b/src/components/banks/SignInButton/index.tsx @@ -2,7 +2,6 @@ import React, { FC } from 'react'; import cx from 'classnames'; import { Button } from 'components/common/Button'; import { FontIcon, FontIconName } from 'components/common/FontIcon'; -import { useTranslation } from 'react-i18next'; import styles from './styles.module.scss'; type Props = { @@ -11,12 +10,10 @@ type Props = { }; export const SignInButton: FC = ({ className, onClick }) => { - const { t } = useTranslation(); - return ( ); }; diff --git a/src/components/common/LoadingPopUp/index.tsx b/src/components/common/LoadingPopUp/index.tsx index 9fd348a..ecce74c 100644 --- a/src/components/common/LoadingPopUp/index.tsx +++ b/src/components/common/LoadingPopUp/index.tsx @@ -1,22 +1,19 @@ import React from 'react'; import { FontIcon, FontIconName } from 'components/common/FontIcon'; -import { useTranslation } from 'react-i18next'; import styles from './styles.module.scss'; export const LoadingPopUp = () => { - const { t } = useTranslation(); - return (
-

{t('Please hold on while we load your information.')}

+

{'Please hold on while we load your information.'}

-

{t('This will only take a few moments')}

+

{'This will only take a few moments'}

); }; diff --git a/src/components/common/TextInput/index.tsx b/src/components/common/TextInput/index.tsx index 11f2b9d..d60d06d 100644 --- a/src/components/common/TextInput/index.tsx +++ b/src/components/common/TextInput/index.tsx @@ -1,6 +1,5 @@ import React, { FC, HTMLProps } from 'react'; import classNames from 'classnames'; -import { useTranslation } from 'react-i18next'; import styles from './styles.module.scss'; import { TextInputWrap } from '../TextInputWrap'; import ButtonNew from '../ButtonNew'; @@ -42,7 +41,6 @@ const TextInput: FC = ({ dontBlockChar = false, ...props }) => { - const { t } = useTranslation(); const blockInvalidChar = (e: any) => ['e', 'E', '+', '-'].includes(e.key) && e.preventDefault(); return ( @@ -68,7 +66,7 @@ const TextInput: FC = ({ onClick={onClickMax} className={styles.max} > - {t('Max')} + {'Max'}
)} diff --git a/src/components/common/WalletButton/index.tsx b/src/components/common/WalletButton/index.tsx index 3e21e76..c0b4fe8 100644 --- a/src/components/common/WalletButton/index.tsx +++ b/src/components/common/WalletButton/index.tsx @@ -5,7 +5,6 @@ import { numFormatter } from 'utils/balances'; import { useDispatch } from 'react-redux'; import { connectWeb3Modal } from 'store/main/actionCreators'; import useENS from 'hooks/useENS'; -import { useTranslation } from 'react-i18next'; import styles from './styles.module.scss'; interface IProps { @@ -16,8 +15,7 @@ interface IProps { export const WalletButton: FC = ({ ricBalance = '', account, mobile }) => { const dispatch = useDispatch(); - const { t } = useTranslation(); - const preConnect = account === t('Connect Wallet'); + const preConnect = account === 'Connect Wallet'; const [connecting, setConnecting] = useState(false); const { ensName, ensAvatar } = useENS(account); //this solution doesn't work properly, examples: if user has pop ups disabled diff --git a/src/components/layout/CoinBalance/index.tsx b/src/components/layout/CoinBalance/index.tsx index bad4268..b7de7ce 100644 --- a/src/components/layout/CoinBalance/index.tsx +++ b/src/components/layout/CoinBalance/index.tsx @@ -1,6 +1,5 @@ import React, { FC } from 'react'; import ButtonNew from 'components/common/ButtonNew'; -import { useTranslation } from 'i18n'; import { Coin, iconsCoin } from '../../../constants/coins'; import styles from './styles.module.scss'; @@ -12,8 +11,6 @@ interface IProps { } export const CoinBalance: FC = ({ nameCoin, balance, className, onClickMax }) => { - const { t } = useTranslation(); - return (
@@ -25,7 +22,7 @@ export const CoinBalance: FC = ({ nameCoin, balance, className, onClickM
{nameCoin}
diff --git a/src/components/layout/InvestNav/index.tsx b/src/components/layout/InvestNav/index.tsx index 8971159..4ddf751 100644 --- a/src/components/layout/InvestNav/index.tsx +++ b/src/components/layout/InvestNav/index.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { FontIcon, FontIconName } from 'components/common/FontIcon'; import { NavLink } from 'react-router-dom'; import { Routes } from 'constants/routes'; -import { useTranslation } from 'react-i18next'; +import currency from 'assets/images/coins/currency.svg'; import { useShallowSelector } from 'hooks/useShallowSelector'; import { selectUserStreams } from 'store/main/selectors'; import gift from 'assets/images/gift.svg'; @@ -11,7 +11,6 @@ import { RICOCHET_LEGACY_LINK, SUPPORT, TUTORIAL_LINK } from 'utils/helpers'; export const InvestNav = () => { const userStreams = useShallowSelector(selectUserStreams); - const { t } = useTranslation(); return (
@@ -24,23 +23,23 @@ export const InvestNav = () => { to={Routes.InvestStreams} > -
{`${t('Active Streams')} (${userStreams.length})`}
+
{`${'Active Streams'} (${userStreams.length})`}
) : null} -
{t('Wallet')}
+
{'Wallet'}
-
{t('Market')}
+
{'Market'}
-
{t('Swap')}
+
{'Swap'}
@@ -51,16 +50,20 @@ export const InvestNav = () => { height="16" style={{ filter: 'invert(1)', marginRight: '3px' }} /> -
{t('Gifts')}
+
{'Gifts'}
+ + currency +
{'Payments'}
+
-
{t('Launchpad')}
+
{'Launchpad'}
{ activeClassName={styles.nav_link_active} > -
{t('Activity')}
+
{'Activity'}
-
{t('Refer')}
+
{'Refer'}
-
{t('Support')}
+
{'Support'}
-
{t('Tutorial')}
+
{'Tutorial'}
+ -
{t('Ricochet V2')}
+
{'Ricochet V2'}
diff --git a/src/components/layout/MobileMenu/index.tsx b/src/components/layout/MobileMenu/index.tsx index 73db56a..2e82358 100644 --- a/src/components/layout/MobileMenu/index.tsx +++ b/src/components/layout/MobileMenu/index.tsx @@ -1,7 +1,6 @@ import React, { FC } from 'react'; import Link from 'components/common/Link'; import { NavLink } from 'react-router-dom'; -import { useTranslation } from 'i18n'; import { Routes } from '../../../constants/routes'; import styles from './styles.module.scss'; import { RICOCHET_LEGACY_LINK } from 'utils/helpers'; @@ -11,7 +10,6 @@ interface IProps { } export const MobileMenu: FC = ({ closeMenu }) => { - const { t } = useTranslation(); return (