WIP: Arabic localization.|

This commit is contained in:
a.bouhuolia
2021-06-10 12:51:00 +02:00
parent 4fc7c37260
commit 1ea32884c2
465 changed files with 3299 additions and 2109 deletions

View File

@@ -1,14 +1,14 @@
import React, { useMemo } from 'react';
import { Formik, Form } from 'formik';
import { Intent } from '@blueprintjs/core';
import { useIntl } from 'react-intl';
import intl from 'react-intl-universal';
import { sumBy, omit, isEmpty } from 'lodash';
import classNames from 'classnames';
import { useHistory } from 'react-router-dom';
import { CLASSES } from 'common/classes';
import {
CreateInvoiceFormSchema,
EditInvoiceFormSchema,
getCreateInvoiceFormSchema,
getEditInvoiceFormSchema,
} from './InvoiceForm.schema';
import InvoiceFormHeader from './InvoiceFormHeader';
@@ -36,7 +36,6 @@ function InvoiceForm({
invoiceIncrementMode,
baseCurrency,
}) {
const { formatMessage } = useIntl();
const history = useHistory();
// Invoice form context.
@@ -85,7 +84,7 @@ function InvoiceForm({
// Throw danger toaster in case total quantity equals zero.
if (totalQuantity === 0) {
AppToaster.show({
message: formatMessage({ id: 'quantity_cannot_be_zero_or_empty' }),
message: intl.get('quantity_cannot_be_zero_or_empty'),
intent: Intent.DANGER,
});
setSubmitting(false);
@@ -103,12 +102,10 @@ function InvoiceForm({
// Handle the request success.
const onSuccess = () => {
AppToaster.show({
message: formatMessage(
{
id: isNewMode
? 'the_invoice_has_been_created_successfully'
: 'the_invoice_has_been_edited_successfully',
},
message: intl.get(
isNewMode
? 'the_invoice_has_been_created_successfully'
: 'the_invoice_has_been_edited_successfully',
{ number: values.invoice_no },
),
intent: Intent.SUCCESS,
@@ -141,6 +138,9 @@ function InvoiceForm({
}
};
const CreateInvoiceFormSchema = getCreateInvoiceFormSchema();
const EditInvoiceFormSchema = getEditInvoiceFormSchema();
return (
<div
className={classNames(