From 4682fc93608d42f4e25ad1d56f8f79f67da1d138 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Fri, 29 Sep 2023 16:26:21 +0530 Subject: [PATCH] fix: i18n for webhook editor --- packages/nc-gui/components/webhook/Editor.vue | 107 +++++++++--------- packages/nc-gui/lang/en.json | 25 ++++ 2 files changed, 81 insertions(+), 51 deletions(-) diff --git a/packages/nc-gui/components/webhook/Editor.vue b/packages/nc-gui/components/webhook/Editor.vue index 1de3554b32..7c4ff4b45d 100644 --- a/packages/nc-gui/components/webhook/Editor.vue +++ b/packages/nc-gui/components/webhook/Editor.vue @@ -94,22 +94,22 @@ const formInput = ref({ 'Email': [ { key: 'to', - label: 'To Address', - placeholder: 'To Address', + label: t('labels.toAddress'), + placeholder: t('labels.toAddress'), type: 'SingleLineText', required: true, }, { key: 'subject', - label: 'Subject', - placeholder: 'Subject', + label: t('labels.subject'), + placeholder: t('labels.subject'), type: 'SingleLineText', required: true, }, { key: 'body', - label: 'Body', - placeholder: 'Body', + label: t('labels.body'), + placeholder: t('labels.body'), type: 'LongText', required: true, }, @@ -117,8 +117,8 @@ const formInput = ref({ 'Slack': [ { key: 'body', - label: 'Body', - placeholder: 'Body', + label: t('labels.body'), + placeholder: t('labels.body'), type: 'LongText', required: true, }, @@ -126,8 +126,8 @@ const formInput = ref({ 'Microsoft Teams': [ { key: 'body', - label: 'Body', - placeholder: 'Body', + label: t('labels.body'), + placeholder: t('labels.body'), type: 'LongText', required: true, }, @@ -135,8 +135,8 @@ const formInput = ref({ 'Discord': [ { key: 'body', - label: 'Body', - placeholder: 'Body', + label: t('labels.body'), + placeholder: t('labels.body'), type: 'LongText', required: true, }, @@ -144,8 +144,8 @@ const formInput = ref({ 'Mattermost': [ { key: 'body', - label: 'Body', - placeholder: 'Body', + label: t('labels.body'), + placeholder: t('labels.body'), type: 'LongText', required: true, }, @@ -153,15 +153,15 @@ const formInput = ref({ 'Twilio': [ { key: 'body', - label: 'Body', - placeholder: 'Body', + label: t('labels.body'), + placeholder: t('labels.body'), type: 'LongText', required: true, }, { key: 'to', - label: 'Comma separated Mobile #', - placeholder: 'Comma separated Mobile #', + label: t('labels.commaSeparatedMobileNumber'), + placeholder: t('labels.commaSeparatedMobileNumber'), type: 'LongText', required: true, }, @@ -169,15 +169,15 @@ const formInput = ref({ 'Whatsapp Twilio': [ { key: 'body', - label: 'Body', - placeholder: 'Body', + label: t('labels.body'), + placeholder: t('labels.body'), type: 'LongText', required: true, }, { key: 'to', - label: 'Comma separated Mobile #', - placeholder: 'Comma separated Mobile #', + label: t('labels.commaSeparatedMobileNumber'), + placeholder: t('labels.commaSeparatedMobileNumber'), type: 'LongText', required: true, }, @@ -196,26 +196,26 @@ const showLogs = computed( ) const eventList = ref[]>([ - { text: ['After', 'Insert'], value: ['after', 'insert'] }, - { text: ['After', 'Update'], value: ['after', 'update'] }, - { text: ['After', 'Delete'], value: ['after', 'delete'] }, - { text: ['After', 'Bulk Insert'], value: ['after', 'bulkInsert'] }, - { text: ['After', 'Bulk Update'], value: ['after', 'bulkUpdate'] }, - { text: ['After', 'Bulk Delete'], value: ['after', 'bulkDelete'] }, + { text: [t('general.after'), t('general.insert')], value: ['after', 'insert'] }, + { text: [t('general.after'), t('general.update')], value: ['after', 'update'] }, + { text: [t('general.after'), t('general.delete')], value: ['after', 'delete'] }, + { text: [t('general.after'), t('general.bulkInsert')], value: ['after', 'bulkInsert'] }, + { text: [t('general.after'), t('general.bulkUpdate')], value: ['after', 'bulkUpdate'] }, + { text: [t('general.after'), t('general.bulkDelete')], value: ['after', 'bulkDelete'] }, ]) const notificationList = computed(() => { return isEeUI - ? [{ type: 'URL' }] + ? [{ type: 'URL', text: t('datatype.URL') }] : [ - { type: 'URL' }, - { type: 'Email' }, - { type: 'Slack' }, - { type: 'Microsoft Teams' }, - { type: 'Discord' }, - { type: 'Mattermost' }, - { type: 'Twilio' }, - { type: 'Whatsapp Twilio' }, + { type: 'URL', text: t('datatype.URL') }, + { type: 'Email', text: t('datatype.Email') }, + { type: 'Slack', text: t('general.slack') }, + { type: 'Microsoft Teams', text: t('general.microsoftTeams') }, + { type: 'Discord', text: t('general.discord') }, + { type: 'Mattermost', text: t('general.matterMost') }, + { type: 'Twilio', text: t('general.twilio') }, + { type: 'Whatsapp Twilio', text: t('general.whatsappTwilio') }, ] }) @@ -524,7 +524,7 @@ onMounted(async () => { ref="titleDomRef" v-model="hookRef.title" class="flex flex-grow text-lg font-medium capitalize outline-none bg-inherit nc-text-field-hook-title" - placeholder="Webhook Title" + :placeholder="$t('placeholder.webhookTitle')" :contenteditable="true" @blur="isRenaming = false" @focus="isRenaming = true" @@ -535,7 +535,7 @@ onMounted(async () => {
-
Test Webhook
+
{{ $t('activity.testWebhook') }}
{ :disabled="!isValid" @click.prevent="saveHooks" > - +
{{ $t('general.save') }}
@@ -562,7 +562,7 @@ onMounted(async () => { > -
Event
+
{{ $t('general.event') }}
@@ -608,7 +608,7 @@ onMounted(async () => { - {{ notificationOption.type }} + {{ notificationOption.text }} @@ -654,11 +654,11 @@ onMounted(async () => { /> - + - + @@ -682,7 +682,7 @@ onMounted(async () => { v-model="hookRef.notification.payload.channels" :selected-channel-list="hookRef.notification.payload.channels" :available-channel-list="slackChannels" - placeholder="Select Slack channels" + :placeholder="$t('placeholder.selectSlackChannels')" /> @@ -695,7 +695,7 @@ onMounted(async () => { v-model="hookRef.notification.payload.channels" :selected-channel-list="hookRef.notification.payload.channels" :available-channel-list="teamsChannels" - placeholder="Select Microsoft Teams channels" + :placeholder="$t('placeholder.selectTeamsChannels')" />
@@ -708,7 +708,7 @@ onMounted(async () => { v-model="hookRef.notification.payload.channels" :selected-channel-list="hookRef.notification.payload.channels" :available-channel-list="discordChannels" - placeholder="Select Discord channels" + :placeholder="$t('placeholder.selectDiscordChannels')" /> @@ -721,7 +721,7 @@ onMounted(async () => { v-model="hookRef.notification.payload.channels" :selected-channel-list="hookRef.notification.payload.channels" :available-channel-list="mattermostChannels" - placeholder="Select Mattermost channels" + :placeholder="$t('placeholder.selectMattermostChannels')" /> @@ -747,7 +747,7 @@ onMounted(async () => { class="nc-check-box-hook-condition" @update:checked="hookRef.condition = $event" > - On Condition + {{ $t('activity.onCondition') }} {
- Use context variable data to refer the record under consideration + {{ $t('msg.webhookBodyMsg1') }} {{ $t('msg.webhookBodyMsg2') }} + {{ $t('msg.webhookBodyMsg3') }} diff --git a/packages/nc-gui/lang/en.json b/packages/nc-gui/lang/en.json index fd708e6bb1..3390297020 100644 --- a/packages/nc-gui/lang/en.json +++ b/packages/nc-gui/lang/en.json @@ -66,6 +66,12 @@ "escape": "Escape", "hex": "Hex", "clear": "Clear", + "slack": "Slack", + "microsoftTeams": "Microsoft Teams", + "discord": "Discord", + "matterMost": "Mattermost", + "twilio": "Twilio", + "whatsappTwilio": "WhatsApp Twilio", "submit": "Submit", "create": "Create", "details": "Details", @@ -76,6 +82,9 @@ "action": "Action", "insert": "Insert", "delete": "Delete", + "bulkInsert": "Bulk Insert", + "bulkDelete": "Bulk Delete", + "bulkUpdate": "Bulk Update", "deleting": "Deleting", "update": "Update", "rename": "Rename", @@ -268,6 +277,8 @@ "isNotNull": "is not null" }, "title": { + "parameter": "Parameter", + "headers": "Headers", "parameterName": "Parameter Name", "currencyLocale": "Currency Locale", "currencyCode": "Currency Code", @@ -275,6 +286,7 @@ "noMembersFound": "No members found", "dateJoined": "Date Joined", "tokenName": "Token name", + "rowData": "Row data", "creator": "Creator", "qrCode": "QR Code", "updateSelectedRows": "Update Selected Rows", @@ -369,6 +381,10 @@ } }, "labels": { + "toAddress": "To Address", + "subject": "Subject", + "body": "Body", + "commaSeparatedMobileNumber": "Comma separated Mobile #", "headerName": "Header Name", "icon": "Icon", "max": "Max", @@ -557,6 +573,7 @@ "zoomInToViewColumns": "Zoom in to view columns" }, "activity": { + "onCondition": "On Condition", "bulkDownload": "Bulk Download", "attachFile": "Attach File", "viewAttachment": "View Attachments", @@ -776,6 +793,11 @@ "clientCA": "Select CA file" }, "placeholder": { + "selectSlackChannels": "Select Slack channels", + "selectTeamsChannels": "Select Microsoft Teams channels", + "selectDiscordChannels": "Select Discord channels", + "selectMattermostChannels": "Select Mattermost channels", + "webhookTitle": "Webhook Title", "barcodeColumn": "Select a column for the Barcode value", "notFoundContent": "No valid Column Type can be found.", "selectBarcodeFormat": "Select a Barcode format", @@ -824,6 +846,9 @@ "invalidPhoneNumber": "Invalid phone number", "pageSizeChanged": "Page size changed", "errorLoadingData": "Error loading data", + "webhookBodyMsg1": "Use context variable", + "webhookBodyMsg2": "body", + "webhookBodyMsg3": "to refer the record under consideration", "formula": { "hintStart": "Hint: Use {} to reference columns, e.g: {column_name}. For more, please check out", "hintEnd": "Formulas.",