Include if google was forced

This commit is contained in:
Eric Bailey
2026-03-17 13:39:54 -05:00
parent a00e5dd724
commit 6a8a02eb43
2 changed files with 6 additions and 3 deletions
+1
View File
@@ -722,6 +722,7 @@ export type Events = {
* more likely to have inaccurate translations.
*/
textLength: number
forceGoogleTranslate: boolean
}
'translate:result': {
success: boolean
+5 -3
View File
@@ -220,16 +220,18 @@ export function Provider({children}: React.PropsWithChildren<unknown>) {
},
{key, forceGoogleTranslate},
) => {
const shouldForceGoogleTranslate = Boolean(
forceGoogleTranslateOverride ?? forceGoogleTranslate,
)
ax.metric('translate', {
os: Platform.OS,
possibleSourceLanguages,
expectedTargetLanguage: expectedTargetLanguage,
textLength: text.length,
forceGoogleTranslate: shouldForceGoogleTranslate,
})
const shouldForceGoogleTranslate =
forceGoogleTranslateOverride ?? forceGoogleTranslate
if (shouldForceGoogleTranslate || !HAS_ON_DEVICE_TRANSLATION) {
await googleTranslate(
text,