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,9 +1,6 @@
import React from 'react';
import {
FormattedMessage as T,
FormattedHTMLMessage,
useIntl,
} from 'react-intl';
import intl from 'react-intl-universal';
import { FormattedMessage as T, FormattedHTMLMessage } from 'components';
import { Intent, Alert } from '@blueprintjs/core';
import { AppToaster } from 'components';
@@ -28,7 +25,7 @@ function InventoryAdjustmentDeleteAlert({
// #withAlertActions
closeAlert,
}) {
const { formatMessage } = useIntl();
const {
mutateAsync: deleteInventoryAdjMutate,
isLoading
@@ -44,9 +41,7 @@ function InventoryAdjustmentDeleteAlert({
deleteInventoryAdjMutate(inventoryId)
.then(() => {
AppToaster.show({
message: formatMessage({
id: 'the_adjustment_has_been_deleted_successfully',
}),
message: intl.get('the_adjustment_has_been_deleted_successfully'),
intent: Intent.SUCCESS,
});
})

View File

@@ -1,5 +1,6 @@
import React from 'react';
import { FormattedMessage as T, useIntl } from 'react-intl';
import { FormattedMessage as T } from 'components';
import intl from 'react-intl-universal';
import { Intent, Alert } from '@blueprintjs/core';
import { AppToaster } from 'components';
@@ -25,7 +26,7 @@ function ItemActivateAlert({
// #withAlertActions
closeAlert,
}) {
const { formatMessage } = useIntl();
const { mutateAsync: activateItem, isLoading } = useActivateItem();
// Handle activate item alert cancel.
@@ -38,9 +39,7 @@ function ItemActivateAlert({
activateItem(itemId)
.then(() => {
AppToaster.show({
message: formatMessage({
id: 'the_item_has_been_activated_successfully',
}),
message: intl.get('the_item_has_been_activated_successfully'),
intent: Intent.SUCCESS,
});
})

View File

@@ -1,5 +1,6 @@
import React, { useState } from 'react';
import { FormattedMessage as T, useIntl } from 'react-intl';
import { FormattedMessage as T } from 'components';
import intl from 'react-intl-universal';
import { Intent, Alert } from '@blueprintjs/core';
import { size } from 'lodash';
import { AppToaster } from 'components';
@@ -26,7 +27,7 @@ function ItemBulkDeleteAlert({
// #withAlertActions
closeAlert,
}) {
const { formatMessage } = useIntl();
const [isLoading, setLoading] = useState(false);
// handle cancel item bulk delete alert.
@@ -39,9 +40,7 @@ function ItemBulkDeleteAlert({
requestDeleteBulkItems(itemsIds)
.then(() => {
AppToaster.show({
message: formatMessage({
id: 'the_items_has_been_deleted_successfully',
}),
message: intl.get('the_items_has_been_deleted_successfully'),
intent: Intent.SUCCESS,
});
})

View File

@@ -1,9 +1,6 @@
import React, { useState } from 'react';
import {
FormattedMessage as T,
FormattedHTMLMessage,
useIntl,
} from 'react-intl';
import intl from 'react-intl-universal';
import { FormattedMessage as T, FormattedHTMLMessage } from 'components';
import { Intent, Alert } from '@blueprintjs/core';
import { size } from 'lodash';
import { AppToaster } from 'components';
@@ -30,7 +27,7 @@ function ItemCategoryBulkDeleteAlert({
// #withAlertActions
closeAlert,
}) {
const { formatMessage } = useIntl();
const [isLoading, setLoading] = useState(false);
// handle cancel bulk delete alert.
@@ -44,9 +41,7 @@ function ItemCategoryBulkDeleteAlert({
requestDeleteBulkItemCategories(itemCategoriesIds)
.then(() => {
AppToaster.show({
message: formatMessage({
id: 'the_item_categories_has_been_deleted_successfully',
}),
message: intl.get('the_item_categories_has_been_deleted_successfully'),
intent: Intent.SUCCESS,
});
})

View File

@@ -1,9 +1,6 @@
import React from 'react';
import {
FormattedMessage as T,
FormattedHTMLMessage,
useIntl,
} from 'react-intl';
import intl from 'react-intl-universal';
import { FormattedMessage as T, FormattedHTMLMessage } from 'components';
import { Intent, Alert } from '@blueprintjs/core';
import { useDeleteItemCategory } from 'hooks/query';
@@ -27,7 +24,7 @@ function ItemCategoryDeleteAlert({
// #withAlertActions
closeAlert,
}) {
const { formatMessage } = useIntl();
const {
mutateAsync: deleteItemCategory,
isLoading,
@@ -43,9 +40,7 @@ function ItemCategoryDeleteAlert({
deleteItemCategory(itemCategoryId)
.then(() => {
AppToaster.show({
message: formatMessage({
id: 'the_item_category_has_been_deleted_successfully',
}),
message: intl.get('the_item_category_has_been_deleted_successfully'),
intent: Intent.SUCCESS,
});
})

View File

@@ -1,9 +1,6 @@
import React from 'react';
import {
FormattedMessage as T,
FormattedHTMLMessage,
useIntl,
} from 'react-intl';
import intl from 'react-intl-universal';
import { FormattedMessage as T, FormattedHTMLMessage } from 'components';
import { Intent, Alert } from '@blueprintjs/core';
import { AppToaster } from 'components';
@@ -33,7 +30,7 @@ function ItemDeleteAlert({
setItemsTableState,
}) {
const { mutateAsync: deleteItem, isLoading } = useDeleteItem();
const { formatMessage } = useIntl();
// Handle cancel delete item alert.
const handleCancelItemDelete = () => {
@@ -45,9 +42,7 @@ function ItemDeleteAlert({
deleteItem(itemId)
.then(() => {
AppToaster.show({
message: formatMessage({
id: 'the_item_has_been_deleted_successfully',
}),
message: intl.get('the_item_has_been_deleted_successfully'),
intent: Intent.SUCCESS,
});
// Reset to page number one.

View File

@@ -1,5 +1,6 @@
import React from 'react';
import { FormattedMessage as T, useIntl } from 'react-intl';
import { FormattedMessage as T } from 'components';
import intl from 'react-intl-universal';
import { Intent, Alert } from '@blueprintjs/core';
import { AppToaster } from 'components';
@@ -23,7 +24,7 @@ function ItemInactivateAlert({
// #withAlertActions
closeAlert,
}) {
const { formatMessage } = useIntl();
const { mutateAsync: inactivateItem, isLoading } = useInactivateItem();
// Handle cancel inactivate alert.
@@ -36,9 +37,7 @@ function ItemInactivateAlert({
inactivateItem(itemId)
.then(() => {
AppToaster.show({
message: formatMessage({
id: 'the_item_has_been_inactivated_successfully',
}),
message: intl.get('the_item_has_been_inactivated_successfully'),
intent: Intent.SUCCESS,
});
})