From c6d6ba44bed00553fc8d3e91cdbe77d8ce9360b4 Mon Sep 17 00:00:00 2001 From: Farabi <102643568+farabi-deriv@users.noreply.github.com> Date: Fri, 21 Jul 2023 16:52:30 +0800 Subject: [PATCH] Farabi/bot 317/translation fixes for dbot homepage (#9108) * fix: translation issues * redeploy: vercel retrigger --------- Co-authored-by: Ali(Ako) Hosseini --- .../src/scratch/blocks/Math/math_modulo.js | 2 +- .../load-bot-preview/recent.tsx | 4 +-- .../components/dashboard/joyride-config.tsx | 2 -- .../data/data-fields.ts | 15 +++++------ .../dashboard/tour-trigger-dialog.tsx | 25 ++++++++----------- 5 files changed, 22 insertions(+), 26 deletions(-) diff --git a/packages/bot-skeleton/src/scratch/blocks/Math/math_modulo.js b/packages/bot-skeleton/src/scratch/blocks/Math/math_modulo.js index 004e1af2c7c6..05c0d983084d 100755 --- a/packages/bot-skeleton/src/scratch/blocks/Math/math_modulo.js +++ b/packages/bot-skeleton/src/scratch/blocks/Math/math_modulo.js @@ -34,7 +34,7 @@ Blockly.Blocks.math_modulo = { meta() { return { display_name: localize('Remainder after division'), - description: localize(' Returns the remainder after the division of the given numbers.'), + description: localize('Returns the remainder after the division of the given numbers.'), }; }, getRequiredValueInputs() { diff --git a/packages/bot-web-ui/src/components/dashboard/dashboard-component/load-bot-preview/recent.tsx b/packages/bot-web-ui/src/components/dashboard/dashboard-component/load-bot-preview/recent.tsx index 3652b6931f24..4ec5accfdb37 100644 --- a/packages/bot-web-ui/src/components/dashboard/dashboard-component/load-bot-preview/recent.tsx +++ b/packages/bot-web-ui/src/components/dashboard/dashboard-component/load-bot-preview/recent.tsx @@ -3,7 +3,7 @@ import classNames from 'classnames'; import { getSavedWorkspaces } from '@deriv/bot-skeleton'; import { MobileWrapper, Text } from '@deriv/components'; import { isMobile } from '@deriv/shared'; -import { Localize } from '@deriv/translations'; +import { Localize, localize } from '@deriv/translations'; import { connect } from 'Stores/connect'; import RootStore from 'Stores/index'; import { TWorkspace } from 'Stores/load-modal-store'; @@ -19,7 +19,7 @@ type TRecentComponent = { strategy_save_type: string; }; -const HEADERS = ['Bot name', 'Last modified', 'Status']; +const HEADERS = [localize('Bot name'), localize('Last modified'), localize('Status')]; const RecentComponent = ({ dashboard_strategies, diff --git a/packages/bot-web-ui/src/components/dashboard/joyride-config.tsx b/packages/bot-web-ui/src/components/dashboard/joyride-config.tsx index 96cad2a8f764..59c832983d2a 100644 --- a/packages/bot-web-ui/src/components/dashboard/joyride-config.tsx +++ b/packages/bot-web-ui/src/components/dashboard/joyride-config.tsx @@ -184,7 +184,6 @@ export const DBOT_ONBOARDING = [ step_index={6} /> ), - locale: { last: localize('Next') }, ...joyride_props, disableOverlay: false, }, @@ -457,7 +456,6 @@ export const BOT_BUILDER_TOUR = [ { target: '.animation__wrapper', content: , - locale: { last: localize('Next') }, ...joyride_props, }, ]; diff --git a/packages/bot-web-ui/src/components/dashboard/quick-strategy/quick-strategy-components/data/data-fields.ts b/packages/bot-web-ui/src/components/dashboard/quick-strategy/quick-strategy-components/data/data-fields.ts index 7f9ab8d5a313..3ea8562ec529 100644 --- a/packages/bot-web-ui/src/components/dashboard/quick-strategy/quick-strategy-components/data/data-fields.ts +++ b/packages/bot-web-ui/src/components/dashboard/quick-strategy/quick-strategy-components/data/data-fields.ts @@ -1,3 +1,4 @@ +import { localize } from '@deriv/translations'; import { TDropdownItems, TInputBaseFields, TInputsFieldNames, TSelectsFieldNames } from '../../quick-strategy.types'; import { common_inputs_properties } from '..'; import { TCommonInputsProperties } from './common-input-properties'; @@ -30,28 +31,28 @@ const data_fields: ReadonlyArray = [ field_name: 'quick-strategy__symbol', className: 'quick-strategy__dropdown quick-strategy__leading', select_value: 'symbol', - label: 'Asset', + label: localize('Asset'), }, { id: 'trade-type', field_name: 'quick-strategy__trade-type', className: 'quick-strategy__dropdown quick-strategy__leading', select_value: 'trade-type', - label: 'Trade type', + label: localize('Trade type'), }, { id: 'duration-unit', field_name: 'quick-strategy__duration-unit', className: '', select_value: 'duration-unit', - label: 'Duration unit', + label: localize('Duration unit'), is_able_disabled: true, }, { id: 'duration-value', field_name: 'quick-strategy__duration-value', input_value: 'input_duration_value', - label: 'Duration value', + label: localize('Duration value'), placeholder: '5', trailing_icon_message: 'The trade length of your purchased contract.', ...common_inputs_properties, @@ -60,7 +61,7 @@ const data_fields: ReadonlyArray = [ id: 'stake', field_name: 'quick-strategy__stake', input_value: 'input_stake', - label: 'Initial stake', + label: localize('Initial stake'), placeholder: '10', trailing_icon_message: 'The amount that you pay to enter a trade.', ...common_inputs_properties, @@ -69,7 +70,7 @@ const data_fields: ReadonlyArray = [ id: 'loss', field_name: 'quick-strategy__loss', input_value: 'input_loss', - label: 'Loss threshold', + label: localize('Loss threshold'), placeholder: '5000', trailing_icon_message: getMessage('loss'), ...common_inputs_properties, @@ -84,7 +85,7 @@ const data_fields: ReadonlyArray = [ id: 'profit', field_name: 'quick-strategy__profit', input_value: 'input_profit', - label: 'Profit threshold', + label: localize('Profit threshold'), placeholder: '5000', trailing_icon_message: getMessage('profit'), ...common_inputs_properties, diff --git a/packages/bot-web-ui/src/components/dashboard/tour-trigger-dialog.tsx b/packages/bot-web-ui/src/components/dashboard/tour-trigger-dialog.tsx index e7959c304a5a..fa11c0c6ab24 100644 --- a/packages/bot-web-ui/src/components/dashboard/tour-trigger-dialog.tsx +++ b/packages/bot-web-ui/src/components/dashboard/tour-trigger-dialog.tsx @@ -61,13 +61,21 @@ const TourTriggrerDialog = ({ const getTourHeaders = (tour_check: boolean, tab_id: number) => { let text; if (!tour_check) { - if (tab_id === 1) text = localize(is_mobile ? 'Bot Builder guide' : "Let's build a Bot!"); + if (tab_id === 1) text = is_mobile ? localize('Bot Builder guide') : localize("Let's build a Bot!"); else text = localize('Get started on Deriv Bot'); } else if (tab_id === 1) text = localize('Congratulations'); else text = localize('Want to retake the tour?'); return text; }; + const tourDialogInfo = is_mobile + ? 'Here’s a quick guide on how to use Deriv Bot on the go.' + : 'Learn how to build your bot from scratch using a simple strategy.'; + + const tourDialogAction = is_mobile + ? 'You can import a bot from your mobile device or from Google drive, see a preview in the bot builder, and start trading by running the bot.' + : 'Hit the <0>Start button to begin and follow the tutorial.'; + const getTourContent = (type: string) => { return ( <> @@ -78,23 +86,12 @@ const TourTriggrerDialog = ({ (!has_tour_ended ? ( <>
- +
Start button to begin and follow the tutorial.' - } + i18n_default_text={tourDialogAction} components={[]} />