diff --git a/client/src/components/AppIntlLoader.js b/client/src/components/AppIntlLoader.js
index 7775d2ce7..03f4251c4 100644
--- a/client/src/components/AppIntlLoader.js
+++ b/client/src/components/AppIntlLoader.js
@@ -6,8 +6,8 @@ import rtlDetect from 'rtl-detect';
import DashboardLoadingIndicator from 'components/Dashboard/DashboardLoadingIndicator';
const SUPPORTED_LOCALES = [
- { name: "English", value: "en" },
- { name: 'العربية', value: 'ar' }
+ { name: 'English', value: 'en' },
+ { name: 'العربية', value: 'ar-ly' },
];
/**
@@ -15,12 +15,12 @@ const SUPPORTED_LOCALES = [
*/
function getCurrentLocal() {
let currentLocale = intl.determineLocale({
- urlLocaleKey: "lang",
- cookieLocaleKey: "lang",
- localStorageLocaleKey: "lang",
+ urlLocaleKey: 'lang',
+ cookieLocaleKey: 'lang',
+ localStorageLocaleKey: 'lang',
});
if (!find(SUPPORTED_LOCALES, { value: currentLocale })) {
- currentLocale = "en";
+ currentLocale = 'en';
}
return currentLocale;
}
@@ -50,9 +50,7 @@ function useDocumentDirectionModifier(locale) {
/**
* Application Intl loader.
*/
-export default function AppIntlLoader({
- children
-}) {
+export default function AppIntlLoader({ children }) {
const [isLoading, setIsLoading] = React.useState(true);
const currentLocale = getCurrentLocal();
@@ -61,22 +59,24 @@ export default function AppIntlLoader({
React.useEffect(() => {
// Lodas the locales data file.
- loadLocales(currentLocale).then((results) => {
- return intl.init({
- currentLocale,
- locales: {
- [currentLocale]: results,
- },
+ loadLocales(currentLocale)
+ .then((results) => {
+ return intl.init({
+ currentLocale,
+ locales: {
+ [currentLocale]: results,
+ },
+ });
+ })
+ .then(() => {
+ moment.locale(currentLocale);
+ setIsLoading(false);
});
- }).then(() => {
- moment.locale('ar-ly');
- setIsLoading(false);
- });
}, [currentLocale, setIsLoading]);
return (
{children}
- );
-}
\ No newline at end of file
+ );
+}
diff --git a/client/src/components/ContactsMultiSelect.js b/client/src/components/ContactsMultiSelect.js
index 7cbb1c332..9a480f66a 100644
--- a/client/src/components/ContactsMultiSelect.js
+++ b/client/src/components/ContactsMultiSelect.js
@@ -3,6 +3,7 @@ import { MenuItem, Button } from '@blueprintjs/core';
import { omit } from 'lodash';
import MultiSelect from 'components/MultiSelect';
import { FormattedMessage as T } from 'components';
+import intl from 'react-intl-universal';
export default function ContactsMultiSelect({
contacts,
@@ -31,9 +32,10 @@ export default function ContactsMultiSelect({
[isContactSelect],
);
- const countSelected = useMemo(() => Object.values(selectedContacts).length, [
- selectedContacts,
- ]);
+ const countSelected = useMemo(
+ () => Object.values(selectedContacts).length,
+ [selectedContacts],
+ );
const onContactSelect = useCallback(
({ id }) => {
@@ -50,12 +52,7 @@ export default function ContactsMultiSelect({
setSelectedContacts({ ...selected });
onContactSelected && onContactSelected(selected);
},
- [
- setSelectedContacts,
- selectedContacts,
- isContactSelect,
- onContactSelected,
- ],
+ [setSelectedContacts, selectedContacts, isContactSelect, onContactSelected],
);
return (
@@ -69,11 +66,9 @@ export default function ContactsMultiSelect({
>
- )
+ countSelected === 0
+ ? defaultText
+ : intl.get('selected_customers', { count: countSelected })
}
{...buttonProps}
/>
diff --git a/client/src/components/Pagination.js b/client/src/components/Pagination.js
index 27f9c3fe2..b3e16ab36 100644
--- a/client/src/components/Pagination.js
+++ b/client/src/components/Pagination.js
@@ -2,6 +2,7 @@ import React, { useReducer, useEffect } from 'react';
import classNames from 'classnames';
import { Button, ButtonGroup, Intent, HTMLSelect } from '@blueprintjs/core';
import { FormattedMessage as T } from 'components';
+import intl from 'react-intl-universal';
import PropTypes from 'prop-types';
import { range } from 'lodash';
import { Icon } from 'components';
@@ -204,14 +205,11 @@ function Pagination({
);
diff --git a/client/src/containers/Accounting/MakeJournal/MakeJournalEntriesHeader.js b/client/src/containers/Accounting/MakeJournal/MakeJournalEntriesHeader.js
index 9682c0e03..3e982cef0 100644
--- a/client/src/containers/Accounting/MakeJournal/MakeJournalEntriesHeader.js
+++ b/client/src/containers/Accounting/MakeJournal/MakeJournalEntriesHeader.js
@@ -21,7 +21,7 @@ export default function MakeJournalEntriesHeader() {
}
+ label={}
amount={total}
currencyCode={currency_code}
/>
diff --git a/client/src/containers/Accounts/AccountsActionsBar.js b/client/src/containers/Accounts/AccountsActionsBar.js
index 25df336fa..2731c823e 100644
--- a/client/src/containers/Accounts/AccountsActionsBar.js
+++ b/client/src/containers/Accounts/AccountsActionsBar.js
@@ -13,6 +13,7 @@ import {
} from '@blueprintjs/core';
import classNames from 'classnames';
import { FormattedMessage as T } from 'components';
+import intl from 'react-intl-universal';
import { If, DashboardActionViewsList } from 'components';
import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar';
@@ -104,7 +105,7 @@ function AccountsActionsBar({
true ? (
) : (
-
+ intl.get('count_filters_applied', { count: 0 })
)
}
icon={}
@@ -159,5 +160,5 @@ export default compose(
withAccounts(({ accountsSelectedRows }) => ({
accountsSelectedRows,
})),
- withAccountsTableActions
+ withAccountsTableActions,
)(AccountsActionsBar);
diff --git a/client/src/containers/Authentication/InviteAcceptFormContent.js b/client/src/containers/Authentication/InviteAcceptFormContent.js
index ad3d0e3a5..a5d063446 100644
--- a/client/src/containers/Authentication/InviteAcceptFormContent.js
+++ b/client/src/containers/Authentication/InviteAcceptFormContent.js
@@ -3,6 +3,7 @@ import { Button, InputGroup, Intent, FormGroup } from '@blueprintjs/core';
import { Form, ErrorMessage, FastField, useFormikContext } from 'formik';
import { Link } from 'react-router-dom';
import { FormattedMessage as T } from 'components';
+import intl from 'react-intl-universal';
import { inputIntent } from 'utils';
import { Col, Row } from 'components';
import { useInviteAcceptContext } from './InviteAcceptProvider';
@@ -108,13 +109,10 @@ export default function InviteUserFormContent() {
- {msg},
- privacy: (msg) => {msg},
- }}
- />
+ {intl.getHTML('signing_in_or_creating', {
+ terms: (msg) => {msg},
+ privacy: (msg) => {msg},
+ })}
diff --git a/client/src/containers/Authentication/RegisterForm.js b/client/src/containers/Authentication/RegisterForm.js
index 742e2db66..f634b2f42 100644
--- a/client/src/containers/Authentication/RegisterForm.js
+++ b/client/src/containers/Authentication/RegisterForm.js
@@ -8,6 +8,7 @@ import {
} from '@blueprintjs/core';
import { ErrorMessage, Field, Form } from 'formik';
import { FormattedMessage as T } from 'components';
+import intl from 'react-intl-universal';
import { Link } from 'react-router-dom';
import { Row, Col, If } from 'components';
import { PasswordRevealer } from './components';
@@ -117,13 +118,10 @@ export default function RegisterForm({ isSubmitting }) {
- {msg},
- privacy: (msg) => {msg},
- }}
- />
+ {intl.getHTML('signing_in_or_creating', {
+ terms: (msg) => {msg},
+ privacy: (msg) => {msg},
+ })}
diff --git a/client/src/containers/FinancialStatements/reducers.js b/client/src/containers/FinancialStatements/reducers.js
index 4e6edfcbf..7d6770764 100644
--- a/client/src/containers/FinancialStatements/reducers.js
+++ b/client/src/containers/FinancialStatements/reducers.js
@@ -2,6 +2,7 @@ import React from 'react';
import { chain } from 'lodash';
import moment from 'moment';
import { FormattedMessage as T } from 'components';
+import intl from 'react-intl-universal';
export const balanceSheetRowsReducer = (accounts) => {
return accounts.map((account) => {
@@ -12,7 +13,7 @@ export const balanceSheetRowsReducer = (accounts) => {
...(account.total && account.children && account.children.length > 0
? [
{
- name: ,
+ name: intl.get('total_name', { name: account.name }),
row_types: ['total-row', account.section_type],
total: { ...account.total },
...(account.total_periods && {
diff --git a/client/src/containers/Purchases/Bills/BillsLanding/components.js b/client/src/containers/Purchases/Bills/BillsLanding/components.js
index d7d42900b..34d299000 100644
--- a/client/src/containers/Purchases/Bills/BillsLanding/components.js
+++ b/client/src/containers/Purchases/Bills/BillsLanding/components.js
@@ -11,7 +11,7 @@ import {
ProgressBar,
} from '@blueprintjs/core';
import intl from 'react-intl-universal';
-import { FormattedMessage as T } from 'components';
+import { FormattedMessage as T } from 'components';
import { Icon, If, Choose, Money } from 'components';
import { safeCallback, isBlank, calculateStatus } from 'utils';
import moment from 'moment';
@@ -23,8 +23,6 @@ export function ActionsMenu({
payload: { onEdit, onOpen, onDelete, onQuick },
row: { original },
}) {
-
-
return (