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,12 @@
import React from 'react';
import { Intent } from '@blueprintjs/core';
import { AppToaster } from 'components';
import { formatMessage } from 'services/intl';
import intl from 'react-intl-universal';
export const transformErrors = (errors) => {
if (errors.some((e) => e.type === 'CUSTOMER.HAS.SALES_INVOICES')) {
AppToaster.show({
message: formatMessage({
id: 'customer_has_sales_invoices',
}),
message: intl.get('customer_has_sales_invoices'),
intent: Intent.DANGER,
});
}
@@ -16,18 +14,13 @@ export const transformErrors = (errors) => {
errors.find((error) => error.type === 'SOME.CUSTOMERS.HAVE.SALES_INVOICES')
) {
AppToaster.show({
message: formatMessage({
id: 'some_customers_have_sales_invoices',
}),
message: intl.get('some_customers_have_sales_invoices'),
intent: Intent.DANGER,
});
}
if (errors.find((error) => error.type === 'CUSTOMER_HAS_TRANSACTIONS')) {
AppToaster.show({
message: formatMessage({
id:
'this_customer_cannot_be_deleted_as_it_is_associated_with_transactions',
}),
message: intl.get('this_customer_cannot_be_deleted_as_it_is_associated_with_transactions'),
intent: Intent.DANGER,
});
}