declare global { interface Window { __PROSTADINE_I18N_RUNTIME__?: boolean; } } (function () { if (window.__PROSTADINE_I18N_RUNTIME__) { console.log("__ANIMA_DBG__ i18n module skipped (already initialized)"); return; } window.__PROSTADINE_I18N_RUNTIME__ = true; console.log("__ANIMA_DBG__ i18n module boot loaded"); const i18n = { fr: { pageTitle: "Prostadine | Informations officielles produit", pageDescription: "Informations produit Prostadine, ingrédients, avis clients et options de commande dans une page HTML5 statique.", brand: "Prostadine", navAriaLabel: "Navigation principale", languageLabel: "Langue", navAbout: "À propos", navIngredients: "Ingrédients", navBenefits: "Bénéfices", navOrder: "Commander", navFaq: "FAQ", heroTitle: "Soutien quotidien avancé pour la santé de la prostate et des voies urinaires", heroDescription: "Prostadine est présenté ici comme une expérience HTML5 statique avec les points forts du produit, un aperçu des ingrédients, des avis clients et un accès direct à la commande.", heroCtaPrimary: "Commander maintenant", heroCtaSecondary: "Voir les ingrédients", heroImageAlt: "Flacons du produit Prostadine", aboutTitle: "À propos de Prostadine", aboutDescription: "Cette section présente le concept et la finalité du produit dans une mise en page HTML5 claire. La structure de la page utilise désormais des sections sémantiques pour une meilleure accessibilité et un rendu plus conforme.", ingredientsTitle: "Ingrédients", ingredientsCard1Title: "Mélange naturel", ingredientsCard1Text: "La présentation de la formule met en avant un soutien quotidien au bien-être grâce à des ingrédients naturels soigneusement sélectionnés.", ingredientsCard2Title: "Accent sur la qualité", ingredientsCard2Text: "La qualité des ingrédients et les standards de production sont mis en avant pour renforcer la confiance et la régularité.", ingredientsCard3Title: "Routine simple", ingredientsCard3Text: "Une routine simple est proposée afin de rester constant avec un minimum de friction.", benefitsTitle: "Bénéfices du produit", benefitsCard1Title: "Soutien quotidien", benefitsCard1Text: "Conçu pour une utilisation continue dans le cadre d'une routine santé quotidienne.", benefitsCard2Title: "Orienté confort", benefitsCard2Text: "Le message produit met l'accent sur le confort, la confiance et la régularité.", benefitsCard3Title: "Valeur long terme", benefitsCard3Text: "Les options de packs sont structurées pour soutenir des programmes plus longs avec un meilleur prix unitaire.", bonusesTitle: "Bonus et livraison", bonusesDescription: "Les offres multi-flacons incluent des bonus et la livraison offerte pour renforcer la confiance à l'achat.", testimonialsTitle: "Avis clients", testimonialsDescription: "Basé sur 19 651 avis selon la présentation de la page produit.", starsAlt: "Évaluation en étoiles des clients", orderTitle: "Options de commande", orderPack1Title: "1 flacon", orderPack1Supply: "Approvisionnement 30 jours", orderPack1Alt: "Pack 1 flacon", orderPack6Title: "6 flacons", orderPack6Supply: "Approvisionnement 180 jours + livraison offerte", orderPack6Alt: "Pack 6 flacons", orderPack3Title: "3 flacons", orderPack3Supply: "Approvisionnement 90 jours", orderPack3Alt: "Pack 3 flacons", buyNow: "Acheter", guaranteeTitle: "Garantie", guaranteeDescription: "L'offre inclut une section de garantie orientée satisfaction dans le flux original de la page.", certificationTitle: "Certification", certificationDescription: "Les indicateurs de certification et de confiance restent présentés dans des sections HTML5 sémantiques.", faqTitle: "Questions fréquentes", faqQ1: "Comment passer une commande ?", faqA1: "Utilisez les boutons de commande de cette page, qui mènent directement au point de commande sécurisé.", faqQ2: "Les packs multi-flacons sont-ils disponibles ?", faqA2: "Oui. Les packs 3 flacons et 6 flacons sont listés dans la section des options de commande.", faqQ3: "Où trouver les références scientifiques ?", faqA3: "L'expérience d'origine inclut des références scientifiques dans le flux d'information produit.", referencesTitle: "Références scientifiques", referencesDescription: "Le contenu de référence est conservé comme section sémantique dédiée pour la lisibilité et la conformité.", footerCopyright: "© Prostadine. Tous droits réservés.", footerSupportLabel: "Support :", footerSupportLink: "Page officielle de commande", }, en: { pageTitle: "Prostadine | Official Product Information", pageDescription: "Prostadine product information, ingredients, customer feedback, and order options in a static HTML5 page.", brand: "Prostadine", navAriaLabel: "Main navigation", languageLabel: "Language", navAbout: "About", navIngredients: "Ingredients", navBenefits: "Benefits", navOrder: "Order", navFaq: "FAQ", heroTitle: "Advanced Daily Support for Prostate and Urinary Health", heroDescription: "Prostadine is presented here as a static HTML5 experience with product highlights, ingredient overview, customer feedback, and direct ordering access.", heroCtaPrimary: "Order Now", heroCtaSecondary: "See Ingredients", heroImageAlt: "Prostadine product bottles", aboutTitle: "About Prostadine", aboutDescription: "This section introduces the product concept and purpose in a clean HTML5 layout. The page structure now uses semantic sections for clearer accessibility and compliance-friendly rendering.", ingredientsTitle: "Ingredients", ingredientsCard1Title: "Natural Blend", ingredientsCard1Text: "The formula presentation focuses on daily wellness support through carefully selected natural ingredients.", ingredientsCard2Title: "Quality Focus", ingredientsCard2Text: "Ingredient quality and production standards are highlighted for confidence and consistency.", ingredientsCard3Title: "Simple Routine", ingredientsCard3Text: "A straightforward routine is emphasized so users can stay consistent with minimal friction.", benefitsTitle: "Product Benefits", benefitsCard1Title: "Daily Support", benefitsCard1Text: "Designed for ongoing use as part of a daily health routine.", benefitsCard2Title: "Comfort-Oriented", benefitsCard2Text: "The product messaging emphasizes comfort, confidence, and consistency.", benefitsCard3Title: "Long-Term Value", benefitsCard3Text: "Bundle options are structured to support longer plans with better unit value.", bonusesTitle: "Bonuses and Shipping", bonusesDescription: "Multi-bottle packages include bonus value framing and free shipping callouts to support purchase confidence.", testimonialsTitle: "Customer Feedback", testimonialsDescription: "Based on 19,651 reviews according to the product page presentation.", starsAlt: "Customer star rating", orderTitle: "Order Options", orderPack1Title: "1 X Bottle", orderPack1Supply: "30 Day Supply", orderPack1Alt: "One bottle package", orderPack6Title: "6 X Bottles", orderPack6Supply: "180 Day Supply + Free Shipping", orderPack6Alt: "Six bottle package", orderPack3Title: "3 X Bottles", orderPack3Supply: "90 Day Supply", orderPack3Alt: "Three bottle package", buyNow: "Buy Now", guaranteeTitle: "Guarantee", guaranteeDescription: "The offer includes a satisfaction-focused guarantee section in the original layout flow.", certificationTitle: "Certification", certificationDescription: "Certification and trust indicators remain represented in semantic HTML5 sections.", faqTitle: "Frequently Asked Questions", faqQ1: "How do I place an order?", faqA1: "Use the order buttons on this page, which link directly to the secure order endpoint.", faqQ2: "Are multi-bottle bundles available?", faqA2: "Yes. The 3-bottle and 6-bottle packages are listed in the order options section.", faqQ3: "Where can I find scientific references?", faqA3: "The original experience includes scientific reference material as part of the product information flow.", referencesTitle: "Scientific References", referencesDescription: "Reference content is retained as a dedicated semantic section for readability and compliance.", footerCopyright: "© Prostadine. All rights reserved.", footerSupportLabel: "Support:", footerSupportLink: "Official Order Page", }, es: { pageTitle: "Prostadine | Información oficial del producto", pageDescription: "Información de Prostadine, ingredientes, opiniones de clientes y opciones de compra en una página HTML5 estática.", brand: "Prostadine", navAriaLabel: "Navegación principal", languageLabel: "Idioma", navAbout: "Acerca de", navIngredients: "Ingredientes", navBenefits: "Beneficios", navOrder: "Comprar", navFaq: "FAQ", heroTitle: "Soporte diario avanzado para la salud prostática y urinaria", heroDescription: "Prostadine se presenta aquí como una experiencia HTML5 estática con puntos clave del producto, resumen de ingredientes, opiniones de clientes y acceso directo a la compra.", heroCtaPrimary: "Comprar ahora", heroCtaSecondary: "Ver ingredientes", heroImageAlt: "Frascos del producto Prostadine", aboutTitle: "Acerca de Prostadine", aboutDescription: "Esta sección presenta el concepto y objetivo del producto en un diseño HTML5 limpio. La estructura de la página ahora usa secciones semánticas para una accesibilidad más clara y una visualización compatible con cumplimiento.", ingredientsTitle: "Ingredientes", ingredientsCard1Title: "Mezcla natural", ingredientsCard1Text: "La presentación de la fórmula se centra en el soporte diario del bienestar con ingredientes naturales cuidadosamente seleccionados.", ingredientsCard2Title: "Enfoque en calidad", ingredientsCard2Text: "La calidad de los ingredientes y los estándares de producción se destacan para transmitir confianza y consistencia.", ingredientsCard3Title: "Rutina simple", ingredientsCard3Text: "Se destaca una rutina directa para que el usuario mantenga constancia con mínima fricción.", benefitsTitle: "Beneficios del producto", benefitsCard1Title: "Soporte diario", benefitsCard1Text: "Diseñado para uso continuo como parte de una rutina diaria de salud.", benefitsCard2Title: "Orientado al confort", benefitsCard2Text: "El mensaje del producto enfatiza confort, confianza y consistencia.", benefitsCard3Title: "Valor a largo plazo", benefitsCard3Text: "Las opciones de paquetes están estructuradas para planes más largos con mejor valor por unidad.", bonusesTitle: "Bonos y envío", bonusesDescription: "Los paquetes de varios frascos incluyen bonos y envío gratis para reforzar la confianza de compra.", testimonialsTitle: "Opiniones de clientes", testimonialsDescription: "Basado en 19.651 reseñas según la presentación de la página del producto.", starsAlt: "Calificación en estrellas de clientes", orderTitle: "Opciones de compra", orderPack1Title: "1 frasco", orderPack1Supply: "Suministro para 30 días", orderPack1Alt: "Paquete de un frasco", orderPack6Title: "6 frascos", orderPack6Supply: "Suministro para 180 días + envío gratis", orderPack6Alt: "Paquete de seis frascos", orderPack3Title: "3 frascos", orderPack3Supply: "Suministro para 90 días", orderPack3Alt: "Paquete de tres frascos", buyNow: "Comprar", guaranteeTitle: "Garantía", guaranteeDescription: "La oferta incluye una sección de garantía enfocada en satisfacción dentro del flujo original de diseño.", certificationTitle: "Certificación", certificationDescription: "Los indicadores de certificación y confianza se mantienen en secciones HTML5 semánticas.", faqTitle: "Preguntas frecuentes", faqQ1: "¿Cómo hago un pedido?", faqA1: "Use los botones de compra de esta página, que enlazan directamente al punto de pedido seguro.", faqQ2: "¿Hay paquetes de varios frascos?", faqA2: "Sí. Los paquetes de 3 y 6 frascos están en la sección de opciones de compra.", faqQ3: "¿Dónde encuentro referencias científicas?", faqA3: "La experiencia original incluye material de referencias científicas dentro del flujo de información del producto.", referencesTitle: "Referencias científicas", referencesDescription: "El contenido de referencias se conserva como una sección semántica dedicada para legibilidad y cumplimiento.", footerCopyright: "© Prostadine. Todos los derechos reservados.", footerSupportLabel: "Soporte:", footerSupportLink: "Página oficial de compra", }, }; function getSafeStorage() { try { const probeKey = "__anima_i18n_probe__"; localStorage.setItem(probeKey, "1"); localStorage.removeItem(probeKey); return localStorage; } catch (error) { console.log("__ANIMA_DBG__ i18n storage unavailable"); return null; } } function applyLanguage( lang: "fr" | "en" | "es", refs: { textNodes: Element[]; altNodes: Element[]; ariaNodes: Element[]; languageButtons: Element[]; descriptionMeta: HTMLMetaElement | null; safeStorage: Storage | null; }, ) { const dict = i18n[lang] || i18n.fr; document.documentElement.lang = lang; if (dict.pageTitle) { document.title = dict.pageTitle; } if (refs.descriptionMeta && dict.pageDescription) { refs.descriptionMeta.setAttribute("content", dict.pageDescription); } refs.textNodes.forEach((node) => { const key = node.getAttribute("data-i18n"); if (key && dict[key as keyof typeof dict]) { node.innerHTML = dict[key as keyof typeof dict] as string; } }); refs.altNodes.forEach((node) => { const key = node.getAttribute("data-i18n-alt"); if (key && dict[key as keyof typeof dict]) { node.setAttribute("alt", dict[key as keyof typeof dict] as string); } }); refs.ariaNodes.forEach((node) => { const key = node.getAttribute("data-i18n-aria-label"); if (key && dict[key as keyof typeof dict]) { node.setAttribute( "aria-label", dict[key as keyof typeof dict] as string, ); } }); refs.languageButtons.forEach((button) => { const active = button.getAttribute("data-lang") === lang; button.classList.toggle("active", active); }); if (refs.safeStorage) { refs.safeStorage.setItem("site-language", lang); } console.log("__ANIMA_DBG__ i18n applied", lang); } function bindAndInitI18n() { const languageButtons = Array.from(document.querySelectorAll(".lang-btn")); if (!languageButtons.length) { return false; } const refs = { textNodes: Array.from(document.querySelectorAll("[data-i18n]")), altNodes: Array.from(document.querySelectorAll("[data-i18n-alt]")), ariaNodes: Array.from( document.querySelectorAll("[data-i18n-aria-label]"), ), languageButtons, descriptionMeta: document.querySelector('meta[name="description"]'), safeStorage: getSafeStorage(), }; languageButtons.forEach((button) => { button.addEventListener("click", () => { const selected = (button.getAttribute("data-lang") || "fr") as | "fr" | "en" | "es"; applyLanguage(selected, refs); }); }); let initialLanguage: "fr" | "en" | "es" = "fr"; if (refs.safeStorage) { const storedLanguage = refs.safeStorage.getItem("site-language"); if ( storedLanguage === "fr" || storedLanguage === "en" || storedLanguage === "es" ) { initialLanguage = storedLanguage; } } applyLanguage(initialLanguage, refs); console.log("__ANIMA_DBG__ i18n initialized", initialLanguage); return true; } function initWithRetry() { let attempts = 0; const maxAttempts = 20; function tryInit() { attempts += 1; const ok = bindAndInitI18n(); if (ok) { return; } if (attempts < maxAttempts) { window.setTimeout(tryInit, 100); } else { console.log("__ANIMA_DBG__ i18n init failed after retries"); } } tryInit(); } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", initWithRetry); } else { initWithRetry(); } })();