Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yashim/fix: update extraction regex #7765

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions packages/appstore/src/components/CFDs/cfd-real-accounts.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { observer } from 'mobx-react-lite';
import { localize, Localize } from '@deriv/translations';
import { CFD_PLATFORMS, routes, getCFDAccountKey, getAccountListKey } from '@deriv/shared';
import { Localize, localize } from '@deriv/translations';
import { CFD_PLATFORMS, routes, getAccountListKey } from '@deriv/shared';
import { DetailsOfEachMT5Loginid } from '@deriv/api-types';
import AccountManager from '../account-manager';
import AddDerived from 'Components/add-derived';
Expand All @@ -10,11 +10,6 @@ import AddOptionsAccount from 'Components/add-options-account';
import { useStores } from 'Stores/index';
import { useHistory } from 'react-router-dom';

type TOpenAccountTransferMeta = {
category: string;
type?: string;
};

const CFDRealAccounts = ({
isDerivedVisible,
isFinancialVisible,
Expand Down Expand Up @@ -69,6 +64,7 @@ const CFDRealAccounts = ({
type: 'all',
},
];

const REAL_DXTRADE_URL = 'https://dx.deriv.com';
const DEMO_DXTRADE_URL = 'https://dx-demo.deriv.com';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ describe('Regular expression checks', () => {
localize('Touch/No Touch');
localize('You have created a Deriv MT5 {{account_title}} account. To start trading, transfer funds from your Deriv account into this account.', { account_title: account_title[0].toLowerCase() + account_title.substr(1) });
localize('You have no trading activity yet.');
localize(\`Hello Yashim\`);
`);
expect(messages).toEqual([
'Touch/No Touch',
'You have created a Deriv MT5 {{account_title}} account. To start trading, transfer funds from your Deriv account into this account.',
'You have no trading activity yet.',
'Hello Yashim',
]);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/translations/scripts/extract-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const glob = require('glob');
const path = require('path');
const DOMParser = require('xmldom').DOMParser;

const getRegexPattern = () => /(i18n_default_text={?|localize\()\s*(['"])\s*(.*?)(?<!\\)\2\s*/gs;
const getRegexPattern = () => /(i18n_default_text={?|localize\()\s*(['`"])\s*(.*?)(?<!\\)\2\s*/gs;

const getStringsFromInput = (input, i18n_marker = getRegexPattern()) => {
const messages = [];
Expand Down