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,6 +1,7 @@
import React, { useState, useEffect, useCallback, useMemo } from 'react';
import { useFormik } from 'formik';
import { FormattedMessage as T, useIntl } from 'react-intl';
import { FormattedMessage as T } from 'components';
import intl from 'react-intl-universal';
import {useHistory } from 'react-router-dom';
import {
@@ -339,7 +340,7 @@ function ViewForm({
intent={hasError(`roles[${index}].value`) && Intent.DANGER}
>
<InputGroup
placeholder={intl.formatMessage({ id: 'value' })}
placeholder={intl.get('value')}
{...getFieldProps(`roles[${index}].value`)}
/>
</FormGroup>
@@ -370,7 +371,7 @@ function ViewForm({
<Row>
<Col sm={8}>
<FormGroup
label={intl.formatMessage({ id: 'Logic Expression' })}
label={intl.get('Logic Expression')}
className={'form-group--logic-expression'}
intent={
errors.logic_expression &&
@@ -408,7 +409,7 @@ function ViewForm({
<H6 className='dragable-columns__title'>Available Columns</H6>
<InputGroup
placeholder={intl.formatMessage({ id: 'search' })}
placeholder={intl.get('search')}
leftIcon='search'
/>
@@ -449,7 +450,7 @@ function ViewForm({
<Col sm={4} className='dragable-columns__column'>
<H6 className='dragable-columns__title'>Selected Columns</H6>
<InputGroup
placeholder={intl.formatMessage({ id: 'search' })}
placeholder={intl.get('search')}
leftIcon='search'
/>

View File

@@ -2,7 +2,7 @@ import React, {useEffect, useState, useCallback} from 'react';
import { useAsync } from 'react-use';
import { useParams } from 'react-router-dom';
import { Intent, Alert } from '@blueprintjs/core';
import { FormattedMessage as T, FormattedHTMLMessage, useIntl } from 'react-intl';
import { FormattedMessage as T, FormattedHTMLMessage } from 'react-intl';
import DashboardInsider from 'components/Dashboard/DashboardInsider';
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
@@ -33,7 +33,7 @@ function ViewFormPage({
const { resource_slug: resourceSlug, view_id: viewId } = useParams();
const [stateDeleteView, setStateDeleteView] = useState(null);
const { formatMessage } = useIntl();
const fetchHook = useAsync(async () => {
return Promise.all([
@@ -51,14 +51,14 @@ function ViewFormPage({
useEffect(() => {
if (viewId) {
changePageTitle(formatMessage({id:'edit_custom_view'}));
changePageTitle(intl.get('edit_custom_view'));
} else {
changePageTitle(formatMessage({id:'new_custom_view'}));
changePageTitle(intl.get('new_custom_view'));
}
return () => {
changePageTitle('');
};
}, [viewId, changePageTitle,formatMessage]);
}, [viewId, changePageTitle]);
// Handle delete view button click.
@@ -76,9 +76,7 @@ function ViewFormPage({
requestDeleteView(stateDeleteView.id).then((response) => {
setStateDeleteView(null);
AppToaster.show({
message: formatMessage({
id: 'the_custom_view_has_been_deleted_successfully',
}),
message: intl.get('the_custom_view_has_been_deleted_successfully'),
intent: Intent.SUCCESS,
});
})