From 4673883b5177fd0309cd4459a82980d9804d9b63 Mon Sep 17 00:00:00 2001
From: Pinapelz <yukais@pinapelz.com>
Date: Tue, 1 Jul 2025 20:35:09 -0700
Subject: add lang=en TL to copied posts if middleware is available

---
 site/src/components/NewsFeed.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'site/src/components/NewsFeed.tsx')

diff --git a/site/src/components/NewsFeed.tsx b/site/src/components/NewsFeed.tsx
index ebfcc28..6e76730 100644
--- a/site/src/components/NewsFeed.tsx
+++ b/site/src/components/NewsFeed.tsx
@@ -107,7 +107,7 @@ export const NewsFeed: React.FC<NewsFeedProps> = ({ newsItems }) => {
               5381,
             ) >>> 0;
         const newsId = `${news.identifier}-${news.timestamp}-${contentHash.toString(16)}-${headlineHash.toString(16)}`;
-        const isEnglish = !!showEnglish[newsId];
+        const isEnglish = showEnglish[newsId];
         const hasTranslation = news.en_headline || news.en_content;
         const displayHeadline =
           isEnglish && news.en_headline ? news.en_headline : news.headline;
@@ -229,7 +229,7 @@ export const NewsFeed: React.FC<NewsFeedProps> = ({ newsItems }) => {
                       ? "/news"
                       : window.location.pathname.replace(/^\/game/, "");
                   const url = middlewareBase
-                    ? `${middlewareBase}${pathname}?post=${newsId}`
+                    ? `${middlewareBase}${pathname}?post=${newsId}${isEnglish ? '&lang=en' : ''}`
                     : `${window.location.origin}${pathname === "/news" ? "" : pathname}#${newsId}`;
                   navigator.clipboard.writeText(url);
                   alert(
-- 
cgit v1.2.3

