### Overview Implement PDPA & GDPR compliant Cookie Consent Management Platform (CMP) for pps/website: - **Zustand Store (cookieConsentStore.ts):** Stores consent record ( ecessary, nalytics, marketing) in localStorage with skipHydration: true for Next.js SSR safety. - **Cookie Banner (CookieBanner.tsx):** Fixed bottom floating banner with Quiet Luxury styling, providing Accept All, Reject Non-Essential, and Customize buttons. - **Preferences Modal (CookiePreferencesModal.tsx):** Detailed modal dialog allowing users to granularly toggle Analytics and Marketing cookies (Strictly Necessary is locked). - **Script Manager (ScriptManager.tsx):** Coordinates Google Consent Mode v2 (nalytics_storage, d_storage), conditionally injects GA4, Meta Pixel, and TikTok Pixel, and dispatches homaroma:consent-change DOM events. - **Footer Revocation Link:** Added Cookie Preferences link in the Support column of Footer.tsx so users can modify/revoke consent anytime. - **Multilingual Support:** Added localized text for TH, EN, JA, and ZH. --------- Co-authored-by: Your Name <you@example.com> Reviewed-on: #14 Co-authored-by: antigravity-bot <bot@kittisak.com>
26 lines
1.1 KiB
TypeScript
26 lines
1.1 KiB
TypeScript
import enTranslation from '../locales/en/translation.json'
|
|
import thTranslation from '../locales/th/translation.json'
|
|
import jaTranslation from '../locales/ja/translation.json'
|
|
import zhTranslation from '../locales/zh/translation.json'
|
|
import viTranslation from '../locales/vi/translation.json'
|
|
import koTranslation from '../locales/ko/translation.json'
|
|
import loTranslation from '../locales/lo/translation.json'
|
|
import itTranslation from '../locales/it/translation.json'
|
|
|
|
export type TranslationSchema = typeof thTranslation
|
|
|
|
const translations: Record<string, TranslationSchema> = {
|
|
th: thTranslation,
|
|
en: enTranslation as unknown as TranslationSchema,
|
|
ja: jaTranslation as unknown as TranslationSchema,
|
|
zh: zhTranslation as unknown as TranslationSchema,
|
|
vi: viTranslation as unknown as TranslationSchema,
|
|
ko: koTranslation as unknown as TranslationSchema,
|
|
lo: loTranslation as unknown as TranslationSchema,
|
|
it: itTranslation as unknown as TranslationSchema,
|
|
}
|
|
|
|
export function getServerTranslations(lang = 'th'): TranslationSchema {
|
|
return translations[lang] ?? translations.en ?? translations.th
|
|
}
|