ads + i18n: forum/newsletter banners; smarter language autodetect

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) <noreply@anthropic.com>
This commit is contained in:
Ryan Salazar
2026-05-20 05:52:00 +00:00
parent b4eb56c81d
commit a1829e7628
4 changed files with 114 additions and 36 deletions

View File

@@ -4,6 +4,7 @@ import React, { useState, useEffect, useCallback, useId } from "react";
import Link from "next/link";
import Header from "@/components/Header";
import Footer from "@/components/Footer";
import SidebarAdStack from "@/components/SidebarAdStack";
// ─── Types ────────────────────────────────────────────────────────────────────
interface ArticleBlock {
@@ -538,6 +539,9 @@ export default function NewsletterArchivePage() {
{/* ── Right: Sidebar ─────────────────────────────────────────────── */}
<aside className="lg:col-span-4 space-y-6">
{/* 300x600 + rotating 300x250 stack */}
<SidebarAdStack />
{/* Signup CTA */}
<SignupCTA />