From 5371114609c5c5f431cf52b01c3de3619e7c8b13 Mon Sep 17 00:00:00 2001
From: Eric Bailey <git@esb.lol>
Date: Wed, 9 Apr 2025 17:00:40 -0500
Subject: Add translate metrics (#8171)

* Add translate metrics

* Format
---
 src/components/dms/MessageContextMenu.tsx | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'src/components/dms/MessageContextMenu.tsx')

diff --git a/src/components/dms/MessageContextMenu.tsx b/src/components/dms/MessageContextMenu.tsx
index c978f1556..709665347 100644
--- a/src/components/dms/MessageContextMenu.tsx
+++ b/src/components/dms/MessageContextMenu.tsx
@@ -8,6 +8,7 @@ import {useLingui} from '@lingui/react'
 import {useOpenLink} from '#/lib/hooks/useOpenLink'
 import {richTextToString} from '#/lib/strings/rich-text-helpers'
 import {getTranslatorLink} from '#/locale/helpers'
+import {logger} from '#/logger'
 import {isNative} from '#/platform/detection'
 import {useConvoActive} from '#/state/messages/convo'
 import {useLanguagePrefs} from '#/state/preferences'
@@ -61,6 +62,12 @@ export let MessageContextMenu = ({
       langPrefs.primaryLanguage,
     )
     openLink(translatorUrl, true)
+
+    logger.metric('translate', {
+      sourceLanguages: [],
+      targetLanguage: langPrefs.primaryLanguage,
+      textLength: message.text.length,
+    })
   }, [langPrefs.primaryLanguage, message.text, openLink])
 
   const onDelete = useCallback(() => {
-- 
cgit 1.4.1

