Skip to content

Commit

Permalink
fix: translations for direct component renders
Browse files Browse the repository at this point in the history
  • Loading branch information
farabi-deriv committed Sep 24, 2024
1 parent 7beac7e commit e707ca3
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 18 deletions.
8 changes: 3 additions & 5 deletions src/components/bot-stopped.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import { observer } from 'mobx-react-lite';
import Text from '@/components/shared_ui/text';
import { useStore } from '@/hooks/useStore';
import { localize } from '@/utils/tmp/dummy';
import { LegacyClose1pxIcon } from '@deriv/quill-icons';
import { Localize, localize } from '@deriv-com/translations';
import Dialog from './shared_ui/dialog';

const BotStopped = observer(() => {
Expand All @@ -24,7 +24,7 @@ const BotStopped = observer(() => {
>
<div className='dc-dialog__content__header'>
<Text data-testid='data-title' weight='bold' as='p' align='left' size='s' color='prominent'>
{localize("You're back online")}
<Localize i18n_default_text="You're back online" />
</Text>
<div
data-testid='data-close-button'
Expand All @@ -40,9 +40,7 @@ const BotStopped = observer(() => {
</div>
</div>
<Text as='p' align='left' size='xs' color='prominent'>
{localize(
'The bot has stopped, but your trade may still be running. You can check it on the Reports page.'
)}
<Localize i18n_default_text='The bot has stopped, but your trade may still be running. You can check it on the Reports page.' />
</Text>
</Dialog>
);
Expand Down
3 changes: 1 addition & 2 deletions src/components/route-prompt-dialog/route-prompt-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import { observer } from 'mobx-react-lite';
import { useStore } from '@/hooks/useStore';
import { localize } from '@/utils/tmp/dummy';
import { Localize } from '@deriv-com/translations';
import { Localize, localize } from '@deriv-com/translations';
import Dialog from '../shared_ui/dialog';

const RoutePromptDialog = observer(() => {
Expand Down
3 changes: 1 addition & 2 deletions src/components/shared/utils/helpers/chart-notifications.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { localize } from '@/utils/tmp/dummy';
import { Localize } from '@deriv-com/translations';

export const switch_to_tick_chart = {
key: 'switch_to_tick_chart',
header: localize('This chart display is not ideal for tick contracts'),
header: <Localize i18n_default_text='This chart display is not ideal for tick contracts' />,
message: <Localize i18n_default_text='Please change the chart duration to tick for a better trading experience.' />,
type: 'info',
};
2 changes: 1 addition & 1 deletion src/components/trading-view-chart/trading-view-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { observer } from 'mobx-react-lite';
import DraggableResizeWrapper from '@/components/draggable/draggable-resize-wrapper';
import TradingViewComponent from '@/components/trading-view-chart/trading-view';
import { useStore } from '@/hooks/useStore';
import { localize } from '@/utils/tmp/dummy';
import { localize } from '@deriv-com/translations';

const TradingViewModal = observer(() => {
const { dashboard } = useStore();
Expand Down
2 changes: 1 addition & 1 deletion src/pages/chart/chart-modal/chart-modal-desktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { observer } from 'mobx-react-lite';
import DraggableResizeWrapper from '@/components/draggable/draggable-resize-wrapper';
import { useStore } from '@/hooks/useStore';
import { localize } from '@/utils/tmp/dummy';
import { localize } from '@deriv-com/translations';
import Chart from '..';

const ChartModalDesktop = observer(() => {
Expand Down
9 changes: 4 additions & 5 deletions src/pages/dashboard/load-bot-preview/dashboard-bot-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,28 @@ import { observer } from 'mobx-react-lite';
import Text from '@/components/shared_ui/text';
import { getSavedWorkspaces } from '@/external/bot-skeleton';
import { useStore } from '@/hooks/useStore';
import { localize } from '@/utils/tmp/dummy';
import { Localize } from '@deriv-com/translations';
import { useDevice } from '@deriv-com/ui';
import DeleteDialog from './delete-dialog';
import RecentWorkspace from './recent-workspace';
import './index.scss';

type THeader = {
label: string;
label: React.ReactElement;
className: string;
};

const HEADERS: THeader[] = [
{
label: localize('Bot name'),
label: <Localize i18n_default_text='Bot name' />,
className: 'bot-list__header__label',
},
{
label: localize('Last modified'),
label: <Localize i18n_default_text='Last modified' />,
className: 'bot-list__header__time-stamp',
},
{
label: localize('Status'),
label: <Localize i18n_default_text='Status' />,
className: 'bot-list__header__load-type',
},
];
Expand Down
3 changes: 1 addition & 2 deletions src/pages/main/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ import dbot from '@/external/bot-skeleton/scratch/dbot';
import { api_base } from '@/external/bot-skeleton/services/api/api-base';
import { isDbotRTL } from '@/external/bot-skeleton/utils/workspace';
import { useStore } from '@/hooks/useStore';
import { localize } from '@/utils/tmp/dummy';
import {
LabelPairedChartLineCaptionRegularIcon,
LabelPairedObjectsColumnCaptionRegularIcon,
LabelPairedPuzzlePieceTwoCaptionBoldIcon,
LegacyGuide1pxIcon,
} from '@deriv/quill-icons';
import { Localize } from '@deriv-com/translations';
import { Localize, localize } from '@deriv-com/translations';
import { useDevice } from '@deriv-com/ui';
import RunPanel from '../../components/run-panel';
import Chart from '../chart';
Expand Down

0 comments on commit e707ca3

Please sign in to comment.