Log languages a post is tagged with after translating (#10014)

Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
DS Boyce
2026-03-17 10:31:23 -07:00
committed by GitHub
parent be0d00de17
commit 1386a559b7
11 changed files with 102 additions and 81 deletions
+4
View File
@@ -9,6 +9,7 @@ import {useTranslate} from '#/lib/translation'
import {type TranslationFunction} from '#/lib/translation'
import {
codeToLanguageName,
getPostLanguageTags,
isPostInLanguage,
languageName,
} from '#/locale/helpers'
@@ -42,6 +43,7 @@ export function TranslatedPost({
const langPrefs = useLanguagePrefs()
const {clearTranslation, translate, translationState} = useTranslate({
key: post.uri,
postLangCodes: getPostLanguageTags(post),
})
const needsTranslation = useMemo(() => {
@@ -122,6 +124,7 @@ function TranslationLink({
})
ax.metric('translate', {
os: Platform.OS,
sourceLanguages: [], // todo: get from post maybe?
targetLanguage: primaryLanguage,
textLength: postText.length,
@@ -405,6 +408,7 @@ function TranslationLanguageSelect({
text: postText,
targetLangCode: langPrefs.primaryLanguage,
sourceLangCode,
sourceSelection: 'manual',
})
}