Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:binary-com/deriv-com into transla…
Browse files Browse the repository at this point in the history
…tion-1834-compliance-changes
  • Loading branch information
Konstantinos-Gk committed Sep 22, 2023
2 parents ce16729 + 03151e7 commit de46c1b
Show file tree
Hide file tree
Showing 87 changed files with 1,237 additions and 1,362 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ env:
GATSBY_DATADOG_APPLICATION_ID: ${{ secrets.GATSBY_DATADOG_APPLICATION_ID }}
GATSBY_DATADOG_CLIENT_TOKEN: ${{ secrets.GATSBY_DATADOG_CLIENT_TOKEN }}
GATSBY_MAP_API_KEY: ${{ secrets.GATSBY_MAP_API_KEY }}

GATSBY_GROWTHBOOK_CLIENT_KEY: ${{ secrets.GATSBY_GROWTHBOOK_CLIENT_KEY }}
GATSBY_RUDDERSTACK_STAGING_KEY: ${{ secrets.GATSBY_RUDDERSTACK_STAGING_KEY }}
GATSBY_RUDDERSTACK_PRODUCTION_KEY: ${{ secrets.GATSBY_RUDDERSTACK_PRODUCTION_KEY }}
GATSBY_RUDDERSTACK_URL: ${{ secrets.GATSBY_RUDDERSTACK_URL }}

jobs:
release-beta:
timeout-minutes: 30
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ env:
GATSBY_RUDDERSTACK_STAGING_KEY: ${{ secrets.GATSBY_RUDDERSTACK_STAGING_KEY }}
GATSBY_RUDDERSTACK_PRODUCTION_KEY: ${{ secrets.GATSBY_RUDDERSTACK_PRODUCTION_KEY }}
GATSBY_RUDDERSTACK_URL: ${{ secrets.GATSBY_RUDDERSTACK_URL }}
GATSBY_STRAPI_TOKEN: ${{ secrets.GATSBY_STRAPI_TOKEN }}

jobs:
release-staging:
Expand Down
75 changes: 23 additions & 52 deletions crowdin/messages.json

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ const href = isBrowser && window.location.href
const site_url =
origin === 'https://deriv.com' || origin === 'https://eu.deriv.com' ? href : 'https://deriv.com'

const strapi_preview_param = {
publicationState: 'live',
}

const strapi_config = [
{
singularName: 'who-we-are-page',
queryParams: strapi_preview_param,
},
{
singularName: 'cfd-warning-banner',
queryParams: strapi_preview_param,
},
]

module.exports = {
// pathPrefix: process.env.PATH_PREFIX || '/deriv-com/', // For non CNAME GH-pages deployment
flags: {
Expand Down Expand Up @@ -352,6 +367,14 @@ module.exports = {
generateStatsFile: process.env.GENERATE_JSON_STATS === 'true',
},
},
{
resolve: 'gatsby-source-strapi',
options: {
apiURL: 'https://chief-skinny-instrument.strapiapp.com',
accessToken: process.env.GATSBY_STRAPI_TOKEN,
collectionTypes: strapi_config,
},
},
{
resolve: 'gatsby-plugin-env-variables',
options: {
Expand Down
65 changes: 62 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"gatsby-plugin-svgr": "^3.0.0-beta.0",
"gatsby-plugin-use-query-params": "^1.0.1",
"gatsby-source-filesystem": "^5.11.0",
"gatsby-source-strapi": "^3.3.1",
"gatsby-transformer-sharp": "^5.11.0",
"i18next": "^21.6.5",
"install": "^0.13.0",
Expand Down
17 changes: 14 additions & 3 deletions scripts/extract-translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const fs = require('fs')
const glob = require('glob')
const translated_keys = require('../src/translations/ach.json')
const DISABLE_TRANSLATION = 'disable-translation'
const strap_data = require('../public/page-data/404/page-data.json')



Expand Down Expand Up @@ -72,11 +73,17 @@ const new_find_keys = (file) => {
*/
extractTranslations();

function getStrapiStrings(strapi_obj_data) {
return strapi_obj_data instanceof Array ? strapi_obj_data.map((array) => getStrapiStrings(array)).flat() :
strapi_obj_data instanceof Object ? Object.values(strapi_obj_data).map((object) => getStrapiStrings(object)).flat() :
strapi_obj_data;
}

function extractTranslations() {
(async () => {
try {
const file_paths = [];
const messages = [];
const pre_messages = [];
const messages_json = {};

// Find all file types listed in `globs`
Expand All @@ -94,13 +101,17 @@ function extractTranslations() {
try {
const file = fs.readFileSync(file_paths[i], 'utf8');
if (!file.includes(DISABLE_TRANSLATION)) {
messages.push(...old_find_keys(file));
messages.push(...new_find_keys(file))
pre_messages.push(...old_find_keys(file));
pre_messages.push(...new_find_keys(file))
}
} catch (e) {
console.log(e);
}
}

const data_from_strapi = getStrapiStrings(strap_data.result.data.strapiWhoWeArePage)
const messages = new Array(...pre_messages, ...data_from_strapi)

const untranslated = []
// Hash the messages and set the key-value pair for json
for (let i = 0; i < messages.length; i++) {
Expand Down
4 changes: 1 addition & 3 deletions src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ export const live_chat_key = 'live_chat_redirection'
export const reddit_url = 'https://www.reddit.com/user/Deriv_official/'
export const telegram_url = 'https://t.me/derivdotcomofficial'
export const youtube_url = 'https://www.youtube.com/@deriv'
export const loss_percent = 72

export const contact_us_form_post_data = 'https://formkeep.com/f/7f4b8b55f10f'

export const cookie_key = 'browser_update_alert_modal_shown'
Expand All @@ -186,7 +184,7 @@ export const bannerTypes = {
}

export const firebaseConfig = {
databaseURL: 'https://deriv-static-pricingfeed.firebaseio.com',
databaseURL: 'https://deriv-static-pricingfeedv2.firebaseio.com',
}

export const hreflang_codes_row = [
Expand Down
Loading

0 comments on commit de46c1b

Please sign in to comment.