Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit de5dc9b

Browse files
committed
chore: translate added to text
1 parent 4d2234a commit de5dc9b

File tree

21 files changed

+245
-102
lines changed

21 files changed

+245
-102
lines changed

src/features/Apiexplorer/Dropdown/DropdownList/index.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import { playground_requests } from '@site/src/utils/playground_requests';
33
import clsx from 'clsx';
44
import styles from './DropdownList.module.scss';
5+
import Translate from '@docusaurus/Translate';
56

67
type TDropdownList = {
78
selected: string;
@@ -35,10 +36,14 @@ const DropdownList = ({
3536
/>
3637
<div className={styles.dropdownList}>
3738
<div className={styles.dropdownSelect}>
38-
<span>Select API Call - Version 3</span>
39+
<span>
40+
<Translate>Select API Call - Version 3</Translate>
41+
</span>
3942
</div>
4043
<div className={styles.dropdownStart}>
41-
<span>ALL CALLS</span>
44+
<span>
45+
<Translate>ALL CALLS</Translate>
46+
</span>
4247
</div>
4348
{playground_requests
4449
.filter((option) => {

src/features/Apiexplorer/LoginDialog/index.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useCallback } from 'react';
22
import { Modal, Button } from '@deriv/ui';
33
import useLoginUrl from '@site/src/hooks/useLoginUrl';
44
import styles from './LoginDialog.module.scss';
5+
import Translate from '@docusaurus/Translate';
56

67
type TLoginDialog = {
78
setToggleModal: React.Dispatch<React.SetStateAction<boolean>>;
@@ -34,13 +35,15 @@ export const LoginDialog = ({ setToggleModal }: TLoginDialog) => {
3435
has_close_button
3536
className={styles.wrapper}
3637
>
37-
<div className={styles.modal}>Log in or sign up to continue.</div>
38+
<div className={styles.modal}>
39+
<Translate>Log in or sign up to continue.</Translate>
40+
</div>
3841
<div className={styles.buttonWrapper}>
3942
<Button color='tertiary' onClick={handleSignUp} className={styles.btn}>
40-
Sign up
43+
<Translate>Sign up</Translate>
4144
</Button>
4245
<Button color='primary' onClick={handleClick} className={styles.btn}>
43-
Log in
46+
<Translate>Log in</Translate>
4447
</Button>
4548
</div>
4649
</Modal.PageContent>

src/features/Apiexplorer/SubscribeRenderer/index.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import useDisableSendRequest from '@site/src/hooks/useDisableSendRequest';
1111
import LoginDialog from '../LoginDialog';
1212
import PlaygroundSection from '../RequestResponseRenderer/PlaygroundSection';
1313
import ValidDialog from '../ValidDialog';
14+
import Translate from '@docusaurus/Translate';
1415

1516
export interface IResponseRendererProps<T extends TSocketSubscribableEndpointNames> {
1617
name: T;
@@ -60,10 +61,10 @@ function SubscribeRenderer<T extends TSocketSubscribableEndpointNames>({
6061
<div>
6162
<div className={styles.btnWrapper}>
6263
<Button color='primary' disabled={disableSendRequest(auth)} onClick={handleClick}>
63-
Send Request
64+
<Translate>Send Request</Translate>
6465
</Button>
6566
<Button color='secondary' onClick={handleClear}>
66-
Clear
67+
<Translate>Clear</Translate>
6768
</Button>
6869
</div>
6970
{is_valid ? (

src/features/Apiexplorer/ValidDialog/index.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useCallback } from 'react';
22
import { Modal } from '@deriv/ui';
33
import styles from '../LoginDialog/LoginDialog.module.scss';
4+
import Translate from '@docusaurus/Translate';
45

56
type TValidDialog = {
67
setIsValid: React.Dispatch<React.SetStateAction<boolean>>;
@@ -28,8 +29,10 @@ export const ValidDialog = ({ setIsValid, setToggleModal }: TValidDialog) => {
2829
className={styles.validwrapper}
2930
>
3031
<div className={styles.validmodal}>
31-
Your JSON object is invalid. Please make sure you provide the correct syntax for your
32-
JSON object.
32+
<Translate>
33+
Your JSON object is invalid. Please make sure you provide the correct syntax for
34+
your JSON object.
35+
</Translate>
3336
</div>
3437
</Modal.PageContent>
3538
</div>

src/features/Auth/Login/Login.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React from 'react';
33
import styles from './Login.module.scss';
44
import useLoginUrl from '@site/src/hooks/useLoginUrl';
55
import Footer from '@site/src/components/Footer';
6+
import Translate from '@docusaurus/Translate';
67

78
export const Login = () => {
89
const { getUrl } = useLoginUrl();
@@ -16,10 +17,12 @@ export const Login = () => {
1617
<div className={styles.loginsection}>
1718
<div className={styles.loginImage} role='image' />
1819
<Text type='paragraph-1' as={'h1'} align='center' bold role='heading'>
19-
Log in to your Deriv account to get the API token and start using our API.
20+
<Translate>
21+
Log in to your Deriv account to get the API token and start using our API.
22+
</Translate>
2023
</Text>
2124
<Button color='primary' onClick={handleClick}>
22-
Log In
25+
<Translate>Log In</Translate>
2326
</Button>
2427
</div>
2528
<div className={styles.footer}>

src/features/Endpoint/Endpoint.tsx

+13-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import { useForm } from 'react-hook-form';
33
import { Button, Text } from '@deriv/ui';
44
import styles from './Endpoint.module.scss';
5+
import Translate from '@docusaurus/Translate';
56

67
const default_endpoint = {
78
app_id: '35014',
@@ -45,7 +46,7 @@ const EndPoint = () => {
4546
<form onSubmit={handleSubmit(onSubmit)} aria-label='form'>
4647
<div className={styles.pageContent}>
4748
<Text type='heading-2' as={'h2'} align='center' bold role='heading'>
48-
Change API endpoint
49+
<Translate>Change API endpoint</Translate>
4950
</Text>
5051
<div className={styles.content}>
5152
<div className={styles.customTextInput} id='custom-text-input'>
@@ -66,7 +67,9 @@ const EndPoint = () => {
6667
className={styles.textInput}
6768
required
6869
/>
69-
<label className={styles.inlineLabel}>Server URL</label>
70+
<label className={styles.inlineLabel}>
71+
<Translate>Server URL</Translate>
72+
</label>
7073
{errors.server_url && (
7174
<div data-testid='server_error' className={styles.errorMessage}>
7275
{errors.server_url.message}
@@ -90,7 +93,9 @@ const EndPoint = () => {
9093
placeholder='e.g. 9999'
9194
required
9295
/>
93-
<label className={styles.inlineLabel}>App ID</label>
96+
<label className={styles.inlineLabel}>
97+
<Translate>App ID </Translate>
98+
</label>
9499
{errors.app_id && (
95100
<div data-testid='app_id_error' className={styles.errorMessage}>
96101
{errors.app_id.message}
@@ -99,12 +104,14 @@ const EndPoint = () => {
99104
</div>
100105
</div>
101106
<div className={styles.currentUrl}>
102-
<span className={styles.urlLabel}>Connected to :</span>
107+
<span className={styles.urlLabel}>
108+
<Translate>Connected to :</Translate>
109+
</span>
103110
<div className={styles.urlLink}>{current_url}</div>
104111
</div>
105112
<div className={styles.buttons}>
106113
<Button type='submit' color='primary' disabled={Object.keys(errors).length > 0}>
107-
Submit
114+
<Translate>Submit</Translate>
108115
</Button>
109116
<span style={{ marginLeft: '1.6rem' }} />
110117
<Button
@@ -113,7 +120,7 @@ const EndPoint = () => {
113120
onClick={onResetClicked}
114121
className={styles.resetButton}
115122
>
116-
Reset to original settings
123+
<Translate>Reset to original settings</Translate>
117124
</Button>
118125
</div>
119126
</div>

src/features/Home/ApiFeatures/ApiFeatures.tsx

+18-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
import React from 'react';
22
import { Text } from '@deriv/ui';
33
import styles from './ApiFeatures.module.scss';
4+
import Translate from '@docusaurus/Translate';
45
export const ApiFeatures = () => {
56
return (
67
<article className={styles.FeaturesContainer} data-testid='api-features'>
78
<section className={styles.FeatureText}>
89
<header>
910
<Text type='heading-2' as={'h2'} bold aria-level={1}>
10-
Deriv API features
11+
<Translate> Deriv API features</Translate>
1112
</Text>
1213
<Text type='paragraph-1' className={styles.FeatureParagraph} role='definition'>
13-
Deriv API gives you full access to all the trading functionalities of DTrader and allows
14-
you to build your own comprehensive trading systems and analysis tools.
14+
<Translate>
15+
Deriv API gives you full access to all the trading functionalities of DTrader and
16+
allows you to build your own comprehensive trading systems and analysis tools.
17+
</Translate>
1518
</Text>
1619
<Text type='paragraph-1' className={styles.FeatureParagraph} role={'note'}>
1720
{"With our API, you'll be able to:"}
@@ -21,23 +24,31 @@ export const ApiFeatures = () => {
2124
<ul className={styles.FeatureList}>
2225
<li className={styles.FeatureOptions}>
2326
<img src='/img/checklist-icon-grey.svg'></img>
24-
<div className={styles.FeatureContent}>Trade digital options and multipliers</div>
27+
<div className={styles.FeatureContent}>
28+
<Translate>Trade digital options and multipliers</Translate>
29+
</div>
2530
</li>
2631
<li className={styles.FeatureOptions}>
2732
<img src='/img/checklist-icon-grey.svg'></img>
28-
<div className={styles.FeatureContent}>Monitor real-time pricing</div>
33+
<div className={styles.FeatureContent}>
34+
<Translate>Monitor real-time pricing</Translate>
35+
</div>
2936
</li>
3037
<li className={styles.FeatureOptions}>
3138
<img src='/img/checklist-icon-grey.svg'></img>
32-
<div className={styles.FeatureContent}>Buy/sell contracts</div>
39+
<div className={styles.FeatureContent}>
40+
<Translate>Buy/sell contracts</Translate>
41+
</div>
3342
</li>
3443
<li className={styles.FeatureOptions}>
3544
<img src='/img/checklist-icon-grey.svg'></img>
3645
<div className={styles.FeatureContent}>{"Manage user's accounts"}</div>
3746
</li>
3847
<li className={styles.FeatureOptions}>
3948
<img src='/img/checklist-icon-grey.svg'></img>
40-
<div className={styles.FeatureContent}>Monitor existing contracts</div>
49+
<div className={styles.FeatureContent}>
50+
<Translate>Monitor existing contracts</Translate>
51+
</div>
4152
</li>
4253
<li className={styles.FeatureOptions}>
4354
<img src='/img/checklist-icon-grey.svg'></img>

src/features/Home/Benefits/Benefits.tsx

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { Text } from '@deriv/ui';
33
import styles from './Benefits.module.scss';
4+
import Translate from '@docusaurus/Translate';
45

56
type TBenefitsIcon = {
67
icon: string;
@@ -40,7 +41,7 @@ export const Benefits = () => {
4041
<article data-testid='benefits' className={styles.BenefitsContainer}>
4142
<header>
4243
<Text type='heading-2' as={'h2'} align='center' bold className={styles.Heading}>
43-
Benefits of using Deriv API
44+
<Translate> Benefits of using Deriv API</Translate>
4445
</Text>
4546
<section className={styles.BenefitsIcons}>
4647
<BenefitsIcon icon='automation' text='Automation' alt='automation' />
@@ -52,11 +53,15 @@ export const Benefits = () => {
5253
<article className={styles.InformationContainer}>
5354
<ImageContainer image='personalisation' alt='personalisation' />
5455
<section className={styles.InformationContent}>
55-
<h1>Personalize your trading</h1>
56+
<h1>
57+
<Translate>Personalize your trading</Translate>
58+
</h1>
5659
<Text type='subtitle-2' as='p'>
57-
Personalize your trading apps to match your needs. Create charts and views the way you
58-
like them. Develop your trading app using any common programming language and extend
59-
your trading opportunities.
60+
<Translate>
61+
Personalize your trading apps to match your needs. Create charts and views the way
62+
you like them. Develop your trading app using any common programming language and
63+
extend your trading opportunities.
64+
</Translate>
6065
</Text>
6166
</section>
6267
</article>
@@ -65,9 +70,11 @@ export const Benefits = () => {
6570
<section className={styles.InformationContent}>
6671
<h1>Build a business and earn more</h1>
6772
<Text type='subtitle-2' as='p'>
68-
Create your own trading apps by taking advantage of the power of Deriv&apos;s trading
69-
services. Share your apps with fellow traders or customers, and get a chance to earn
70-
more or build your own business.
73+
<Translate>
74+
Create your own trading apps by taking advantage of the power of Deriv&apos;s
75+
trading services. Share your apps with fellow traders or customers, and get a chance
76+
to earn more or build your own business.
77+
</Translate>
7178
</Text>
7279
</section>
7380
</article>

src/features/Home/Carousel/Carousel.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ import NextButton from './NextButton';
66
import PrevButton from './PrevButton';
77
import styles from './Carousel.module.scss';
88
import './swiper-custom.scss';
9+
import Translate from '@docusaurus/Translate';
910

1011
export const Carousel = () => {
1112
return (
1213
<article data-testid='carousel-component' className={`${styles.carouselComponent} carousel`}>
1314
<header>
1415
<Text type='heading-2' as='h1' align='center' bold className={styles.carouselHeading}>
15-
See what our clients say
16+
<Translate> See what our clients say </Translate>
1617
</Text>
1718
</header>
1819
<section className={styles.carouselContainer}>

src/features/Home/ClientLibraries/ClientLibraries.tsx

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { Text } from '@deriv/ui';
33
import styles from './ClientLibraries.module.scss';
4+
import Translate from '@docusaurus/Translate';
45

56
export const ClientLibraries = () => {
67
return (
@@ -17,11 +18,13 @@ export const ClientLibraries = () => {
1718
aria-level={1}
1819
className={styles.Heading}
1920
>
20-
Comprehensive all-in-one <br /> client library
21+
<Translate>Comprehensive all-in-one</Translate>
22+
<br /> <Translate>client library</Translate>
2123
</Text>
2224
<p className={styles.SubText}>
23-
Simplify your development processes and get your app up and running <br />
24-
faster with the client library of your choice.
25+
<Translate>Simplify your development processes and get your app up and running</Translate>
26+
<br />
27+
<Translate> faster with the client library of your choice.</Translate>
2528
</p>
2629
<nav className={styles.LibraryLogo}>
2730
<div className={styles.LogoAndLink}>
@@ -32,7 +35,9 @@ export const ClientLibraries = () => {
3235
target='_blank'
3336
>
3437
<img src='/img/js.svg'></img>
35-
<label>Go to the JavaScript library</label>
38+
<label>
39+
<Translate>Go to the JavaScript library</Translate>
40+
</label>
3641
<img className={styles.LibraryChevron} src='/img/library-chevron.svg' />
3742
</a>
3843
</div>
@@ -44,7 +49,9 @@ export const ClientLibraries = () => {
4449
target='_blank'
4550
>
4651
<img src='/img/py.svg'></img>
47-
<label>Go to the Python library</label>
52+
<label>
53+
<Translate>Go to the Python library</Translate>
54+
</label>
4855
<img className={styles.LibraryChevron} src='/img/library-chevron.svg' />
4956
</a>
5057
</div>
@@ -56,7 +63,9 @@ export const ClientLibraries = () => {
5663
target='_blank'
5764
>
5865
<img src='/img/flutter.svg'></img>
59-
<label>Go to the Flutter library</label>
66+
<label>
67+
<Translate>Go to the Flutter library</Translate>
68+
</label>
6069
<img className={styles.LibraryChevron} src='/img/library-chevron.svg' />
6170
</a>
6271
</div>

0 commit comments

Comments
 (0)