WIP: arabic localization.

This commit is contained in:
a.bouhuolia
2021-06-10 14:27:53 +02:00
parent 40c6a1ccbc
commit c66e86fbd5
10 changed files with 8 additions and 36 deletions

View File

@@ -73,7 +73,6 @@
"react-dropzone": "^11.0.1",
"react-error-boundary": "^3.0.2",
"react-hotkeys-hook": "^3.0.3",
"react-intl": "^3.12.0",
"react-intl-universal": "^2.4.7",
"react-loadable": "^5.5.0",
"react-query": "^3.6.0",

View File

@@ -2,7 +2,7 @@ import React from 'react';
import { Button } from '@blueprintjs/core';
import { Icon, If } from 'components';
import { useBalanceSheetContext } from './BalanceSheetProvider';
import { FormattedMessage as T } from 'react-intl';
import { FormattedMessage as T } from 'components';
import FinancialLoadingBar from '../FinancialLoadingBar';
/**

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { Button } from '@blueprintjs/core';
import { Icon, If } from 'components';
import { FormattedMessage as T } from 'react-intl';
import { FormattedMessage as T } from 'components';
import { dynamicColumns } from './utils';
import { useCashFlowStatementContext } from './CashFlowStatementProvider';

View File

@@ -2,7 +2,7 @@ import React from 'react';
import intl from 'react-intl-universal';
import { Button } from '@blueprintjs/core';
import { Icon, If } from 'components';
import { FormattedMessage as T } from 'react-intl';
import { FormattedMessage as T } from 'components';
import { getForceWidth, getColumnWidth } from 'utils';
import { useGeneralLedgerContext } from './GeneralLedgerProvider';

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { Button } from '@blueprintjs/core';
import { Icon, If } from 'components';
import { FormattedMessage as T } from 'react-intl';
import { FormattedMessage as T } from 'components';
import { dynamicColumns } from './utils';
import FinancialLoadingBar from '../FinancialLoadingBar';

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { Button } from '@blueprintjs/core';
import { Icon, If } from 'components';
import { FormattedMessage as T } from 'react-intl';
import { FormattedMessage as T } from 'components';
import { useProfitLossSheetContext } from './ProfitLossProvider';
import FinancialLoadingBar from '../FinancialLoadingBar';

View File

@@ -1,7 +1,7 @@
import React from 'react';
import { chain } from 'lodash';
import moment from 'moment';
import { FormattedMessage as T } from 'react-intl';
import { FormattedMessage as T } from 'components';
export const balanceSheetRowsReducer = (accounts) => {
return accounts.map((account) => {

View File

@@ -1,6 +1,6 @@
import React from 'react';
import { useHistory } from 'react-router-dom';
import { FormattedMessage as T } from 'react-intl';
import { FormattedMessage as T } from 'components';
import { DataTable } from 'components';

View File

@@ -2,7 +2,7 @@ import React, {useEffect, useState, useCallback} from 'react';
import { useAsync } from 'react-use';
import { useParams } from 'react-router-dom';
import { Intent, Alert } from '@blueprintjs/core';
import { FormattedMessage as T, FormattedHTMLMessage } from 'react-intl';
import { FormattedMessage as T, FormattedHTMLMessage } from 'components';
import DashboardInsider from 'components/Dashboard/DashboardInsider';
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';

View File

@@ -1,27 +0,0 @@
import { createIntl, createIntlCache } from 'react-intl';
// import messages from 'lang/en/index.json';
import arabicMessages from 'lang/ar/index.json';
import englishMessages from 'lang/en/index.json';
import { setLocale } from 'yup';
import { locale } from 'lang/en/locale';
// This is optional but highly recommended since it prevents memory leak
const cache = createIntlCache();
// Creates globa intl instance.
const intl = createIntl(
{
locale: 'en',
messages,
},
cache,
);
setLocale(locale);
const { formatMessage } = intl;
export { formatMessage };
export default intl;