From a1829e7628ff7543c8e1170166f336de67970ebc Mon Sep 17 00:00:00 2001 From: Ryan Salazar Date: Wed, 20 May 2026 05:52:00 +0000 Subject: [PATCH] ads + i18n: forum/newsletter banners; smarter language autodetect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Forum: - /forum landing: switch to 2-col layout, add SidebarAdStack (300x600 + every 300x250) on the right. - /forum/thread/[id]: insert one 300x250 "Sponsored" tile after every 4 replies (idx 3, 7, 11 …). Trailing-ad guard so the last reply isn't followed by an ad with no replies after it. Cycles through the full ADS_300X250 pool by index so every banner gets impressions across long threads. Newsletter: - /newsletter/archive: drop SidebarAdStack into the existing right rail above the signup CTA + topic browser. LanguageSwitcher autodetect (US default for US users was failing): 1. Timezone override: if the user is in America/*, Pacific/Honolulu, Pacific/Auckland|Wellington, Australia/*, Europe/London|Dublin, or Atlantic/Reykjavik — always return 'en'. Fixes US-based users whose OS locale happened to be set to a non-English value. 2. Otherwise walk navigator.languages (the full preference list, not just navigator.language[0]) and pick the first base code we support (en/es/pt/fr/de/zh/ja/ar/hi). 3. Fallback to 'en'. All non-en selections still route through Google Translate's hosted proxy on the .translate.goog subdomain — search engines and US visitors continue to only ever see English on broadcastbeat.com. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/app/forum/page.tsx | 12 ++++ src/app/forum/thread/[id]/page.tsx | 87 ++++++++++++++++++----------- src/app/newsletter/archive/page.tsx | 4 ++ src/components/LanguageSwitcher.tsx | 47 +++++++++++++++- 4 files changed, 114 insertions(+), 36 deletions(-) diff --git a/src/app/forum/page.tsx b/src/app/forum/page.tsx index 7e65218..9f0ccbd 100644 --- a/src/app/forum/page.tsx +++ b/src/app/forum/page.tsx @@ -4,6 +4,7 @@ import Link from 'next/link'; import Header from '@/components/Header'; import Footer from '@/components/Footer'; import AdImage from '@/components/AdImage'; +import SidebarAdStack from '@/components/SidebarAdStack'; import { ADS_728X90, shuffle } from '@/lib/ads'; import { createClient } from '@/lib/supabase/client'; @@ -274,6 +275,8 @@ export default function ForumIndexPage() {
+
+
{/* Feed Mode Tabs */}
@@ -576,6 +579,15 @@ export default function ForumIndexPage() {
)} + +
+ {/* Sidebar: 300x600 + every rotating 300x250 */} + +