Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language update #1638

Merged
merged 2 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/containers/InteractiveMessage/InteractiveMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ export const InteractiveMessage: React.SFC<FlowProps> = ({ match }) => {
rows: 5,
convertToWhatsApp: true,
textArea: true,
helperText: 'You can also use variables in message enter @ to see the available list',
helperText: t('You can also use variables in message enter @ to see the available list'),
getEditorValue: (value: any) => {
setBody(value);
},
Expand Down Expand Up @@ -687,7 +687,9 @@ export const InteractiveMessage: React.SFC<FlowProps> = ({ match }) => {
const formFields = templateType === LIST ? [...fields] : [...fields, ...attachmentInputs];

const validation: any = {
title: Yup.string().required('Title is required').max(60, 'Title can be at most 60 characters'),
title: Yup.string()
.required(t('Title is required'))
.max(60, t('Title can be at most 60 characters')),
body: Yup.string()
.transform((current, original) => original.getCurrentContent().getPlainText())
.required(t('Message content is required.')),
Expand All @@ -698,30 +700,30 @@ export const InteractiveMessage: React.SFC<FlowProps> = ({ match }) => {
.of(
Yup.object().shape({
title: Yup.string()
.required('Required')
.max(24, 'Section title can be at most 24 characters'),
.required(t('Required'))
.max(24, t('Section title can be at most 24 characters')),
options: Yup.array().of(
Yup.object().shape({
title: Yup.string()
.required('Title is required')
.max(24, 'Title can be at most 24 characters'),
description: Yup.string().max(72, 'Description can be at most 72 characters'),
.required(t('Title is required'))
.max(24, t('Title can be at most 24 characters')),
description: Yup.string().max(72, t('Description can be at most 72 characters')),
})
),
})
)
.min(1);

validation.globalButton = Yup.string()
.required('Required')
.max(20, 'Button value can be at most 20 characters');
.required(t('Required'))
.max(20, t('Button value can be at most 20 characters'));
} else {
validation.templateButtons = Yup.array()
.of(
Yup.object().shape({
value: Yup.string()
.required('Required')
.max(20, 'Button value can be at most 20 characters'),
.required(t('Required'))
.max(20, t('Button value can be at most 20 characters')),
})
)
.min(1)
Expand Down
7 changes: 7 additions & 0 deletions src/i18n/en/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,15 @@
"You won't be able to use this again.": "You won't be able to use this again.",
"Title*": "Title*",
"Message*": "Message*",
"You can also use variables in message enter @ to see the available list": "You can also use variables in message enter @ to see the available list",
"Attachment type": "Attachment type",
"Title is required": "Title is required",
"Title can be at most 60 characters": "Title can be at most 60 characters",
"Message content is required.": "Message content is required.",
"Section title can be at most 24 characters": "Section title can be at most 24 characters",
"Title can be at most 24 characters": "Title can be at most 24 characters",
"Description can be at most 72 characters": "Description can be at most 72 characters",
"Button value can be at most 20 characters": "Button value can be at most 20 characters",
"Attachment URL is required.": "Attachment URL is required.",
"You won't be able to use this interactive message.": "You won't be able to use this interactive message.",
"Show all languages": "Show all languages",
Expand Down