mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat add localization.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import { castArray } from 'lodash';
|
||||
import { Formik, Form, useFormikContext } from 'formik';
|
||||
import styled from 'styled-components';
|
||||
@@ -36,9 +37,12 @@ function SMSMessagePreviewSection() {
|
||||
<SMSPreviewSectionRoot>
|
||||
<SMSMessagePreview message={sms_message} />
|
||||
<SMSPreviewSectionNote>
|
||||
<strong>Note</strong>: Note: One SMS unit can contain a maximum of 160
|
||||
characters. <strong>{messagesUnits}</strong> SMS units will be used to
|
||||
send this SMS notification.
|
||||
{intl.formatHTMLMessage(
|
||||
{ id: 'notiify_via_sms.dialog.sms_note' },
|
||||
{
|
||||
value: messagesUnits,
|
||||
},
|
||||
)}
|
||||
</SMSPreviewSectionNote>
|
||||
</SMSPreviewSectionRoot>
|
||||
);
|
||||
|
||||
@@ -18,7 +18,7 @@ export default function NotifyViaSMSFormFields({ notificationTypes }) {
|
||||
<FastField name={'notification_key'}>
|
||||
{({ form, meta: { error, touched } }) => (
|
||||
<FormGroup
|
||||
label={'Notification type'}
|
||||
label={<T id={'notify_via_sms.dialog.notification_type'} />}
|
||||
className={classNames(CLASSES.FILL)}
|
||||
intent={inputIntent({ error, touched })}
|
||||
helperText={<ErrorMessage name={'customer_name'} />}
|
||||
|
||||
@@ -25,7 +25,7 @@ export default function NotifyViaSMSFormFloatingActions({ onCancel }) {
|
||||
style={{ minWidth: '110px' }}
|
||||
type="submit"
|
||||
>
|
||||
Send SMS
|
||||
<T id={'send_sms'} />
|
||||
</Button>
|
||||
<Button
|
||||
disabled={isSubmitting}
|
||||
@@ -37,4 +37,4 @@ export default function NotifyViaSMSFormFloatingActions({ onCancel }) {
|
||||
</DialogFooterActions>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import intl from 'react-intl-universal';
|
||||
export const transformErrors = (errors, { setErrors }) => {
|
||||
if (errors.some((e) => e.type === 'CUSTOMER_SMS_NOTIFY_PHONE_INVALID')) {
|
||||
AppToaster.show({
|
||||
message: intl.get('notify_via_sms.dialog.error_message'),
|
||||
message: intl.get('notify_via_sms.dialog.phone_invalid_error_message'),
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user