From b9cc5c03ad6286f3ecb86fa2ed391c6bd75c2562 Mon Sep 17 00:00:00 2001 From: Farabi Chowdhury Date: Thu, 22 Jun 2023 19:17:11 +0800 Subject: [PATCH 1/2] fix: translation issues --- .../src/scratch/blocks/Math/math_modulo.js | 2 +- .../load-bot-preview/recent.tsx | 4 +-- .../components/dashboard/joyride-config.tsx | 11 ++++++++ .../data/data-fields.ts | 15 +++++------ .../dashboard/react-joyride-wrapper.tsx | 3 ++- .../dashboard/tour-trigger-dialog.tsx | 25 ++++++++----------- 6 files changed, 35 insertions(+), 25 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..44a7ac39bacb 100644 --- a/packages/bot-web-ui/src/components/dashboard/joyride-config.tsx +++ b/packages/bot-web-ui/src/components/dashboard/joyride-config.tsx @@ -114,6 +114,7 @@ export const DBOT_ONBOARDING = [ /> ), ...joyride_props, + locale: { next: localize('Next') }, disableOverlay: false, }, { @@ -128,6 +129,7 @@ export const DBOT_ONBOARDING = [ /> ), ...joyride_props, + locale: { next: localize('Next') }, disableOverlay: false, }, { @@ -142,6 +144,7 @@ export const DBOT_ONBOARDING = [ /> ), ...joyride_props, + locale: { next: localize('Next') }, disableOverlay: false, }, { @@ -155,6 +158,7 @@ export const DBOT_ONBOARDING = [ /> ), placement: 'right', + locale: { next: localize('Next') }, ...joyride_props, disableOverlay: false, }, @@ -170,6 +174,7 @@ export const DBOT_ONBOARDING = [ /> ), placement: 'left', + locale: { next: localize('Next') }, ...joyride_props, disableOverlay: false, }, @@ -421,36 +426,42 @@ export const BOT_BUILDER_TOUR = [ { target: '.animation__wrapper', content: , + locale: { next: localize('Next') }, placement: 'right', ...joyride_props, }, { target: '.animation__wrapper', content: , + locale: { next: localize('Next') }, placement: 'bottom', ...joyride_props, }, { target: '.animation__wrapper', content: , + locale: { next: localize('Next') }, placement: 'right', ...joyride_props, }, { target: '.animation__wrapper', content: , + locale: { next: localize('Next') }, placement: 'right', ...joyride_props, }, { target: '.animation__wrapper', content: , + locale: { next: localize('Next') }, placement: 'right', ...joyride_props, }, { target: '.animation__wrapper', content: , + locale: { next: localize('Next') }, placement: 'right', ...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/react-joyride-wrapper.tsx b/packages/bot-web-ui/src/components/dashboard/react-joyride-wrapper.tsx index c0fea61e4852..e5f33d8b9d69 100644 --- a/packages/bot-web-ui/src/components/dashboard/react-joyride-wrapper.tsx +++ b/packages/bot-web-ui/src/components/dashboard/react-joyride-wrapper.tsx @@ -1,5 +1,6 @@ import React from 'react'; import ReactJoyride, { Step, Styles } from 'react-joyride'; +import { localize } from '@deriv/translations'; import { handleJoyrideCallback } from './joyride-config'; const ReactJoyrideWrapper = ({ steps, styles, ...props }: { steps: Step[]; styles: Styles }) => { @@ -8,7 +9,7 @@ const ReactJoyrideWrapper = ({ steps, styles, ...props }: { steps: Step[]; style steps={steps} continuous callback={handleJoyrideCallback} - locale={{ back: 'Previous' }} + locale={{ back: localize('Previous') }} {...props} styles={{ options: { 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={[]} />
From ec39ce0c68c95ca74b2046104613258c1ac1c763 Mon Sep 17 00:00:00 2001 From: Farabi Chowdhury Date: Fri, 23 Jun 2023 11:43:24 +0800 Subject: [PATCH 2/2] redeploy: vercel retrigger