fix transalations for webhooks

This commit is contained in:
Abhinav Raut
2025-06-14 22:24:41 +05:30
parent 27aac88f53
commit aba07b3096
7 changed files with 48 additions and 18 deletions
-1
View File
@@ -212,7 +212,6 @@ const deleteView = async (view) => {
})
} catch (err) {
emitter.emit(EMITTER_EVENTS.SHOW_TOAST, {
title: 'Error',
variant: 'destructive',
description: handleHTTPError(err).message
})
@@ -22,8 +22,10 @@
<FormField name="events" v-slot="{ componentField, handleChange }">
<FormItem>
<FormLabel>Events</FormLabel>
<FormDescription>Select which events should trigger this webhook</FormDescription>
<FormLabel>{{ $t('globals.terms.event', 2) }}</FormLabel>
<FormDescription>
{{ $t('admin.webhook.events.description') }}
</FormDescription>
<FormControl>
<div class="space-y-6">
<div
@@ -69,9 +71,9 @@
<FormItem>
<FormLabel>{{ $t('globals.terms.secret') }}</FormLabel>
<FormControl>
<Input type="password" placeholder="optional-secret-key" v-bind="componentField" />
<Input type="password" v-bind="componentField" />
</FormControl>
<FormDescription>Optional secret key for webhook signature verification</FormDescription>
<FormDescription>{{ $t('admin.webhook.secret.description') }}</FormDescription>
<FormMessage />
</FormItem>
</FormField>
@@ -20,18 +20,22 @@ export const createColumns = (t) => [
},
cell: function ({ row }) {
const url = row.getValue('url')
return h('div', { class: 'text-center font-mono text-sm max-w-xs truncate' }, url)
return h('div', { class: 'text-center font-mono text-sm max-w-sm truncate' }, url)
}
},
{
accessorKey: 'events',
header: function () {
return h('div', { class: 'text-center' }, 'Events')
return h('div', { class: 'text-center' }, t('globals.terms.event', 2))
},
cell: function ({ row }) {
const events = row.getValue('events')
return h('div', { class: 'text-center' }, [
h(Badge, { variant: 'secondary', class: 'text-xs' }, `${events.length} events`)
h(
Badge,
{ variant: 'secondary', class: 'text-xs' },
() => `${events.length} ${t('globals.terms.event', 2)}`
)
])
}
},
@@ -47,7 +51,7 @@ export const createColumns = (t) => [
variant: isActive ? 'default' : 'secondary',
class: 'text-xs'
},
isActive ? t('globals.terms.active') : t('globals.terms.inactive')
() => isActive ? t('globals.terms.active') : t('globals.terms.inactive')
)
])
}
@@ -17,7 +17,13 @@
props.webhook.is_active ? $t('globals.messages.disable') : $t('globals.messages.enable')
}}
</DropdownMenuItem>
<DropdownMenuItem @click="handleTest"> Send Test </DropdownMenuItem>
<DropdownMenuItem @click="handleTest">
{{
$t('globals.messages.send', {
name: $t('globals.terms.test').toLowerCase()
})
}}
</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem @click="() => (alertOpen = true)" class="text-destructive">
{{ $t('globals.messages.delete') }}
@@ -114,7 +120,7 @@ async function handleToggle() {
model: 'webhook'
})
emit.emit(EMITTER_EVENTS.SHOW_TOAST, {
title: 'Success',
variant: 'success',
description: t('globals.messages.updatedSuccessfully', {
name: t('globals.terms.webhook')
})
@@ -131,8 +137,10 @@ async function handleTest() {
try {
await api.testWebhook(props.webhook.id)
emit.emit(EMITTER_EVENTS.SHOW_TOAST, {
title: 'Success',
description: 'Test webhook sent successfully'
variant: 'success',
description: t('globals.messages.sentSuccessfully', {
name: t('globals.terms.webhook')
})
})
} catch (error) {
emit.emit(EMITTER_EVENTS.SHOW_TOAST, {
@@ -17,7 +17,11 @@
:isLoading="testLoading"
@click="handleTestWebhook"
>
Send Test
{{
$t('globals.messages.send', {
name: t('globals.terms.test').toLowerCase()
})
}}
</Button>
</div>
</template>
@@ -89,7 +93,7 @@ const onSubmit = form.handleSubmit(async (values) => {
})
}
emitter.emit(EMITTER_EVENTS.SHOW_TOAST, {
title: 'Success',
variant: 'success',
description: toastDescription
})
} catch (error) {
@@ -109,8 +113,10 @@ const handleTestWebhook = async () => {
testLoading.value = true
await api.testWebhook(props.id)
emitter.emit(EMITTER_EVENTS.SHOW_TOAST, {
title: 'Success',
description: 'Test webhook sent successfully'
variant: 'success',
description: t('globals.messages.sentSuccessfully', {
name: t('globals.terms.webhook')
})
})
} catch (error) {
emitter.emit(EMITTER_EVENTS.SHOW_TOAST, {
+5 -1
View File
@@ -131,6 +131,7 @@
"globals.terms.download": "Download | Downloads",
"globals.terms.import": "Import | Imports",
"globals.terms.export": "Export | Exports",
"globals.terms.test": "Test | Tests",
"globals.terms.confirmation": "Confirmation | Confirmations",
"globals.terms.dialog": "Dialog | Dialogs",
"globals.terms.modal": "Modal | Modals",
@@ -229,6 +230,7 @@
"globals.messages.createdSuccessfully": "{name} created successfully",
"globals.messages.blockedSuccessfully": "{name} blocked successfully",
"globals.messages.unblockedSuccessfully": "{name} unblocked successfully",
"globals.messages.sentSuccessfully": "{name} sent successfully",
"globals.messages.pageTooLarge": "Page size is too large, should be at most {max}",
"globals.messages.edit": "Edit {name}",
"globals.messages.delete": "Delete {name}",
@@ -359,6 +361,8 @@
"navigation.away": "Away",
"navigation.logout": "Logout",
"admin.empty": "Select a section from the sidebar",
"admin.webhook.events.description": "Select the events you want to subscribe to. You can select multiple events.",
"admin.webhook.secret.description": "Optional secret key for webhook signature verification.",
"admin.general.siteName": "Site Name",
"admin.general.siteName.description": "Name for your support desk.",
"admin.general.siteName.min": "Site name should be at least 1 character",
@@ -604,4 +608,4 @@
"contact.alreadyExistsWithEmail": "Another contact with same email already exists",
"contact.notes.empty": "No notes yet",
"contact.notes.help": "Add note for this contact to keep track of important information and conversations."
}
}
+7
View File
@@ -11,6 +11,7 @@
"globals.terms.conversation": "संभाषण | संभाषण",
"globals.terms.provider": "प्रदाता | प्रदाते",
"globals.terms.state": "राज्य | राज्ये",
"globals.terms.webhook": "वेबहुक | वेबहुक्स",
"globals.terms.session": "सत्र | सत्रे",
"globals.terms.media": "मीडिया | मीडिया",
"globals.terms.permission": "परवानगी | परवानग्या",
@@ -44,6 +45,7 @@
"globals.terms.action": "क्रिया | क्रिया",
"globals.terms.value": "मूल्य | मूल्ये",
"globals.terms.event": "घटना | घटना",
"globals.terms.secret": "गुप्त | गुप्त",
"globals.terms.automation": "ऑटोमेशन | ऑटोमेशन",
"globals.terms.oidc": "OIDC | OIDC",
"globals.terms.oidcProvider": "OIDC प्रदाता | OIDC प्रदाते",
@@ -80,6 +82,7 @@
"globals.terms.unassigned": "नियुक्त नसलेले",
"globals.terms.pending": "प्रलंबित",
"globals.terms.active": "सक्रिय",
"globals.terms.inactive": "निष्क्रिय",
"globals.terms.url": "URL | URL",
"globals.terms.rootURL": "मूळ URL",
"globals.terms.key": "की | की",
@@ -135,6 +138,7 @@
"globals.terms.regex": "रेगेक्स | रेगेक्स",
"globals.terms.appliesTo": "यांना लागू होते",
"globals.terms.createdOn": "यावर तयार केले",
"globals.terms.test": "चाचणी | चाचण्या",
"globals.terms.awayReassigning": "दूर आणि पुन्हा नियुक्त करत आहे",
"globals.terms.availabilityStatus": "उपलब्धता स्थिती",
"globals.terms.lastActive": "शेवटी सक्रिय",
@@ -253,6 +257,7 @@
"globals.messages.fileTypeisNotAnImage": "फाइल प्रकार प्रतिमा नाही",
"globals.messages.notFound": "{name} सापडले नाही",
"globals.messages.empty": "{name} रिकामे",
"globals.messages.sentSuccessfully": "{name} यशस्वीरित्या पाठवले",
"globals.messages.mismatch": "{name} जुळत नाही",
"globals.messages.errorSendingPasswordResetEmail": "पासवर्ड रीसेट ईमेल पाठवताना त्रुटी",
"globals.messages.cannotBeEmpty": "{name} रिकामे असू शकत नाही",
@@ -355,6 +360,8 @@
"navigation.away": "दूर",
"navigation.logout": "लॉगआउट",
"admin.empty": "साइडबारमधून एक विभाग निवडा",
"admin.webhook.events.description": "तुम्ही ज्या घटनांवर सदस्यता घेऊ इच्छिता त्या निवडा. तुम्ही एकाधिक घटना निवडू शकता.",
"admin.webhook.secret.description": "वेबहुक सिग्नेचर पडताळणीसाठी वैकल्पिक गुप्त की.",
"admin.general.siteName": "साइट नाव",
"admin.general.siteName.description": "तुमच्या सपोर्ट डेस्कचे नाव.",
"admin.general.siteName.min": "साइट नाव कमीत कमी 1 अक्षर असावे",