From deebe18aaa883d7fcedabd594dda057f991c3026 Mon Sep 17 00:00:00 2001 From: Ollie H Date: Tue, 30 May 2023 16:54:47 -0700 Subject: [PATCH] Use non-pipe translation link (#740) --- src/view/com/post-thread/PostThreadItem.tsx | 6 +++++- src/view/com/post/Post.tsx | 4 +++- src/view/com/posts/FeedItem.tsx | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index 084e30a2..f6170178 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -99,7 +99,11 @@ export const PostThreadItem = observer(function PostThreadItem({ const onOpenTranslate = React.useCallback(() => { Linking.openURL( - encodeURI(`https://translate.google.com/#auto|en|${record?.text || ''}`), + encodeURI( + `https://translate.google.com/?sl=auto&tl=en&text=${ + record?.text || '' + }`, + ), ) }, [record]) diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx index 614c5ea7..5139d583 100644 --- a/src/view/com/post/Post.tsx +++ b/src/view/com/post/Post.tsx @@ -170,7 +170,9 @@ const PostLoaded = observer( const onOpenTranslate = React.useCallback(() => { Linking.openURL( encodeURI( - `https://translate.google.com/#auto|en|${record?.text || ''}`, + `https://translate.google.com/?sl=auto&tl=en&text=${ + record?.text || '' + }`, ), ) }, [record]) diff --git a/src/view/com/posts/FeedItem.tsx b/src/view/com/posts/FeedItem.tsx index fa6131d6..553c3a24 100644 --- a/src/view/com/posts/FeedItem.tsx +++ b/src/view/com/posts/FeedItem.tsx @@ -99,7 +99,11 @@ export const FeedItem = observer(function ({ const onOpenTranslate = React.useCallback(() => { Linking.openURL( - encodeURI(`https://translate.google.com/#auto|en|${record?.text || ''}`), + encodeURI( + `https://translate.google.com/?sl=auto&tl=en&text=${ + record?.text || '' + }`, + ), ) }, [record])