From f214bc07970faf4ee7cbdb71c04a17e2253a8c7e Mon Sep 17 00:00:00 2001 From: luna Date: Thu, 9 Jan 2025 21:59:08 +1030 Subject: [PATCH] fix: translating posts with incorrect language --- src/components/PostCard.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/PostCard.tsx b/src/components/PostCard.tsx index 4139079..6057323 100644 --- a/src/components/PostCard.tsx +++ b/src/components/PostCard.tsx @@ -72,7 +72,8 @@ const PostDropdownMenu = ({ post, setTranslatedText }: { post: BSkyPost; setTran method: 'POST', body: JSON.stringify({ q: post.record.text, - source, + // fall back to auto detection if the lanauge is the same as the current language + source: source === currentLanguage ? 'auto' : source, target: navigator.language, }), headers: { 'Content-Type': 'application/json' },