Completa le traduzioni EN/TH e corregge sezioni home ancora solo in italiano.

Stats e prodotti non usavano il locale, quindi dopo lo switch lingua lo scroll mostrava ancora l'italiano.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Javaxman
2026-07-29 23:53:46 +02:00
parent 3b52e5815c
commit 04a1892c0d
26 changed files with 6172 additions and 1830 deletions

View File

@ -7,44 +7,20 @@
* con flusso token via email lasciare `false` e usare `successMessage`.
*/
/** Destinazione della chat dopo identificazione / click su «Entra» */
const entryUrl = '/#contatti';
import type { SupportedLocale } from './navigation';
/** Destinazione della chat dopo identificazione / click su «Entra» (path IT). */
const entryPath = '/#contatti';
// Esempio WhatsApp: `https://wa.me/TUO_NUMERO?text=` + encodeURIComponent('Ciao NexStudio...');
export const chat = {
entryUrl,
const chatShared = {
/** Nuova scheda solo per link esterni (wa.me, widget, ecc.) */
openInNewTab: entryUrl.startsWith('http'),
linkTitle:
'Accesso alla chat NexStudio: stato canale, email di verifica e assistenza in più lingue.',
/**
* Cosa vede lutente **prima** di inserire email: chi risponde (umano / bot / entrambi).
* Aggiorna i testi in base agli orari effettivi del team.
*/
availability: {
badge: 'Operatore umano in orario · chatbot sempre attivo',
body:
'In orario lavorativo un operatore NexStudio può intervenire in chat; allingresso il chatbot può raccogliere il contesto iniziale e smistare la richiesta. Fuori orario la conversazione può proseguire con il solo chatbot fino al rientro del team. Lo stato effettivo è indicato qui sopra prima di procedere.',
},
openInNewTab: entryPath.startsWith('http'),
prechat: {
title: 'Prima della chat',
intro:
'Per evitare attese inutili chiediamo lindirizzo email a cui inviarti un link o un codice monouso per aprire la sessione in modo sicuro. Dopo la verifica potrai usare la chat dal canale che ti indicheremo.',
nameLabel: 'Nome (facoltativo)',
emailLabel: 'Email',
submitLabel: 'Richiedi accesso alla chat',
/** Visibile dopo linvio riuscito: utile se il link nella mail punta allo stesso `entryUrl` */
enterChatLabel: 'Ho ricevuto il messaggio — apri la chat',
closeLabel: 'Chiudi',
successMessage:
'Controlla la posta in arrivo: ti abbiamo inviato le istruzioni (link o codice) per entrare in chat. Se non vedi nulla, controlla anche lo spam.',
/** Formspree dedicato alla richiesta accesso chat — vuoto = prova `mailto` */
actionUrl: '',
/** Se `actionUrl` è vuoto */
mailto: '',
notifySubject: 'Richiesta accesso chat — sito NexStudio',
successRedirect: '',
fieldName: 'name',
fieldEmail: 'email',
@ -55,3 +31,96 @@ export const chat = {
openChatAfterSubmit: false,
},
} as const;
const entryUrlFor = (locale: SupportedLocale) => {
if (entryPath.startsWith('http') || locale === 'it') return entryPath;
if (entryPath.startsWith('/#')) return `/${locale}${entryPath}`;
if (entryPath.startsWith('/')) return `/${locale}${entryPath}`;
return entryPath;
};
const chatCopyByLocale = {
it: {
linkTitle:
'Accesso alla chat NexStudio: stato canale, email di verifica e assistenza in più lingue.',
availability: {
badge: 'Operatore umano in orario · chatbot sempre attivo',
body:
'In orario lavorativo un operatore NexStudio può intervenire in chat; allingresso il chatbot può raccogliere il contesto iniziale e smistare la richiesta. Fuori orario la conversazione può proseguire con il solo chatbot fino al rientro del team. Lo stato effettivo è indicato qui sopra prima di procedere.',
},
prechat: {
title: 'Prima della chat',
intro:
'Per evitare attese inutili chiediamo lindirizzo email a cui inviarti un link o un codice monouso per aprire la sessione in modo sicuro. Dopo la verifica potrai usare la chat dal canale che ti indicheremo.',
nameLabel: 'Nome (facoltativo)',
emailLabel: 'Email',
submitLabel: 'Richiedi accesso alla chat',
enterChatLabel: 'Ho ricevuto il messaggio — apri la chat',
closeLabel: 'Chiudi',
successMessage:
'Controlla la posta in arrivo: ti abbiamo inviato le istruzioni (link o codice) per entrare in chat. Se non vedi nulla, controlla anche lo spam.',
notifySubject: 'Richiesta accesso chat — sito NexStudio',
},
},
en: {
linkTitle:
'NexStudio chat access: channel status, verification email, and multilingual support.',
availability: {
badge: 'Human operator during hours · chatbot always on',
body:
'During business hours a NexStudio operator can join the chat; at entry the chatbot can gather initial context and route the request. Outside hours the conversation may continue with the chatbot alone until the team is back. The live status is shown above before you proceed.',
},
prechat: {
title: 'Before chat',
intro:
'To avoid unnecessary waiting we ask for the email address where we can send a one-time link or code to open the session securely. After verification you can use chat on the channel we indicate.',
nameLabel: 'Name (optional)',
emailLabel: 'Email',
submitLabel: 'Request chat access',
enterChatLabel: 'I received the message — open chat',
closeLabel: 'Close',
successMessage:
'Check your inbox: we sent instructions (link or code) to enter the chat. If you see nothing, also check spam.',
notifySubject: 'Chat access request — NexStudio website',
},
},
th: {
linkTitle:
'เข้าใช้งานแชท NexStudio: สถานะช่องทาง อีเมลยืนยัน และการช่วยเหลือหลายภาษา',
availability: {
badge: 'มีเจ้าหน้าที่ในเวลาทำการ · แชทบอตพร้อมตลอดเวลา',
body:
'ในเวลาทำการ เจ้าหน้าที่ NexStudio สามารถเข้าร่วมแชทได้ และตอนเริ่มต้นแชทบอตอาจเก็บบริบทเบื้องต้นแล้วส่งต่อคำขอ นอกเวลาทำการ การสนทนาอาจดำเนินต่อด้วยแชทบอตจนกว่าทีมจะกลับมา สถานะจริงจะแสดงด้านบนก่อนดำเนินการต่อ',
},
prechat: {
title: 'ก่อนเริ่มแชท',
intro:
'เพื่อลดการรอที่ไม่จำเป็น เราขอที่อยู่อีเมลสำหรับส่งลิงก์หรือรหัสแบบใช้ครั้งเดียวเพื่อเปิดเซสชันอย่างปลอดภัย หลังยืนยันแล้ว คุณจะใช้แชทผ่านช่องทางที่เราระบุได้',
nameLabel: 'ชื่อ (ไม่บังคับ)',
emailLabel: 'อีเมล',
submitLabel: 'ขอเข้าใช้งานแชท',
enterChatLabel: 'ได้รับข้อความแล้ว — เปิดแชท',
closeLabel: 'ปิด',
successMessage:
'โปรดตรวจสอบกล่องจดหมาย: เราได้ส่งคำแนะนำ (ลิงก์หรือรหัส) สำหรับเข้าแชทแล้ว หากไม่พบ ให้ตรวจสแปมด้วย',
notifySubject: 'คำขอเข้าใช้งานแชท — เว็บไซต์ NexStudio',
},
},
} as const;
export const getChat = (locale: SupportedLocale) => {
const copy = chatCopyByLocale[locale];
return {
...chatShared,
entryUrl: entryUrlFor(locale),
linkTitle: copy.linkTitle,
availability: copy.availability,
prechat: {
...chatShared.prechat,
...copy.prechat,
},
};
};
/** Retro-compatibilità: fallback italiano. */
export const chat = getChat('it');