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

Commit 7ad5e16

Browse files
committed
fix: fix translation links
1 parent 52c6dff commit 7ad5e16

File tree

7 files changed

+51
-21
lines changed

7 files changed

+51
-21
lines changed

src/common/lang.js

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,30 @@ export const showBanner = async () => {
8989
}
9090
};
9191

92-
export const getLanguageBase = url => {
92+
export const getLanguageBase = (origin = '') => {
9393
const lang = getLanguage();
94-
console.log(url + lang, 'language');
95-
return url + lang;
94+
switch (origin) {
95+
case 'binary':
96+
return `https://www.binary.com/${lang}/trading.html`;
97+
case 'deriv':
98+
return `https://deriv.com/${lang}`;
99+
case 'oauth':
100+
return `https://oauth.deriv.com/oauth2/authorize?app_id=16929&l=${lang}&brand=deriv`;
101+
case 'smart_trader':
102+
return `https://smarttrader.deriv.com/${lang}/trading.html`;
103+
case 'bot':
104+
return `https://bot.deriv.com/?l=${lang}`;
105+
case 'mt5':
106+
return `https://deriv.com/${lang}/dmt5/`;
107+
case 'dtrader':
108+
return `https://deriv.com/${lang}/dtrader/`;
109+
case 'dbot':
110+
return `https://deriv.com/${lang}/dbot/`;
111+
case 'derivx':
112+
return `https://deriv.com/${lang}/derivx/`;
113+
case 'derivgo':
114+
return `https://deriv.com/${lang}/deriv-go/`;
115+
default:
116+
return 'https://deriv.com/';
117+
}
96118
};

src/indexPage/react-components/binary-landing/Carousel.jsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,53 @@
11
import React from 'react';
22
import Slider from 'react-slick';
33
import { translate } from '../../../common/i18n';
4+
import {getLanguageBase} from '../../../common/lang'
45

56
const carouselContentArray = [
67
{
7-
url : 'https://smarttrader.deriv.com/',
8+
url : getLanguageBase('smart_trader'),
89
action_text : translate('Check it out'),
910
img : 'image/landing-carousel/smart-trader.png',
1011
platform_title : translate('SmartTrader'),
1112
platform_description: translate('Our classic options trading platform'),
1213
},
1314
{
14-
url : 'https://bot.deriv.com/',
15+
url : getLanguageBase('bot'),
1516
action_text : translate('Check it out'),
1617
img : 'image/landing-carousel/binary-bot.png',
1718
platform_title : translate('Binary Bot'),
1819
platform_description: translate('Our classic automated trading platform'),
1920
},
2021
{
21-
url : 'https://deriv.com/dmt5/',
22+
url : getLanguageBase('mt5'),
2223
action_text : translate('Learn more'),
2324
img : 'image/landing-carousel/mt5.png',
2425
platform_title : translate('Deriv MT5'),
2526
platform_description: translate('The world-famous CFD trading platform'),
2627
},
2728
{
28-
url : 'https://deriv.com/dtrader/',
29+
url : getLanguageBase('dtrader'),
2930
action_text : translate('Learn more'),
3031
img : 'image/landing-carousel/dtrader.png',
3132
platform_title : translate('DTrader'),
3233
platform_description: translate('Our flagship options and multipliers trading platform'),
3334
},
3435
{
35-
url : 'https://deriv.com/dbot/',
36+
url : getLanguageBase('dbot'),
3637
action_text : translate('Learn more'),
3738
img : 'image/landing-carousel/dbot.png',
3839
platform_title : translate('DBot'),
3940
platform_description: translate('Our next generation automated trading platform'),
4041
},
4142
{
42-
url : 'https://deriv.com/landing/deriv-go/',
43+
url : getLanguageBase('derivgo'),
4344
action_text : translate('Learn more'),
4445
img : 'image/landing-carousel/deriv-go.png',
4546
platform_title : translate('Deriv GO'),
4647
platform_description: translate('Trade on-the-go with our mobile trading platform'),
4748
},
4849
{
49-
url : 'https://deriv.com/derivx/',
50+
url : getLanguageBase('derivx'),
5051
action_text : translate('Learn more'),
5152
img : 'image/landing-carousel/derivX.png',
5253
platform_title : translate('Deriv X'),

src/indexPage/react-components/binary-landing/ChooseSection.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { translate } from '../../../common/i18n';
3+
import {getLanguageBase } from '../../../common/lang';
34

45
const ChooseSection = () => (
56
<section className='binary-choose-wrapper'>
@@ -66,7 +67,7 @@ const ChooseSection = () => (
6667
</div>
6768
</div>
6869
<div className="binary-choose-wrapper-inner_btn">
69-
<a href="http://deriv.com/">
70+
<a href={getLanguageBase('deriv')}>
7071
<button className="l-btn danger">{translate('Explore Deriv now')}</button>
7172
</a>
7273
</div>

src/indexPage/react-components/binary-landing/Hero.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import React from 'react';
22
import Slider from 'react-slick';
33
import { translate } from '../../../common/i18n';
4-
import {getLanguageBase } from '../../../common/lang';
4+
import {getLanguageBase} from '../../../common/lang';
5+
6+
57

68
const carouselImages = [
79
'image/hero-dmt5.png',
@@ -52,12 +54,12 @@ const Hero = () => {
5254
<b>{translate(' Deriv.')}</b>
5355
</h2>
5456
<div className="btn-group">
55-
<a href={getLanguageBase('https://deriv.com/')}>
57+
<a href={getLanguageBase('deriv')}>
5658
<button className="l-btn primary">
5759
{translate('Hello Deriv!')}
5860
</button>
5961
</a>
60-
<a href="https://www.binary.com?binary-bot-lp" id="logo">
62+
<a href={getLanguageBase('binary')} id="logo">
6163
<button className="l-btn">{translate('Maybe later')}</button>
6264
</a>
6365
</div>

src/indexPage/react-components/binary-landing/Navigation.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import React from 'react'
22
import { translate } from '../../../common/i18n';
3-
import {getLanguage} from '../../../common/lang'
3+
import {getLanguageBase} from '../../../common/lang'
4+
45

5-
const lang = getLanguage();
6-
const URL = `https://oauth.deriv.com/oauth2/authorize?app_id=16929&l=${lang}&brand=deriv`;
76

87
const MoveToDerivNav = () => (
98
<div className='navigation'>
@@ -13,7 +12,7 @@ const MoveToDerivNav = () => (
1312
<img src="image/binary.png" />
1413
</a>
1514
</div>
16-
<a href={URL} className="navigation-to-deriv" rel="noopener noreferrer">
15+
<a href={getLanguageBase('oauth')} className="navigation-to-deriv" rel="noopener noreferrer">
1716
<button className='btn-group right-btn'>
1817
{translate('Take me to Deriv')}
1918
</button>

src/indexPage/react-components/binary-landing/SwitchSection.jsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import React from 'react';
22
import { translate } from '../../../common/i18n';
3+
import { getLanguageBase } from '../../../common/lang';
4+
5+
6+
37

48
const SwitchSection = () => (
59
<section className="switch">
@@ -13,10 +17,10 @@ const SwitchSection = () => (
1317
{translate('Just log in using your Binary.com credentials. No sign-up needed.')}
1418
</h2>
1519
<div className="btn-group">
16-
<a href="https://oauth.deriv.com/oauth2/authorize?app_id=16929&l=en&brand=deriv" rel="noopener noreferrer">
20+
<a href={getLanguageBase('oauth')} rel="noopener noreferrer">
1721
<button className="l-btn danger">{translate('Try it now')}</button>
1822
</a>
19-
<a href="https://www.binary.com?binary-bot-lp">
23+
<a href={getLanguageBase('binary')}>
2024
<button className="l-btn transparent">{translate('Maybe later')}</button>
2125
</a>
2226
</div>

src/indexPage/react-components/binary-landing/WaitSection.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import { translate } from '../../../common/i18n';
3+
import {getLanguageBase} from '../../../common/lang'
34

45
const WaitSection = () => (
56
<section className='binary-wait-wrapper'>
@@ -8,7 +9,7 @@ const WaitSection = () => (
89
<h1>{translate('Don’t wait')}</h1>
910
<h2>{translate('Future-proof your trading. Come over to Deriv now.')}</h2>
1011
<div className="btn-group">
11-
<a href="https://oauth.deriv.com/oauth2/authorize?app_id=16929&l=en&brand=deriv">
12+
<a href={getLanguageBase('oauth')}>
1213
<button className="l-btn danger">{translate('Enter the Deriv experience')}</button>
1314
</a>
1415
</div>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy