diff --git a/src/locale/helpers.ts b/src/locale/helpers.ts index bce4e659..6e6e3f08 100644 --- a/src/locale/helpers.ts +++ b/src/locale/helpers.ts @@ -79,8 +79,6 @@ export function isPostInLanguage( return bcp47Match.basicFilter(lang, targetLangs).length > 0 } -export function getTranslatorLink(lang: string, text: string): string { - return encodeURI( - `https://translate.google.com/?sl=auto&tl=${lang}&text=${text}`, - ) +export function getTranslatorLink(text: string): string { + return encodeURI(`https://translate.google.com/?sl=auto&text=${text}`) } diff --git a/src/view/com/post-thread/PostThreadItem.tsx b/src/view/com/post-thread/PostThreadItem.tsx index 62cc8895..587ed1e0 100644 --- a/src/view/com/post-thread/PostThreadItem.tsx +++ b/src/view/com/post-thread/PostThreadItem.tsx @@ -67,8 +67,7 @@ export const PostThreadItem = observer(function PostThreadItem({ }, [item.post.uri, item.post.author]) const repostsTitle = 'Reposts of this post' - const primaryLanguage = store.preferences.contentLanguages[0] || 'en' - const translatorUrl = getTranslatorLink(primaryLanguage, record?.text || '') + const translatorUrl = getTranslatorLink(record?.text || '') const needsTranslation = useMemo( () => store.preferences.contentLanguages.length > 0 && diff --git a/src/view/com/post/Post.tsx b/src/view/com/post/Post.tsx index 932b6cfd..673ddefc 100644 --- a/src/view/com/post/Post.tsx +++ b/src/view/com/post/Post.tsx @@ -133,8 +133,7 @@ const PostLoaded = observer( replyAuthorDid = urip.hostname } - const primaryLanguage = store.preferences.contentLanguages[0] || 'en' - const translatorUrl = getTranslatorLink(primaryLanguage, record?.text || '') + const translatorUrl = getTranslatorLink(record?.text || '') const needsTranslation = useMemo( () => store.preferences.contentLanguages.length > 0 && diff --git a/src/view/com/posts/FeedItem.tsx b/src/view/com/posts/FeedItem.tsx index 01dd00d0..e1212f32 100644 --- a/src/view/com/posts/FeedItem.tsx +++ b/src/view/com/posts/FeedItem.tsx @@ -60,8 +60,7 @@ export const FeedItem = observer(function ({ const urip = new AtUri(record.reply.parent?.uri || record.reply.root.uri) return urip.hostname }, [record?.reply]) - const primaryLanguage = store.preferences.contentLanguages[0] || 'en' - const translatorUrl = getTranslatorLink(primaryLanguage, record?.text || '') + const translatorUrl = getTranslatorLink(record?.text || '') const needsTranslation = useMemo( () => store.preferences.contentLanguages.length > 0 &&