diff --git a/src/pages/advertiser/screens/AdvertiserAdvertsTable/AdvertiserAdvertsTable.tsx b/src/pages/advertiser/screens/AdvertiserAdvertsTable/AdvertiserAdvertsTable.tsx index b6d2dc3a..7a9a4f46 100644 --- a/src/pages/advertiser/screens/AdvertiserAdvertsTable/AdvertiserAdvertsTable.tsx +++ b/src/pages/advertiser/screens/AdvertiserAdvertsTable/AdvertiserAdvertsTable.tsx @@ -5,6 +5,7 @@ import { ErrorModal, LoadingModal } from '@/components/Modals'; import { ADVERT_TYPE, BUY_SELL, BUY_SELL_URL } from '@/constants'; import { api } from '@/hooks'; import { useIsAdvertiser, useIsAdvertiserBarred, useModalManager, useQueryString } from '@/hooks/custom-hooks'; +import { getLocalizedTabs } from '@/utils/tabs'; import { useTranslations } from '@deriv-com/translations'; import { Tab, Tabs } from '@deriv-com/ui'; import { AdvertsTableRenderer } from './AdvertsTableRenderer'; @@ -76,7 +77,12 @@ const AdvertiserAdvertsTable = ({ advertiserId }: TAdvertiserAdvertsTableProps) return (
- + diff --git a/src/pages/buy-sell/screens/BuySellHeader/BuySellHeader.tsx b/src/pages/buy-sell/screens/BuySellHeader/BuySellHeader.tsx index ccedd3b7..fcb922f4 100644 --- a/src/pages/buy-sell/screens/BuySellHeader/BuySellHeader.tsx +++ b/src/pages/buy-sell/screens/BuySellHeader/BuySellHeader.tsx @@ -4,6 +4,7 @@ import { FilterModal } from '@/components/Modals'; import { getSortByList } from '@/constants'; import { useIsAdvertiserBarred, useModalManager } from '@/hooks/custom-hooks'; import { TSortByValues } from '@/utils'; +import { getLocalizedTabs } from '@/utils/tabs'; import { LabelPairedBarsFilterMdBoldIcon, LabelPairedBarsFilterSmBoldIcon } from '@deriv/quill-icons'; import { useTranslations } from '@deriv-com/translations'; import { Button, Tab, Tabs, useDevice } from '@deriv-com/ui'; @@ -53,7 +54,7 @@ const BuySellHeader = ({ > {
{ setQueryString({ diff --git a/src/pages/orders/screens/Orders/OrdersTableHeader/OrdersTableHeader.tsx b/src/pages/orders/screens/Orders/OrdersTableHeader/OrdersTableHeader.tsx index 8c15e1eb..da24ab78 100644 --- a/src/pages/orders/screens/Orders/OrdersTableHeader/OrdersTableHeader.tsx +++ b/src/pages/orders/screens/Orders/OrdersTableHeader/OrdersTableHeader.tsx @@ -1,5 +1,6 @@ import { ORDERS_STATUS } from '@/constants/orders'; import { useQueryString } from '@/hooks/custom-hooks'; +import { getLocalizedTabs } from '@/utils/tabs'; import { useTranslations } from '@deriv-com/translations'; import { Tab, Tabs, useDevice } from '@deriv-com/ui'; import './OrdersTableHeader.scss'; @@ -17,7 +18,7 @@ const OrdersTableHeader = ({ activeTab }: TOrdersTableHeaderProps) => {
setQueryString({ tab: index === 0 ? ORDERS_STATUS.ACTIVE_ORDERS : ORDERS_STATUS.PAST_ORDERS, diff --git a/src/utils/tabs.ts b/src/utils/tabs.ts new file mode 100644 index 00000000..64fe83ed --- /dev/null +++ b/src/utils/tabs.ts @@ -0,0 +1,16 @@ +import { TLocalize } from 'types'; + +/** + * The below function is a temporary solution to get handle the tab switching when switching the language. + * @returns the localized tabs based on the current language. + */ +export const getLocalizedTabs = (localize: TLocalize): { [tab: string]: string } => ({ + 'Active orders': localize('Active orders'), + 'Ad details': localize('Ad details'), + Buy: localize('Buy'), + 'My counterparties': localize('My counterparties'), + 'Past orders': localize('Past orders'), + 'Payment methods': localize('Payment methods'), + Sell: localize('Sell'), + Stats: localize('Stats'), +});