diff --git a/client/config/webpack.config.js b/client/config/webpack.config.js
index c33bfc4a8..3b4b4a595 100644
--- a/client/config/webpack.config.js
+++ b/client/config/webpack.config.js
@@ -27,6 +27,8 @@ const typescriptFormatter = require('react-dev-utils/typescriptFormatter');
const CompressionPlugin = require("compression-webpack-plugin");
const postcssNormalize = require('postcss-normalize');
+const { postcssRTLCSS} = require('postcss-rtlcss');
+
const appPackageJson = require(paths.appPackageJson);
@@ -92,6 +94,14 @@ module.exports = function(webpackEnv) {
// https://github.com/facebook/create-react-app/issues/2677
ident: 'postcss',
plugins: () => [
+ // Postcss rtlcss plugin.
+ // require( 'postcss-rtl' )({
+ // // options here.
+ // removeComments: false,
+ // }),
+ postcssRTLCSS({
+
+ }),
require('postcss-flexbugs-fixes'),
require('postcss-preset-env')({
autoprefixer: {
@@ -103,11 +113,6 @@ module.exports = function(webpackEnv) {
// so that it honors browserslist config in package.json
// which in turn let's users customize the target behavior as per their needs.
postcssNormalize(),
-
- // Postcss rtlcss plugin.
- require( 'postcss-rtl' )({
- // options here.
- }),
],
sourceMap: isEnvProduction && shouldUseSourceMap,
},
@@ -125,6 +130,10 @@ module.exports = function(webpackEnv) {
loader: require.resolve(preProcessor),
options: {
sourceMap: true,
+ sassOptions: {
+ sourceComments: true,
+ outputStyle: 'expanded'
+ }
},
}
);
diff --git a/client/package.json b/client/package.json
index 91357cf2d..8601ab979 100644
--- a/client/package.json
+++ b/client/package.json
@@ -74,6 +74,7 @@
"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",
"react-redux": "^7.1.3",
@@ -94,6 +95,7 @@
"redux-thunk": "^2.3.0",
"resolve": "1.15.0",
"resolve-url-loader": "3.1.1",
+ "rtl-detect": "^1.0.3",
"sass-loader": "8.0.2",
"semver": "6.3.0",
"style-loader": "0.23.1",
@@ -137,6 +139,7 @@
"@welldone-software/why-did-you-render": "^6.0.0-rc.1",
"compression-webpack-plugin": "^6.1.0",
"http-proxy-middleware": "^1.0.0",
+ "postcss-rtlcss": "^1.7.2",
"react-query-devtools": "^2.1.1",
"redux-devtools": "^3.5.0",
"typescript": "^4.1.2"
diff --git a/client/src/common/contactsOptions.js b/client/src/common/contactsOptions.js
index 42e86361f..f03a49e22 100644
--- a/client/src/common/contactsOptions.js
+++ b/client/src/common/contactsOptions.js
@@ -1,7 +1,7 @@
import React from 'react';
-import { formatMessage } from 'services/intl';
+import intl from 'react-intl-universal';
export default [
- { name: formatMessage({ id: 'customer' }), path: 'customers' },
- { name: formatMessage({ id: 'vendor' }), path: 'vendors' },
+ { name: intl.get('customer'), path: 'customers' },
+ { name: intl.get('vendor'), path: 'vendors' },
];
diff --git a/client/src/common/fiscalYearOptions.js b/client/src/common/fiscalYearOptions.js
index 1a89aabb7..24043ec80 100644
--- a/client/src/common/fiscalYearOptions.js
+++ b/client/src/common/fiscalYearOptions.js
@@ -1,88 +1,64 @@
-import { formatMessage } from 'services/intl';
+import intl from 'react-intl-universal';
-export default [
+export const getFiscalYearOptions = () => [
{
id: 0,
- name: `${formatMessage({ id: 'january' })} - ${formatMessage({
- id: 'december',
- })}`,
+ name: `${intl.get('january')} - ${intl.get('december')}`,
value: 'january',
},
{
id: 1,
- name: `${formatMessage({ id: 'february' })} - ${formatMessage({
- id: 'january',
- })}`,
+ name: `${intl.get('february')} - ${intl.get('january')}`,
value: 'february',
},
{
id: 2,
- name: `${formatMessage({ id: 'march' })} - ${formatMessage({
- id: 'february',
- })}`,
+ name: `${intl.get('march')} - ${intl.get('february')}`,
value: 'March',
},
{
id: 3,
- name: `${formatMessage({ id: 'april' })} - ${formatMessage({
- id: 'march',
- })}`,
+ name: `${intl.get('april')} - ${intl.get('march')}`,
value: 'april',
},
{
id: 4,
- name: `${formatMessage({ id: 'may' })} - ${formatMessage({
- id: 'april',
- })}`,
+ name: `${intl.get('may')} - ${intl.get('april')}`,
value: 'may',
},
{
id: 5,
- name: `${formatMessage({ id: 'june' })} - ${formatMessage({
- id: 'may',
- })}`,
+ name: `${intl.get('june')} - ${intl.get('may')}`,
value: 'june',
},
{
id: 6,
- name: `${formatMessage({ id: 'july' })} - ${formatMessage({
- id: 'june',
- })}`,
+ name: `${intl.get('july')} - ${intl.get('june')}`,
value: 'july',
},
{
id: 7,
- name: `${formatMessage({ id: 'august' })} - ${formatMessage({
- id: 'july',
- })}`,
+ name: `${intl.get('august')} - ${intl.get('july')}`,
value: 'August',
},
{
id: 8,
- name: `${formatMessage({ id: 'september' })} - ${formatMessage({
- id: 'august',
- })}`,
+ name: `${intl.get('september')} - ${intl.get('august')}`,
value: 'september',
},
{
id: 9,
- name: `${formatMessage({ id: 'october' })} - ${formatMessage({
- id: 'november',
- })}`,
+ name: `${intl.get('october')} - ${intl.get('november')}`,
value: 'october',
},
{
id: 10,
- name: `${formatMessage({ id: 'november' })} - ${formatMessage({
- id: 'october',
- })}`,
+ name: `${intl.get('november')} - ${intl.get('october')}`,
value: 'november',
},
{
id: 11,
- name: `${formatMessage({ id: 'december' })} - ${formatMessage({
- id: 'november',
- })}`,
+ name: `${intl.get('december')} - ${intl.get('november')}`,
value: 'december',
},
]
\ No newline at end of file
diff --git a/client/src/common/homepageOptions.js b/client/src/common/homepageOptions.js
index 8389a4a70..82972db3a 100644
--- a/client/src/common/homepageOptions.js
+++ b/client/src/common/homepageOptions.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
export const accountsReceivable = [
{
@@ -21,12 +21,12 @@ export const accountsReceivable = [
link: '/receipts',
},
{
- title: ,
+ title: ,
description: ,
link: '/customers',
},
{
- title: ,
+ title: ,
description: (
),
diff --git a/client/src/common/keyboardShortcutsOptions.js b/client/src/common/keyboardShortcutsOptions.js
index aabf28d7c..4b1b49fa1 100644
--- a/client/src/common/keyboardShortcutsOptions.js
+++ b/client/src/common/keyboardShortcutsOptions.js
@@ -1,105 +1,105 @@
import React from 'react';
-import { formatMessage } from 'services/intl';
+import intl from 'react-intl-universal';
export default [
{
shortcut_key: 'Shift + I',
- description: formatMessage({ id: 'jump_to_the_invoices' }),
+ description: intl.get('jump_to_the_invoices'),
},
{
shortcut_key: 'Shift + E',
- description: formatMessage({ id: 'jump_to_the_estimates' }),
+ description: intl.get('jump_to_the_estimates'),
},
{
shortcut_key: 'Shift + R',
- description: formatMessage({ id: 'jump_to_the_receipts' }),
+ description: intl.get('jump_to_the_receipts'),
},
{
shortcut_key: 'Shift + X',
- description: formatMessage({ id: 'jump_to_the_expenses' }),
+ description: intl.get('jump_to_the_expenses'),
},
{
shortcut_key: 'Shift + C',
- description: formatMessage({ id: 'jump_to_the_customers' }),
+ description: intl.get('jump_to_the_customers'),
},
{
shortcut_key: 'Shift + V',
- description: formatMessage({ id: 'jump_to_the_vendors' }),
+ description: intl.get('jump_to_the_vendors'),
},
{
shortcut_key: 'Shift + A',
- description: formatMessage({ id: 'jump_to_the_chart_of_accounts' }),
+ description: intl.get('jump_to_the_chart_of_accounts'),
},
{
shortcut_key: 'Shift + B',
- description: formatMessage({ id: 'jump_to_the_bills' }),
+ description: intl.get('jump_to_the_bills'),
},
{
shortcut_key: 'Shift + M',
- description: formatMessage({ id: 'jump_to_the_manual_journals' }),
+ description: intl.get('jump_to_the_manual_journals'),
},
{
shortcut_key: 'Shift + W',
- description: formatMessage({ id: 'jump_to_the_items' }),
+ description: intl.get('jump_to_the_items'),
},
{
shortcut_key: 'Shift + 1',
- description: formatMessage({ id: 'jump_to_the_balance_sheet' }),
+ description: intl.get('jump_to_the_balance_sheet'),
},
{
shortcut_key: 'Shift + 2',
- description: formatMessage({ id: 'jump_to_the_profit_loss_sheet' }),
+ description: intl.get('jump_to_the_profit_loss_sheet'),
},
{
shortcut_key: 'Shift + 3',
- description: formatMessage({ id: 'jump_to_the_journal_sheet' }),
+ description: intl.get('jump_to_the_journal_sheet'),
},
{
shortcut_key: 'Shift + 4',
- description: formatMessage({ id: 'jump_to_the_general_ledger_sheet' }),
+ description: intl.get('jump_to_the_general_ledger_sheet'),
},
{
shortcut_key: 'Shift + 5',
- description: formatMessage({ id: 'jump_to_the_trial_balance_sheet' }),
+ description: intl.get('jump_to_the_trial_balance_sheet'),
},
{
shortcut_key: 'Ctrl + Shift + I ',
- description: formatMessage({ id: 'create_a_new_invoice' }),
+ description: intl.get('create_a_new_invoice'),
},
{
shortcut_key: 'Ctrl + Shift + E ',
- description: formatMessage({ id: 'create_a_new_estimate' }),
+ description: intl.get('create_a_new_estimate'),
},
{
shortcut_key: 'Ctrl + Shift + R ',
- description: formatMessage({ id: 'create_a_new_receipt' }),
+ description: intl.get('create_a_new_receipt'),
},
{
shortcut_key: 'Ctrl + Shift + X ',
- description: formatMessage({ id: 'create_a_new_expense' }),
+ description: intl.get('create_a_new_expense'),
},
{
shortcut_key: 'Ctrl + Shift + C ',
- description: formatMessage({ id: 'create_a_new_customer' }),
+ description: intl.get('create_a_new_customer'),
},
{
shortcut_key: 'Ctrl + Shift + V ',
- description: formatMessage({ id: 'create_a_new_vendor' }),
+ description: intl.get('create_a_new_vendor'),
},
{
shortcut_key: 'Ctrl + Shift + B ',
- description: formatMessage({ id: 'create_a_new_bill' }),
+ description: intl.get('create_a_new_bill'),
},
{
shortcut_key: 'Ctrl + Shift + M ',
- description: formatMessage({ id: 'create_a_new_make_journal' }),
+ description: intl.get('create_a_new_make_journal'),
},
{
shortcut_key: 'Ctrl + Shift + W ',
- description: formatMessage({ id: 'create_a_new_item' }),
+ description: intl.get('create_a_new_item'),
},
{
shortcut_key: 'Ctrl + / ',
- description: formatMessage({ id: 'close_and_open_sidebar' }),
+ description: intl.get('close_and_open_sidebar'),
},
];
diff --git a/client/src/common/quickNewOptions.js b/client/src/common/quickNewOptions.js
index 500800ecd..6ebb1ec57 100644
--- a/client/src/common/quickNewOptions.js
+++ b/client/src/common/quickNewOptions.js
@@ -1,11 +1,10 @@
-import React from 'react';
-import { formatMessage } from 'services/intl';
+import intl from 'react-intl-universal';
-export default [
- { path: 'invoices/new', name: formatMessage({ id: 'sale_invoice' }) },
- { path: 'bills//new', name: formatMessage({ id: 'purchase_invoice' }) },
- { path: 'make-journal-entry', name: formatMessage({ id: 'manual_journal' }) },
- { path: 'expenses/new', name: formatMessage({ id: 'expense' }) },
- { path: 'customers/new', name: formatMessage({ id: 'customer' }) },
- { path: 'vendors/new', name: formatMessage({ id: 'vendor' }) },
+export const getQuickNewActions = () => [
+ { path: 'invoices/new', name: intl.get('sale_invoice') },
+ { path: 'bills//new', name: intl.get('purchase_invoice') },
+ { path: 'make-journal-entry', name: intl.get('manual_journal') },
+ { path: 'expenses/new', name: intl.get('expense') },
+ { path: 'customers/new', name: intl.get('customer') },
+ { path: 'vendors/new', name: intl.get('vendor') },
];
diff --git a/client/src/components/AccountsMultiSelect.js b/client/src/components/AccountsMultiSelect.js
index d9e24c7e5..071211e5f 100644
--- a/client/src/components/AccountsMultiSelect.js
+++ b/client/src/components/AccountsMultiSelect.js
@@ -2,7 +2,7 @@ import React, { useMemo, useCallback, useState } from 'react';
import { omit } from 'lodash';
import { MenuItem, Button } from '@blueprintjs/core';
import MultiSelect from 'components/MultiSelect';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
export default function AccountsMultiSelect({ accounts, onAccountSelected }) {
const [selectedAccounts, setSelectedAccounts] = useState({});
diff --git a/client/src/components/AccountsSelectList.js b/client/src/components/AccountsSelectList.js
index 7b173dff2..cddbcbe81 100644
--- a/client/src/components/AccountsSelectList.js
+++ b/client/src/components/AccountsSelectList.js
@@ -1,7 +1,7 @@
import React, { useCallback, useState, useEffect, useMemo } from 'react';
import { MenuItem, Button } from '@blueprintjs/core';
import { Select } from '@blueprintjs/select';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import classNames from 'classnames';
import { filterAccountsByQuery } from './utils';
import { CLASSES } from 'common/classes';
diff --git a/client/src/components/AccountsSuggestField.js b/client/src/components/AccountsSuggestField.js
index bdd1742a5..7e9952bb7 100644
--- a/client/src/components/AccountsSuggestField.js
+++ b/client/src/components/AccountsSuggestField.js
@@ -5,7 +5,7 @@ import { Suggest } from '@blueprintjs/select';
import classNames from 'classnames';
import { CLASSES } from 'common/classes';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import { filterAccountsByQuery } from './utils';
/**
diff --git a/client/src/components/App.js b/client/src/components/App.js
index 9df37df3c..062cbb77c 100644
--- a/client/src/components/App.js
+++ b/client/src/components/App.js
@@ -1,5 +1,4 @@
import React from 'react';
-import { RawIntlProvider } from 'react-intl';
import { Router, Switch, Route } from 'react-router';
import { createBrowserHistory } from 'history';
import { QueryClientProvider, QueryClient } from 'react-query';
@@ -7,47 +6,60 @@ import { ReactQueryDevtools } from 'react-query/devtools';
import 'style/App.scss';
+import AppIntlLoader from './AppIntlLoader';
import PrivateRoute from 'components/Guards/PrivateRoute';
-import Authentication from 'components/Authentication';
-import DashboardPrivatePages from 'components/Dashboard/PrivatePages';
import GlobalErrors from 'containers/GlobalErrors/GlobalErrors';
-import intl from 'services/intl';
+import DashboardPrivatePages from 'components/Dashboard/PrivatePages';
+import Authentication from 'components/Authentication';
+// Query client config.
+const queryConfig = {
+ defaultOptions: {
+ queries: {
+ refetchOnWindowFocus: true,
+ staleTime: 30000,
+ },
+ },
+};
+
+// Global fetch query.
+function GlobalFetchQuery({
+ children
+}) {
+ window.localStorage.setItem('lang', 'en');
+ return children
+}
+
+/**
+ * Core application.
+ */
function App({ locale }) {
const history = createBrowserHistory();
- const queryConfig = {
- defaultOptions: {
- queries: {
- refetchOnWindowFocus: true,
- staleTime: 30000,
- },
- },
- };
+ // Query client.
const queryClient = new QueryClient(queryConfig);
return (
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
+
+
);
}
diff --git a/client/src/components/AppIntlLoader.js b/client/src/components/AppIntlLoader.js
new file mode 100644
index 000000000..7fc49b233
--- /dev/null
+++ b/client/src/components/AppIntlLoader.js
@@ -0,0 +1,80 @@
+import React from 'react';
+import intl from 'react-intl-universal';
+import { find } from 'lodash';
+import rtlDetect from 'rtl-detect';
+import DashboardLoadingIndicator from 'components/Dashboard/DashboardLoadingIndicator';
+
+const SUPPORTED_LOCALES = [
+ { name: "English", value: "en" },
+ { name: 'العربية', value: 'ar' }
+];
+
+/**
+ * Retrieve the current local.
+ */
+function getCurrentLocal() {
+ let currentLocale = intl.determineLocale({
+ urlLocaleKey: "lang",
+ cookieLocaleKey: "lang",
+ localStorageLocaleKey: "lang",
+ });
+ if (!find(SUPPORTED_LOCALES, { value: currentLocale })) {
+ currentLocale = "en";
+ }
+ return currentLocale;
+}
+
+/**
+ * Loads the localization data of the given locale.
+ */
+function loadLocales(currentLocale) {
+ return import(`../lang/${currentLocale}/index.json`);
+}
+
+/**
+ * Modifies the html document direction to RTl if it was rtl-language.
+ */
+function useDocumentDirectionModifier(locale) {
+ React.useEffect(() => {
+ const isRTL = rtlDetect.isRtlLang(locale);
+
+ if (isRTL) {
+ const htmlDocument = document.querySelector('html');
+ htmlDocument.setAttribute('dir', 'rtl');
+ htmlDocument.setAttribute('lang', locale);
+ }
+ }, []);
+}
+
+/**
+ * Application Intl loader.
+ */
+export default function AppIntlLoader({
+ children
+}) {
+ const [isLoading, setIsLoading] = React.useState(true);
+ const currentLocale = getCurrentLocal();
+
+ // Modifies the html document direction
+ useDocumentDirectionModifier(currentLocale);
+
+ React.useEffect(() => {
+ // Lodas the locales data file.
+ loadLocales(currentLocale).then((results) => {
+ return intl.init({
+ currentLocale,
+ locales: {
+ [currentLocale]: results,
+ },
+ });
+ }).then(() => {
+ setIsLoading(false);
+ });
+ }, [currentLocale, setIsLoading]);
+
+ return (
+
+ {children}
+
+ );
+}
\ No newline at end of file
diff --git a/client/src/components/Authentication.js b/client/src/components/Authentication.js
index 9eb01c6c1..8bbb29515 100644
--- a/client/src/components/Authentication.js
+++ b/client/src/components/Authentication.js
@@ -3,7 +3,7 @@ import { Redirect, Route, Switch, Link, useLocation } from 'react-router-dom';
import BodyClassName from 'react-body-classname';
import { TransitionGroup, CSSTransition } from 'react-transition-group';
import authenticationRoutes from 'routes/authentication';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import Icon from 'components/Icon';
import { useIsAuthenticated } from 'hooks/state';
@@ -32,6 +32,7 @@ export default function AuthenticationWrapper({ ...rest }) {
>
+
diff --git a/client/src/components/CategoriesSelectList.js b/client/src/components/CategoriesSelectList.js
index 1345d1f6c..6cd4f83c5 100644
--- a/client/src/components/CategoriesSelectList.js
+++ b/client/src/components/CategoriesSelectList.js
@@ -1,5 +1,5 @@
import React, { useCallback } from 'react';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import { ListSelect } from 'components';
import { MenuItem } from '@blueprintjs/core';
import { saveInvoke } from 'utils';
diff --git a/client/src/components/ContactSelecetList.js b/client/src/components/ContactSelecetList.js
index d19d4943c..8dfeb32f6 100644
--- a/client/src/components/ContactSelecetList.js
+++ b/client/src/components/ContactSelecetList.js
@@ -1,5 +1,5 @@
import React, { useCallback, useState, useEffect, useMemo } from 'react';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import { MenuItem, Button } from '@blueprintjs/core';
import { Select } from '@blueprintjs/select';
import classNames from 'classnames';
diff --git a/client/src/components/ContactsMultiSelect.js b/client/src/components/ContactsMultiSelect.js
index 3d622af9f..7cbb1c332 100644
--- a/client/src/components/ContactsMultiSelect.js
+++ b/client/src/components/ContactsMultiSelect.js
@@ -2,7 +2,7 @@ import React, { useMemo, useCallback, useState } from 'react';
import { MenuItem, Button } from '@blueprintjs/core';
import { omit } from 'lodash';
import MultiSelect from 'components/MultiSelect';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
export default function ContactsMultiSelect({
contacts,
diff --git a/client/src/components/ContactsSuggestField.js b/client/src/components/ContactsSuggestField.js
index 0db5f5184..816619d29 100644
--- a/client/src/components/ContactsSuggestField.js
+++ b/client/src/components/ContactsSuggestField.js
@@ -2,16 +2,16 @@ import React, { useCallback, useState, useEffect, useMemo } from 'react';
import { MenuItem } from '@blueprintjs/core';
import { Suggest } from '@blueprintjs/select';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import classNames from 'classnames';
import { CLASSES } from 'common/classes';
-import { formatMessage } from 'services/intl';
+import intl from 'react-intl-universal';
export default function ContactsSuggestField({
contactsList,
initialContactId,
selectedContactId,
- defaultTextSelect = formatMessage({id:'select_contact'}),
+ defaultTextSelect = intl.get('select_contact'),
onContactSelected,
selectedContactType = [],
diff --git a/client/src/components/CurrencySelectList.js b/client/src/components/CurrencySelectList.js
index c59c63795..36a90e606 100644
--- a/client/src/components/CurrencySelectList.js
+++ b/client/src/components/CurrencySelectList.js
@@ -1,5 +1,5 @@
import React, { useCallback, useEffect, useState } from 'react';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import { CLASSES } from 'common/classes';
import classNames from 'classnames';
import { MenuItem, Button } from '@blueprintjs/core';
diff --git a/client/src/components/Dashboard/Dashboard.js b/client/src/components/Dashboard/Dashboard.js
index 4488809d3..00a6ab561 100644
--- a/client/src/components/Dashboard/Dashboard.js
+++ b/client/src/components/Dashboard/Dashboard.js
@@ -30,7 +30,7 @@ export default function Dashboard() {
-
+
diff --git a/client/src/components/Dashboard/DashboardActionViewsList.js b/client/src/components/Dashboard/DashboardActionViewsList.js
index 97f0b2836..42c2bcbe7 100644
--- a/client/src/components/Dashboard/DashboardActionViewsList.js
+++ b/client/src/components/Dashboard/DashboardActionViewsList.js
@@ -9,7 +9,7 @@ import {
PopoverInteractionKind,
Position,
} from '@blueprintjs/core';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import { Icon } from 'components';
/**
diff --git a/client/src/components/Dashboard/DashboardBackLink.js b/client/src/components/Dashboard/DashboardBackLink.js
index 096177057..8e0933433 100644
--- a/client/src/components/Dashboard/DashboardBackLink.js
+++ b/client/src/components/Dashboard/DashboardBackLink.js
@@ -1,9 +1,9 @@
import React from 'react';
import withBreadcrumbs from 'react-router-breadcrumbs-hoc';
import { useHistory } from 'react-router-dom';
-import routes from 'routes/dashboard';
+import { getDashboardRoutes } from 'routes/dashboard';
import { If, Icon } from 'components';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import withDashboard from 'containers/Dashboard/withDashboard';
import { compose } from 'utils';
@@ -32,7 +32,7 @@ function DashboardBackLink({ dashboardBackLink, breadcrumbs }) {
}
export default compose(
- withBreadcrumbs(routes),
+ withBreadcrumbs([]),
withDashboard(({ dashboardBackLink }) => ({
dashboardBackLink,
})),
diff --git a/client/src/components/Dashboard/DashboardBreadcrumbs.js b/client/src/components/Dashboard/DashboardBreadcrumbs.js
index 840e0b1cd..a27c0ffd2 100644
--- a/client/src/components/Dashboard/DashboardBreadcrumbs.js
+++ b/client/src/components/Dashboard/DashboardBreadcrumbs.js
@@ -6,7 +6,7 @@ import {
Boundary,
} from '@blueprintjs/core';
import withBreadcrumbs from 'react-router-breadcrumbs-hoc';
-import routes from 'routes/dashboard';
+import { getDashboardRoutes } from 'routes/dashboard';
import { useHistory } from 'react-router-dom';
function DashboardBreadcrumbs({ breadcrumbs }){
@@ -31,4 +31,4 @@ function DashboardBreadcrumbs({ breadcrumbs }){
)
}
-export default withBreadcrumbs(routes)(DashboardBreadcrumbs)
+export default withBreadcrumbs([])(DashboardBreadcrumbs)
diff --git a/client/src/components/Dashboard/DashboardContentRoute.js b/client/src/components/Dashboard/DashboardContentRoute.js
index 4951f186b..08ca63f54 100644
--- a/client/src/components/Dashboard/DashboardContentRoute.js
+++ b/client/src/components/Dashboard/DashboardContentRoute.js
@@ -1,12 +1,15 @@
import React from 'react';
import { Route, Switch } from 'react-router-dom';
-import routes from 'routes/dashboard';
+
+import { getDashboardRoutes } from 'routes/dashboard';
import DashboardPage from './DashboardPage';
/**
* Dashboard content route.
*/
export default function DashboardContentRoute() {
+ const routes = getDashboardRoutes();
+
return (
diff --git a/client/src/components/Dashboard/DashboardTopbar.js b/client/src/components/Dashboard/DashboardTopbar.js
index 32d9b8b18..2422538c6 100644
--- a/client/src/components/Dashboard/DashboardTopbar.js
+++ b/client/src/components/Dashboard/DashboardTopbar.js
@@ -9,7 +9,7 @@ import {
Tooltip,
Position,
} from '@blueprintjs/core';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import DashboardTopbarUser from 'components/Dashboard/TopbarUser';
import DashboardBreadcrumbs from 'components/Dashboard/DashboardBreadcrumbs';
diff --git a/client/src/components/Dashboard/DashboardViewsTabs.js b/client/src/components/Dashboard/DashboardViewsTabs.js
index bb526d7f8..83c4034cc 100644
--- a/client/src/components/Dashboard/DashboardViewsTabs.js
+++ b/client/src/components/Dashboard/DashboardViewsTabs.js
@@ -1,5 +1,5 @@
import React, { useRef, useState, useEffect } from 'react';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import PropTypes from 'prop-types';
import { Button, Tabs, Tab, Tooltip, Position } from '@blueprintjs/core';
import { useHistory } from 'react-router';
diff --git a/client/src/components/Dashboard/GlobalHotkeys.js b/client/src/components/Dashboard/GlobalHotkeys.js
index 353c1c755..3ca7a2b0b 100644
--- a/client/src/components/Dashboard/GlobalHotkeys.js
+++ b/client/src/components/Dashboard/GlobalHotkeys.js
@@ -1,7 +1,7 @@
import React from 'react';
import { useHotkeys } from 'react-hotkeys-hook';
import { useHistory } from 'react-router-dom';
-import routes from 'routes/dashboard';
+import { getDashboardRoutes } from 'routes/dashboard';
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
import { compose } from 'utils';
@@ -10,6 +10,7 @@ function GlobalHotkeys({
toggleSidebarExpend,
}) {
const history = useHistory();
+ const routes = getDashboardRoutes();
const globalHotkeys = routes
.filter(({ hotkey }) => hotkey)
diff --git a/client/src/components/Dashboard/TopbarUser.js b/client/src/components/Dashboard/TopbarUser.js
index ab491c629..44e50dd7e 100644
--- a/client/src/components/Dashboard/TopbarUser.js
+++ b/client/src/components/Dashboard/TopbarUser.js
@@ -8,7 +8,7 @@ import {
Popover,
Position,
} from '@blueprintjs/core';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import { firstLettersArgs } from 'utils';
import { useAuthActions, useAuthUser } from 'hooks/state';
diff --git a/client/src/components/DataTable.js b/client/src/components/DataTable.js
index c653f2a71..ec0c5bab3 100644
--- a/client/src/components/DataTable.js
+++ b/client/src/components/DataTable.js
@@ -10,7 +10,7 @@ import {
useAsyncDebounce,
} from 'react-table';
import { useSticky } from 'react-table-sticky';
-import { formatMessage } from 'services/intl';
+import intl from 'react-intl-universal';
import { useUpdateEffect } from 'hooks';
import { saveInvoke } from 'utils';
@@ -209,6 +209,6 @@ DataTable.defaultProps = {
TablePaginationRenderer: TablePagination,
TableNoResultsRowRenderer: TableNoResultsRow,
- noResults: formatMessage({ id: 'there_is_no_results_in_the_table' }),
+ noResults: '',
payload: {},
};
diff --git a/client/src/components/DataTableCells/ItemsListCell.js b/client/src/components/DataTableCells/ItemsListCell.js
index 0413e5fc6..9ff7ddae1 100644
--- a/client/src/components/DataTableCells/ItemsListCell.js
+++ b/client/src/components/DataTableCells/ItemsListCell.js
@@ -4,7 +4,7 @@ import ItemsSuggestField from 'components/ItemsSuggestField';
import classNames from 'classnames';
import { FormGroup, Classes, Intent } from '@blueprintjs/core';
-import { formatMessage } from 'services/intl';
+import intl from 'react-intl-universal';
import { useCellAutoFocus } from 'hooks';
@@ -41,7 +41,7 @@ export default function ItemsListCell({
purchasable={filterPurchasable}
inputProps={{
inputRef: (ref) => (fieldRef.current = ref),
- placeholder: formatMessage({ id: 'enter_an_item' }),
+ placeholder: intl.get('enter_an_item'),
}}
openOnKeyDown={true}
blurOnSelectClose={false}
diff --git a/client/src/components/Datatable/TableCell.js b/client/src/components/Datatable/TableCell.js
index 46621de5e..84a50a89a 100644
--- a/client/src/components/Datatable/TableCell.js
+++ b/client/src/components/Datatable/TableCell.js
@@ -46,6 +46,8 @@ export default function TableCell({
);
}
+ const isRTL = true;
+
return (
-
{ noResults }
+
{noResultText}
);
-}
\ No newline at end of file
+}
diff --git a/client/src/components/Dragzone.js b/client/src/components/Dragzone.js
index f7dbe5d21..f62ddce5d 100644
--- a/client/src/components/Dragzone.js
+++ b/client/src/components/Dragzone.js
@@ -2,7 +2,7 @@ import React, { useState, useCallback, useEffect } from 'react';
import { useDropzone } from 'react-dropzone';
import classNames from 'classnames';
import Icon from 'components/Icon';
-import { formatMessage } from 'services/intl';
+import intl from 'react-intl-universal';
// const initialFile: {
// file: ?File,
@@ -12,7 +12,7 @@ import { formatMessage } from 'services/intl';
// };
export default function Dropzone({
- text = formatMessage({ id: 'drag_drop_files_here_or_click_here' }),
+ text = intl.get('drag_drop_files_here_or_click_here'),
onDrop,
initialFiles = [],
onDeleteFile,
diff --git a/client/src/components/Drawer/DrawerHeaderContent.js b/client/src/components/Drawer/DrawerHeaderContent.js
index 648651222..ff506c267 100644
--- a/client/src/components/Drawer/DrawerHeaderContent.js
+++ b/client/src/components/Drawer/DrawerHeaderContent.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import { Classes, Icon, H4, Button } from '@blueprintjs/core';
import withDrawerActions from 'containers/Drawer/withDrawerActions';
diff --git a/client/src/components/DynamicFilter/DynamicFilterCompatatorField.js b/client/src/components/DynamicFilter/DynamicFilterCompatatorField.js
index 7559369d6..b1cb3278e 100644
--- a/client/src/components/DynamicFilter/DynamicFilterCompatatorField.js
+++ b/client/src/components/DynamicFilter/DynamicFilterCompatatorField.js
@@ -1,17 +1,15 @@
import React, { useMemo } from 'react';
import { HTMLSelect, Classes } from '@blueprintjs/core';
-import { useIntl } from 'react-intl';
+import intl from 'react-intl-universal';
import { getConditionTypeCompatators } from './DynamicFilterCompatators';
export default function DynamicFilterCompatatorField({
dataType,
...restProps
}) {
- const { formatMessage } = useIntl();
-
const options = useMemo(
() => getConditionTypeCompatators(dataType).map(comp => ({
- value: comp.value, label: formatMessage({ id: comp.label_id }),
+ value: comp.value, label: intl.get(comp.label_id),
})),
[dataType]
);
diff --git a/client/src/components/DynamicFilter/DynamicFilterValueField.js b/client/src/components/DynamicFilter/DynamicFilterValueField.js
index 1d56e1bbb..10a9877ad 100644
--- a/client/src/components/DynamicFilter/DynamicFilterValueField.js
+++ b/client/src/components/DynamicFilter/DynamicFilterValueField.js
@@ -10,7 +10,8 @@ import { connect } from 'react-redux';
import { useQuery } from 'react-query';
import { DateInput } from '@blueprintjs/datetime';
import classNames from 'classnames';
-import { FormattedMessage as T, useIntl } from 'react-intl';
+import { FormattedMessage as T } from 'components';
+import intl from 'react-intl-universal';
import { debounce } from 'lodash';
import moment from 'moment';
@@ -45,7 +46,7 @@ function DynamicFilterValueField({
onChange,
inputDebounceWait = 250,
}) {
- const { formatMessage } = useIntl();
+
const [localValue, setLocalValue] = useState();
// Makes `localValue` controlled mode from `value`.
@@ -185,7 +186,7 @@ function DynamicFilterValueField({
diff --git a/client/src/components/FilterDropdown.js b/client/src/components/FilterDropdown.js
index 04f387972..4bdd172a9 100644
--- a/client/src/components/FilterDropdown.js
+++ b/client/src/components/FilterDropdown.js
@@ -12,7 +12,8 @@ import { isEqual, last } from 'lodash';
import { usePrevious } from 'react-use';
import Icon from 'components/Icon';
import { checkRequiredProperties, uniqueMultiProps } from 'utils';
-import { FormattedMessage as T, useIntl } from 'react-intl';
+import { FormattedMessage as T } from 'components';
+import intl from 'react-intl-universal';
import {
DynamicFilterValueField,
DynamicFilterCompatatorField,
@@ -41,7 +42,7 @@ export default function FilterDropdown({
initialCondition,
initialConditions,
}) {
- const { formatMessage } = useIntl();
+
// Fields key -> metadata table.
const fieldsKeyMapped = useMemo(() =>
@@ -51,10 +52,10 @@ export default function FilterDropdown({
// Conditions options.
const conditionalsOptions = useMemo(
() => [
- { value: '&&', label: formatMessage({ id: 'and' }) },
- { value: '||', label: formatMessage({ id: 'or' }) },
+ { value: '&&', label: intl.get('and') },
+ { value: '||', label: intl.get('or') },
],
- [formatMessage],
+ [],
);
// Resources fileds options for fields options.
const resourceFieldsOptions = useMemo(
@@ -91,7 +92,7 @@ export default function FilterDropdown({
if (values.conditions.length >= 12) {
limitToast = Toaster.show(
{
- message: formatMessage({ id: 'you_reached_conditions_limit' }),
+ message: intl.get('you_reached_conditions_limit'),
intent: Intent.WARNING,
},
limitToast,
@@ -102,7 +103,7 @@ export default function FilterDropdown({
defaultFilterCondition
]);
}
- }, [values, setFieldValue, formatMessage, defaultFilterCondition]);
+ }, [values, setFieldValue, defaultFilterCondition]);
// Filtered conditions that filters conditions that don't contain atleast
// on required fields or fileds keys that not exists.
diff --git a/client/src/components/FinancialSheet.js b/client/src/components/FinancialSheet.js
index 0f2373090..49d10231d 100644
--- a/client/src/components/FinancialSheet.js
+++ b/client/src/components/FinancialSheet.js
@@ -1,7 +1,8 @@
import React, { useMemo, useCallback } from 'react';
import moment from 'moment';
import classnames from 'classnames';
-import { FormattedMessage as T, useIntl } from 'react-intl';
+import { FormattedMessage as T } from 'components';
+import intl from 'react-intl-universal';
import 'style/pages/FinancialStatements/FinancialSheet.scss';
@@ -23,7 +24,7 @@ export default function FinancialSheet({
fullWidth = false,
currentDate = true,
}) {
- const { formatMessage } = useIntl();
+
const format = 'DD MMMM YYYY';
const formattedFromDate = useMemo(() => moment(fromDate).format(format), [
fromDate,
@@ -38,10 +39,10 @@ export default function FinancialSheet({
const nameModifer = name ? `financial-sheet--${name}` : '';
const methodsLabels = useMemo(
() => ({
- cash: formatMessage({ id: 'cash' }),
- accrual: formatMessage({ id: 'accrual' }),
+ cash: intl.get('cash'),
+ accrual: intl.get('accrual'),
}),
- [formatMessage],
+ [],
);
const getBasisLabel = useCallback((b) => methodsLabels[b], [methodsLabels]);
const basisLabel = useMemo(() => getBasisLabel(basis), [
diff --git a/client/src/components/FormattedMessage.js b/client/src/components/FormattedMessage.js
new file mode 100644
index 000000000..1c181c832
--- /dev/null
+++ b/client/src/components/FormattedMessage.js
@@ -0,0 +1,9 @@
+import intl from 'react-intl-universal';
+
+export function FormattedMessage({ id }) {
+ return intl.get(id);
+}
+
+export function FormattedHTMLMessage({ ...args }) {
+ return intl.formatHTMLMessage({ ...args })
+}
\ No newline at end of file
diff --git a/client/src/components/ItemsSuggestField.js b/client/src/components/ItemsSuggestField.js
index e1c7178d9..0194b12ea 100644
--- a/client/src/components/ItemsSuggestField.js
+++ b/client/src/components/ItemsSuggestField.js
@@ -5,7 +5,7 @@ import { CLASSES } from 'common/classes';
import { Suggest } from '@blueprintjs/select';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
export default function ItemsSuggestField({
items,
diff --git a/client/src/components/ListSelect.js b/client/src/components/ListSelect.js
index ebbfb5479..1035d184f 100644
--- a/client/src/components/ListSelect.js
+++ b/client/src/components/ListSelect.js
@@ -1,7 +1,7 @@
import React, { useState, useMemo, useEffect } from 'react';
import { Button, MenuItem } from '@blueprintjs/core';
import { Select } from '@blueprintjs/select';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from './FormattedMessage';
import classNames from 'classnames';
import { CLASSES } from 'common/classes';
diff --git a/client/src/components/NumberFormatDropdown/NumberFormatFields.js b/client/src/components/NumberFormatDropdown/NumberFormatFields.js
index 776024de3..314a87d01 100644
--- a/client/src/components/NumberFormatDropdown/NumberFormatFields.js
+++ b/client/src/components/NumberFormatDropdown/NumberFormatFields.js
@@ -3,7 +3,7 @@ import { FastField, ErrorMessage } from 'formik';
import { FormGroup, Checkbox, Switch } from '@blueprintjs/core';
import { CLASSES } from 'common/classes';
import { ListSelect } from 'components';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import { inputIntent } from 'utils';
import {
moneyFormat,
diff --git a/client/src/components/NumberFormatDropdown/NumberFormatFooter.js b/client/src/components/NumberFormatDropdown/NumberFormatFooter.js
index bb42b0ca9..cdaad893a 100644
--- a/client/src/components/NumberFormatDropdown/NumberFormatFooter.js
+++ b/client/src/components/NumberFormatDropdown/NumberFormatFooter.js
@@ -2,7 +2,7 @@ import React from 'react';
import { useFormikContext } from 'formik';
import { Button, Classes, Intent } from '@blueprintjs/core';
import classNames from 'classnames';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
/**
* Number format footer.
diff --git a/client/src/components/Pagination.js b/client/src/components/Pagination.js
index 9be89b476..27f9c3fe2 100644
--- a/client/src/components/Pagination.js
+++ b/client/src/components/Pagination.js
@@ -1,7 +1,7 @@
import React, { useReducer, useEffect } from 'react';
import classNames from 'classnames';
import { Button, ButtonGroup, Intent, HTMLSelect } from '@blueprintjs/core';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import PropTypes from 'prop-types';
import { range } from 'lodash';
import { Icon } from 'components';
diff --git a/client/src/components/PaymentReceiveListField.js b/client/src/components/PaymentReceiveListField.js
index 6b6b3a34d..9902758b4 100644
--- a/client/src/components/PaymentReceiveListField.js
+++ b/client/src/components/PaymentReceiveListField.js
@@ -1,7 +1,7 @@
import React, { useCallback } from 'react';
import { MenuItem } from '@blueprintjs/core';
import ListSelect from 'components/ListSelect';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
function PaymentReceiveListField({
invoices,
diff --git a/client/src/components/Preferences/PreferencesSidebar.js b/client/src/components/Preferences/PreferencesSidebar.js
index 8c5d3f9d5..6dbb5a20e 100644
--- a/client/src/components/Preferences/PreferencesSidebar.js
+++ b/client/src/components/Preferences/PreferencesSidebar.js
@@ -1,7 +1,7 @@
import React from 'react';
import { Menu, MenuItem, MenuDivider } from '@blueprintjs/core';
import { useHistory, useLocation } from 'react-router-dom';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import preferencesMenu from 'config/preferencesMenu';
import PreferencesSidebarContainer from './PreferencesSidebarContainer';
diff --git a/client/src/components/SalutationList.js b/client/src/components/SalutationList.js
index ba9661026..a87a9d4d6 100644
--- a/client/src/components/SalutationList.js
+++ b/client/src/components/SalutationList.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { formatMessage } from 'services/intl';
+import intl from 'react-intl-universal';
import { ListSelect } from 'components';
@@ -15,7 +15,7 @@ export default function SalutationList({ ...restProps }) {
items={items}
selectedItemProp={'key'}
textProp={'label'}
- defaultText={formatMessage({ id: 'salutation' })}
+ defaultText={intl.get('salutation')}
filterable={false}
{...restProps}
/>
diff --git a/client/src/components/index.js b/client/src/components/index.js
index 5b332d816..c8d56dfe9 100644
--- a/client/src/components/index.js
+++ b/client/src/components/index.js
@@ -3,6 +3,7 @@ import Money from './Money';
import Icon from './Icon';
import Choose from './Utils/Choose';
import For from './Utils/For';
+import { FormattedMessage, FormattedHTMLMessage } from './FormattedMessage';
import ListSelect from './ListSelect';
import FinancialStatement from './FinancialStatement';
import DynamicFilterValueField from './DynamicFilter/DynamicFilterValueField';
@@ -58,14 +59,19 @@ import MaterialProgressBar from './MaterialProgressBar';
const Hint = FieldHint;
+const T = FormattedMessage;
+
export {
If,
For,
- Money,
+ Choose,
Icon,
+ FormattedMessage,
+ FormattedHTMLMessage,
+ T,
+ Money,
ListSelect,
FinancialStatement,
- Choose,
DynamicFilterValueField,
DynamicFilterCompatatorField,
MODIFIER,
diff --git a/client/src/config/financialReportsMenu.js b/client/src/config/financialReportsMenu.js
index 43bfe4c4a..4c3226a4f 100644
--- a/client/src/config/financialReportsMenu.js
+++ b/client/src/config/financialReportsMenu.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
export const financialReportMenus = [
{
@@ -66,7 +66,7 @@ export const SalesAndPurchasesReportMenus = [
desc: (
),
@@ -107,7 +107,9 @@ export const SalesAndPurchasesReportMenus = [
},
{
title: ,
- desc: 'summerize_the_total_amount_your_business_owes_each_vendor',
+ desc: (
+
+ ),
link: '/financial-reports/vendors-balance-summary',
},
{
diff --git a/client/src/config/preferencesMenu.js b/client/src/config/preferencesMenu.js
index 019555d4a..3e1b981dd 100644
--- a/client/src/config/preferencesMenu.js
+++ b/client/src/config/preferencesMenu.js
@@ -1,5 +1,5 @@
import React from 'react'
-import { FormattedMessage as T} from 'react-intl';
+import { FormattedMessage as T } from 'components';
export default [
{
diff --git a/client/src/config/sidebarMenu.js b/client/src/config/sidebarMenu.js
index 9edf634de..4938f5cba 100644
--- a/client/src/config/sidebarMenu.js
+++ b/client/src/config/sidebarMenu.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
export default [
{
@@ -16,7 +16,7 @@ export default [
text: ,
children: [
{
- text: ,
+ text: ,
href: '/items',
},
{
@@ -67,7 +67,7 @@ export default [
newTabHref: '/bills/new',
},
{
- text: ,
+ text: ,
href: '/payment-mades',
newTabHref: '/payment-mades/new',
},
diff --git a/client/src/containers/Accounting/JournalsLanding/ManualJournalActionsBar.js b/client/src/containers/Accounting/JournalsLanding/ManualJournalActionsBar.js
index e0b3014fa..a061c04ef 100644
--- a/client/src/containers/Accounting/JournalsLanding/ManualJournalActionsBar.js
+++ b/client/src/containers/Accounting/JournalsLanding/ManualJournalActionsBar.js
@@ -12,7 +12,7 @@ import {
} from '@blueprintjs/core';
import classNames from 'classnames';
import { useHistory } from 'react-router-dom';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import { useManualJournalsContext } from './ManualJournalsListProvider';
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
diff --git a/client/src/containers/Accounting/JournalsLanding/ManualJournalsEmptyStatus.js b/client/src/containers/Accounting/JournalsLanding/ManualJournalsEmptyStatus.js
index d487a29be..f3d641f22 100644
--- a/client/src/containers/Accounting/JournalsLanding/ManualJournalsEmptyStatus.js
+++ b/client/src/containers/Accounting/JournalsLanding/ManualJournalsEmptyStatus.js
@@ -2,7 +2,7 @@ import React from 'react';
import { Button, Intent } from '@blueprintjs/core';
import { useHistory } from 'react-router-dom';
import { EmptyStatus } from 'components';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
export default function ManualJournalsEmptyStatus() {
const history = useHistory();
diff --git a/client/src/containers/Accounting/JournalsLanding/components.js b/client/src/containers/Accounting/JournalsLanding/components.js
index 6cb1cdd2f..7a4f70bf7 100644
--- a/client/src/containers/Accounting/JournalsLanding/components.js
+++ b/client/src/containers/Accounting/JournalsLanding/components.js
@@ -11,11 +11,11 @@ import {
MenuDivider,
Popover,
} from '@blueprintjs/core';
-import { FormattedMessage as T } from 'react-intl';
+import { FormattedMessage as T } from 'components';
import moment from 'moment';
import { Choose, Money, If, Icon } from 'components';
import { safeCallback } from 'utils';
-import { formatMessage } from 'services/intl';
+import intl from 'react-intl-universal';
/**
* Amount accessor.
@@ -155,24 +155,24 @@ export const ActionsMenu = ({