Skip to content

Commit

Permalink
Farabi/bot 317/translation fixes for dbot homepage (binary-com#9108)
Browse files Browse the repository at this point in the history
* fix: translation issues

* redeploy: vercel retrigger

---------

Co-authored-by: Ali(Ako) Hosseini <ali.hosseini@deriv.com>
  • Loading branch information
2 people authored and Mahdiyeh Amirkhani committed Jul 25, 2023
1 parent 9aadad9 commit 75c2a36
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ export const DBOT_ONBOARDING = [
step_index={6}
/>
),
locale: { last: localize('Next') },
...joyride_props,
disableOverlay: false,
},
Expand Down Expand Up @@ -457,7 +456,6 @@ export const BOT_BUILDER_TOUR = [
{
target: '.animation__wrapper',
content: <Step6 show_label />,
locale: { last: localize('Next') },
...joyride_props,
},
];
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -30,28 +31,28 @@ const data_fields: ReadonlyArray<TDataFields> = [
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,
Expand All @@ -60,7 +61,7 @@ const data_fields: ReadonlyArray<TDataFields> = [
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,
Expand All @@ -69,7 +70,7 @@ const data_fields: ReadonlyArray<TDataFields> = [
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,
Expand All @@ -84,7 +85,7 @@ const data_fields: ReadonlyArray<TDataFields> = [
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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</0> button to begin and follow the tutorial.';

const getTourContent = (type: string) => {
return (
<>
Expand All @@ -78,23 +86,12 @@ const TourTriggrerDialog = ({
(!has_tour_ended ? (
<>
<div className='dc-dialog__content__description__text'>
<Localize
key={0}
i18n_default_text={
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.'
}
/>
<Localize key={0} i18n_default_text={tourDialogInfo} />
</div>
<div className='dc-dialog__content__description__text'>
<Localize
key={0}
i18n_default_text={
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</0> button to begin and follow the tutorial.'
}
i18n_default_text={tourDialogAction}
components={[<strong key={0} />]}
/>
</div>
Expand Down

0 comments on commit 75c2a36

Please sign in to comment.