Log languages a post is tagged with after translating (#10014)
Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
@@ -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',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user