-
-
-
+
{localize('Regulation:')}
{
is_selected={region === traders_hub.selected_region}
onClick={() => traders_hub.selectRegion(region)}
>
-
+ {region}
);
})}
diff --git a/packages/appstore/src/components/modals/failed-veriification-modal/failed-verification-modal.tsx b/packages/appstore/src/components/modals/failed-veriification-modal/failed-verification-modal.tsx
index 99ddc43b9835..d359e637109b 100644
--- a/packages/appstore/src/components/modals/failed-veriification-modal/failed-verification-modal.tsx
+++ b/packages/appstore/src/components/modals/failed-veriification-modal/failed-verification-modal.tsx
@@ -2,7 +2,7 @@ import React from 'react';
import { observer } from 'mobx-react-lite';
import { useStores } from 'Stores';
import { useHistory } from 'react-router-dom';
-import { Localize, useLocalize } from '@deriv/translations';
+import { localize, Localize } from '@deriv/translations';
import { Text, Dialog } from '@deriv/components';
import { isMobile, getAuthenticationStatusInfo, routes, Jurisdiction } from '@deriv/shared';
import './failed-verification-modal.scss';
@@ -64,7 +64,6 @@ const FailedVerificationModalContent = ({
};
const FailedVerificationModal = () => {
- const { localize } = useLocalize();
const {
traders_hub,
ui,
diff --git a/packages/appstore/src/components/modals/open-positions-svg-modal/open-positions-svg-modal.tsx b/packages/appstore/src/components/modals/open-positions-svg-modal/open-positions-svg-modal.tsx
index b49e449ce76d..e3affcb41094 100644
--- a/packages/appstore/src/components/modals/open-positions-svg-modal/open-positions-svg-modal.tsx
+++ b/packages/appstore/src/components/modals/open-positions-svg-modal/open-positions-svg-modal.tsx
@@ -2,7 +2,7 @@ import React from 'react';
import { Button, Modal, Text } from '@deriv/components';
import { Jurisdiction, MT5_ACCOUNT_STATUS, getMT5AccountTitle } from '@deriv/shared';
import { useStore } from '@deriv/stores';
-import { Localize, useLocalize } from '@deriv/translations';
+import { Localize, localize } from '@deriv/translations';
import { TTradingPlatformAvailableAccount } from '../account-type-modal/types';
import { TMarketType } from '../../../types/common.types';
@@ -14,7 +14,6 @@ type TOpenPositionsSVGModal = {
};
const OpenPositionsSVGModal = ({ market_type, status, is_modal_open, setModalOpen }: TOpenPositionsSVGModal) => {
- const { localize } = useLocalize();
const { client } = useStore();
const { mt5_login_list } = client;
const eligible_accounts = mt5_login_list?.filter(
diff --git a/packages/appstore/src/components/modals/regulators-compare-modal/regulators-compare-modal-content.tsx b/packages/appstore/src/components/modals/regulators-compare-modal/regulators-compare-modal-content.tsx
index 3ffe73916ce7..dc63d16c7f00 100644
--- a/packages/appstore/src/components/modals/regulators-compare-modal/regulators-compare-modal-content.tsx
+++ b/packages/appstore/src/components/modals/regulators-compare-modal/regulators-compare-modal-content.tsx
@@ -1,6 +1,6 @@
import React from 'react';
import { Table, Div100vhContainer, Text, ThemedScrollbars } from '@deriv/components';
-import { Localize } from '@deriv/translations';
+import { localize } from '@deriv/translations';
import { isDesktop, isMobile } from '@deriv/shared';
import {
getCFDContents,
@@ -64,10 +64,10 @@ const RegulatorsCompareModalContent = () => {
-
+ {localize('Non-EU regulation')}
-
+ {localize('EU regulation')}
diff --git a/packages/appstore/src/components/modals/regulators-compare-modal/regulators-compare-modal.tsx b/packages/appstore/src/components/modals/regulators-compare-modal/regulators-compare-modal.tsx
index 64981a6e311e..bacaa2634476 100644
--- a/packages/appstore/src/components/modals/regulators-compare-modal/regulators-compare-modal.tsx
+++ b/packages/appstore/src/components/modals/regulators-compare-modal/regulators-compare-modal.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import { useDevice } from '@deriv-com/ui';
import { observer, useStore } from '@deriv/stores';
-import { Localize } from '@deriv/translations';
+import { localize } from '@deriv/translations';
import { Modal, MobileDialog, UILoader } from '@deriv/components';
import RegulatorsCompareModalContent from './regulators-compare-modal-content';
import './regulators-compare-modal.scss';
@@ -22,7 +22,7 @@ const RegulatorsCompareModal = () => {
disableApp={disableApp}
enableApp={enableApp}
is_open={is_regulators_compare_modal_visible}
- title={
}
+ title={localize('Non-EU and EU regulation')}
toggleModal={closeModal}
height='792px'
width='792px'
@@ -32,7 +32,7 @@ const RegulatorsCompareModal = () => {
) : (
}
+ title={localize('Non-EU and EU regulation')}
visible={is_regulators_compare_modal_visible}
onClose={closeModal}
>
diff --git a/packages/appstore/src/components/modals/wallets-upgrade-modal/wallets-upgrade-modal.tsx b/packages/appstore/src/components/modals/wallets-upgrade-modal/wallets-upgrade-modal.tsx
index 3f5ff180a170..ba83db5e96f4 100644
--- a/packages/appstore/src/components/modals/wallets-upgrade-modal/wallets-upgrade-modal.tsx
+++ b/packages/appstore/src/components/modals/wallets-upgrade-modal/wallets-upgrade-modal.tsx
@@ -2,7 +2,7 @@ import React from 'react';
import classNames from 'classnames';
import { Stream } from '@cloudflare/stream-react';
import { Button, Text, Modal } from '@deriv/components';
-import { Localize } from '@deriv/translations';
+import { localize, Localize } from '@deriv/translations';
import { observer, useStore } from '@deriv/stores';
import { useWalletMigration } from '@deriv/hooks';
import './wallets-upgrade-modal.scss';
@@ -68,9 +68,7 @@ const WalletsUpgradeModal = observer(() => {
'wallets-upgrade-modal__footer--mobile': is_mobile,
})}
>
-
+
diff --git a/packages/appstore/src/components/multi-action-button-group/multi-action-button-group.tsx b/packages/appstore/src/components/multi-action-button-group/multi-action-button-group.tsx
index 5cb446cea466..abbd206c5e8d 100644
--- a/packages/appstore/src/components/multi-action-button-group/multi-action-button-group.tsx
+++ b/packages/appstore/src/components/multi-action-button-group/multi-action-button-group.tsx
@@ -1,5 +1,5 @@
import { Button } from '@deriv/components';
-import { Localize } from '@deriv/translations';
+import { localize } from '@deriv/translations';
import { Actions } from 'Components/containers/trading-app-card-actions';
import TradeButton from 'Components/trade-button';
import React from 'react';
@@ -25,7 +25,7 @@ const MultiActionButtonGroup = ({
onClick={onAction}
is_disabled={is_buttons_disabled}
>
- {is_real ?
:
}
+ {is_real ? localize('Transfer') : localize('Top up')}
diff --git a/packages/appstore/src/components/options-multipliers-listing/index.tsx b/packages/appstore/src/components/options-multipliers-listing/index.tsx
index 4643419e0c1d..5f724b28a73b 100644
--- a/packages/appstore/src/components/options-multipliers-listing/index.tsx
+++ b/packages/appstore/src/components/options-multipliers-listing/index.tsx
@@ -3,7 +3,7 @@ import { observer } from 'mobx-react-lite';
import { Text, StaticUrl } from '@deriv/components';
import { ContentFlag, setPerformanceValue } from '@deriv/shared';
import { useStore } from '@deriv/stores';
-import { Localize, useLocalize } from '@deriv/translations';
+import { Localize, localize } from '@deriv/translations';
import { useDevice } from '@deriv-com/ui';
import ListingContainer from 'Components/containers/listing-container';
import TradingAppCard from 'Components/containers/trading-app-card';
@@ -14,7 +14,6 @@ import PlatformLoader from 'Components/pre-loader/platform-loader';
import OptionsDescription from 'Components/elements/options-description';
const OptionsAndMultipliersListing = observer(() => {
- const { localize } = useLocalize();
const { isDesktop } = useDevice();
const { traders_hub, client, ui } = useStore();
const {
diff --git a/packages/appstore/src/components/routes/routes.tsx b/packages/appstore/src/components/routes/routes.tsx
index 97277223c634..6a699c6a9ca7 100644
--- a/packages/appstore/src/components/routes/routes.tsx
+++ b/packages/appstore/src/components/routes/routes.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
import { Loading } from '@deriv/components';
import { observer, useStore } from '@deriv/stores';
-import { useLocalize } from '@deriv/translations';
+import { localize } from '@deriv/translations';
import { routes } from '@deriv/shared';
import { Switch } from 'react-router-dom';
import RouteWithSubroutes from './route-with-sub-routes.jsx';
@@ -14,7 +14,6 @@ const TradersHubLoggedOut = React.lazy(
const Page404 = React.lazy(() => import(/* */ 'Modules/Page404'));
const Routes: React.FC = observer(() => {
- const { localize } = useLocalize();
const { client } = useStore();
const { is_logged_in, is_logging_in } = client;
diff --git a/packages/appstore/src/components/trade-button/trade-button.tsx b/packages/appstore/src/components/trade-button/trade-button.tsx
index e97748d2dbf8..f517ca368921 100644
--- a/packages/appstore/src/components/trade-button/trade-button.tsx
+++ b/packages/appstore/src/components/trade-button/trade-button.tsx
@@ -2,7 +2,7 @@ import React from 'react';
import { Link } from 'react-router-dom';
import { Button } from '@deriv/components';
import { observer, useStore } from '@deriv/stores';
-import { Localize } from '@deriv/translations';
+import { localize } from '@deriv/translations';
import { Actions } from 'Components/containers/trading-app-card-actions';
const TradeButton = observer(
@@ -24,31 +24,25 @@ const TradeButton = observer(
if (new_tab) {
return (
-
+
);
}
return (
-
+
);
}
return (
-
+
);
} else if (onAction) {
return (
);
}
@@ -64,7 +58,7 @@ const TradeButton = observer(
rel='noopener noreferrer'
>
);
diff --git a/packages/appstore/src/modules/Page404/Components/Page404.tsx b/packages/appstore/src/modules/Page404/Components/Page404.tsx
index 90c839d54768..448e3952ddc7 100644
--- a/packages/appstore/src/modules/Page404/Components/Page404.tsx
+++ b/packages/appstore/src/modules/Page404/Components/Page404.tsx
@@ -1,24 +1,17 @@
import React from 'react';
import { PageError } from '@deriv/components';
import { routes, getUrlBase } from '@deriv/shared';
-import { Localize } from '@deriv/translations';
+import { localize } from '@deriv/translations';
const Page404 = () => (
}
+ header={localize('We couldn’t find that page')}
messages={[
-
,
-
,
+ localize('You may have followed a broken link, or the page has moved to a new address.'),
+ localize('Error code: {{error_code}} page not found', { error_code: 404 }),
]}
redirect_urls={[routes.traders_hub]}
- redirect_labels={[
]}
+ redirect_labels={[localize("Return to Trader's Hub")]}
classNameImage='page-404__image'
image_url={getUrlBase('/public/images/common/404.png')}
/>
diff --git a/packages/appstore/src/modules/traders-hub/index.tsx b/packages/appstore/src/modules/traders-hub/index.tsx
index c364a35b23dc..718df1476b81 100644
--- a/packages/appstore/src/modules/traders-hub/index.tsx
+++ b/packages/appstore/src/modules/traders-hub/index.tsx
@@ -2,7 +2,7 @@ import React, { lazy, Suspense } from 'react';
import { ButtonToggle, Div100vhContainer, Text } from '@deriv/components';
import { routes, checkServerMaintenance, startPerformanceEventTimer } from '@deriv/shared';
import { observer, useStore } from '@deriv/stores';
-import { Localize, useLocalize } from '@deriv/translations';
+import { Localize, localize } from '@deriv/translations';
import { useDevice } from '@deriv-com/ui';
import CFDsListing from 'Components/cfds-listing';
import ModalManager from 'Components/modals/modal-manager';
@@ -41,7 +41,6 @@ const OrderedPlatformSections = observer(
);
const TradersHub = observer(() => {
- const { localize } = useLocalize();
const { isDesktop } = useDevice();
const { traders_hub, client, ui } = useStore();
const {
diff --git a/packages/translations/src/components/localize.jsx b/packages/translations/src/components/localize.jsx
index 34de78642935..80496f2d19f9 100644
--- a/packages/translations/src/components/localize.jsx
+++ b/packages/translations/src/components/localize.jsx
@@ -1,22 +1,17 @@
import PropTypes from 'prop-types';
import React from 'react';
-import { Trans, useTranslation } from 'react-i18next';
+import { Trans } from 'react-i18next';
-const Localize = ({ i18n_default_text, values, components, options, i18n, shouldUnescape }) => {
- const { t } = useTranslation();
-
- return (
-
- );
-};
+const Localize = ({ i18n_default_text, values, components, options, i18n, shouldUnescape }) => (
+
+);
// Trans needs to have the i18n instance in scope
// eslint-disable-next-line react/display-name
diff --git a/packages/translations/src/i18next/i18next.ts b/packages/translations/src/i18next/i18next.ts
index 6019eebed87d..cfbb4555e936 100644
--- a/packages/translations/src/i18next/i18next.ts
+++ b/packages/translations/src/i18next/i18next.ts
@@ -1,6 +1,6 @@
import { str as crc32 } from 'crc-32';
import i18n from 'i18next';
-import { initReactI18next, useTranslation } from 'react-i18next';
+import { initReactI18next } from 'react-i18next';
import { isProduction } from '../../../shared/src/utils/config/config';
import withI18n from '../components';
@@ -169,12 +169,6 @@ export const localize = (string: string, values?: Record
) => {
return i18n.t(crc32(string).toString(), { defaultValue: string, ...values });
};
-export const useLocalize = () => {
- useTranslation();
-
- return { localize };
-};
-
const loadIncontextTranslation = () => {
const is_ach = getLanguage().toUpperCase() === 'ACH';
if (is_ach) {