Completa traduzioni EN/TH e fix sezioni home #27
@ -20,11 +20,12 @@ const canonicalUrl = Astro.url.toString();
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
<html lang={htmlLang} class="bg-nx-bg">
|
||||
<html lang={htmlLang} class="bg-nx-bg" translate="no">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="description" content={description} />
|
||||
<meta name="google" content="notranslate" />
|
||||
<link rel="canonical" href={canonicalUrl} />
|
||||
<meta name="theme-color" content="#030712" />
|
||||
<meta property="og:type" content="website" />
|
||||
@ -46,7 +47,7 @@ const canonicalUrl = Astro.url.toString();
|
||||
rel="stylesheet"
|
||||
/>
|
||||
</head>
|
||||
<body class="min-h-screen">
|
||||
<body class="notranslate min-h-screen">
|
||||
<slot />
|
||||
<CookieConsent />
|
||||
<ChatGateModal />
|
||||
|
||||
@ -2,4 +2,4 @@
|
||||
import Page from '../index.astro';
|
||||
---
|
||||
|
||||
<Page />
|
||||
<Page locale="en" />
|
||||
|
||||
@ -16,10 +16,19 @@ import {
|
||||
getFaq,
|
||||
getCta,
|
||||
} from '../data/home';
|
||||
import type { SupportedLocale } from '../data/home/navigation';
|
||||
|
||||
interface Props {
|
||||
/** Locale esplicito dalle route /en e /th (evita ambiguità se la page è importata come componente). */
|
||||
locale?: SupportedLocale;
|
||||
}
|
||||
|
||||
const { locale: localeProp } = Astro.props;
|
||||
const path = Astro.url.pathname;
|
||||
const localeMatch = path.match(/^\/(en|th)(\/|$)/);
|
||||
const currentLocale = (localeMatch?.[1] ?? 'it') as 'it' | 'en' | 'th';
|
||||
const currentLocale = (localeProp ??
|
||||
(localeMatch?.[1] as SupportedLocale | undefined) ??
|
||||
'it') as SupportedLocale;
|
||||
const navigation = getNavigation(currentLocale);
|
||||
const siteMeta = getSiteMeta(currentLocale);
|
||||
const hero = getHero(currentLocale);
|
||||
|
||||
@ -2,4 +2,4 @@
|
||||
import Page from '../index.astro';
|
||||
---
|
||||
|
||||
<Page />
|
||||
<Page locale="th" />
|
||||
|
||||
@ -75,8 +75,11 @@ function measureHeaderAndSync(): void {
|
||||
}
|
||||
|
||||
function bind(): void {
|
||||
const path = window.location.pathname;
|
||||
if (path !== '/' && path !== '/index.html') return;
|
||||
const path = window.location.pathname.replace(/\/$/, '') || '/';
|
||||
// Home IT (`/`) e home localizzate (`/en`, `/th`).
|
||||
if (path !== '/' && path !== '/index.html' && path !== '/en' && path !== '/th') {
|
||||
return;
|
||||
}
|
||||
|
||||
const header = document.querySelector('header');
|
||||
measureHeaderAndSync();
|
||||
|
||||
Reference in New Issue
Block a user