i18n: kill spurious translate popup; make language pulldown actually translate
Three connected fixes:
1) Stop the unwanted "translate this page to Portuguese?" popup that
some US users were seeing. Chrome's content-language detector was
mis-firing on imported BB articles that mention Portuguese/Spanish
company/person names. Add to layout <head>:
<meta name="google" content="notranslate" />
<meta http-equiv="Content-Language" content="en" />
<meta name="robots" content="index, follow" />
Together with the existing <html lang="en"> this is the standard
"this site is English, don't offer to translate" signal.
2) Wire the LanguageSwitcher pulldown to actually do something. It used
to set a cookie + flip <html lang> with no effect on visible
content. Now picking a non-English language redirects the current
URL to Google Translate's hosted proxy (e.g.
https://broadcastbeat-com.translate.goog/<path>?_x_tr_sl=en
&_x_tr_tl=es&_x_tr_hl=en
), which renders the entire page translated server-side by Google
and preserves the user's session as they navigate. English stays
on the canonical broadcastbeat.com host.
3) SEO posture: English is the only indexable version. The Google
Translate proxy lives on a different (Google-owned) domain so US
browsers and Googlebot only ever see the English content. The
alternates.languages hreflang block stays absent — re-add only once
real translated routes exist (Phase D).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -76,6 +76,17 @@ export default function RootLayout({
|
||||
<head>
|
||||
{/* hreflang entries removed pending real i18n routes (Phase D). */}
|
||||
|
||||
{/* Tell browsers + Google not to auto-offer translation. The site IS
|
||||
English (lang="en"); the language pulldown opt-in uses Google
|
||||
Translate's hosted proxy (*.translate.goog) so users who want
|
||||
another language get one without polluting the canonical URL.
|
||||
Without these, Chrome's content-language detector sometimes
|
||||
fires on imported posts that contain Portuguese/Spanish company
|
||||
or person names and offers a translate popup unprompted. */}
|
||||
<meta name="google" content="notranslate" />
|
||||
<meta httpEquiv="Content-Language" content="en" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{
|
||||
|
||||
Reference in New Issue
Block a user