diff --git a/astro.config.mjs b/astro.config.mjs index 45aeda3..42853d7 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -37,4 +37,11 @@ export default defineConfig({ adapter: cloudflare(), integrations: [alpinejs()], + i18n: { + defaultLocale: 'it', + locales: ['it', 'en', 'th'], + routing: { + prefixDefaultLocale: false, + }, + }, }); \ No newline at end of file diff --git a/public/images/flags/en.svg b/public/images/flags/en.svg new file mode 100644 index 0000000..d9e403a --- /dev/null +++ b/public/images/flags/en.svg @@ -0,0 +1,6 @@ + diff --git a/public/images/flags/it.svg b/public/images/flags/it.svg new file mode 100644 index 0000000..e60e5da --- /dev/null +++ b/public/images/flags/it.svg @@ -0,0 +1,5 @@ + diff --git a/public/images/flags/th.svg b/public/images/flags/th.svg new file mode 100644 index 0000000..33eb523 --- /dev/null +++ b/public/images/flags/th.svg @@ -0,0 +1,5 @@ + diff --git a/src/components/ContactFormInline.astro b/src/components/ContactFormInline.astro index 22f1ed3..e37fae2 100644 --- a/src/components/ContactFormInline.astro +++ b/src/components/ContactFormInline.astro @@ -5,6 +5,7 @@ const cf = cta.contactForm; const model = { actionUrl: cf.actionUrl, mailto: cf.mailto, + turnstileSiteKey: cf.turnstileSiteKey, notifySubject: cf.notifySubject, successRedirect: cf.successRedirect, fieldName: cf.fieldName, @@ -15,6 +16,8 @@ const model = { }; const hasFormspree = typeof cf.actionUrl === 'string' && cf.actionUrl.length > 0; +const hasTurnstile = + typeof cf.turnstileSiteKey === 'string' && cf.turnstileSiteKey.length > 0; const nextUrl = typeof cf.successRedirect === 'string' && cf.successRedirect.length > 0 ? cf.successRedirect @@ -178,6 +181,23 @@ const fieldClass = >
+ { + hasFormspree && hasTurnstile ? ( ++ Verifica anti-spam: completa il controllo prima di inviare il messaggio. +
+