const langToggle = document.getElementById("lang-toggle"); const translations = { en: { home: "Home", services: "Services", downloads: "Downloads", login: "Exhibitor Login", contact: "Contact", downloadsOpen: "Open Downloads", contactBtn: "Get in Touch", exhibitorService: "Exhibitor Service", allForStand: "Everything for Stand, Space and Travel", servicesCopy: "The main planning areas are set up as a quick overview and lead to the appropriate portal areas.", downloadsTitle: "Materials for Your ETX Communication", downloadsCopy: "Current files for exhibitors, partners and service providers.", loginTitle: "Your Exhibitor Area", loginCopy: "Log in to manage company data and access central exhibitor services.", kontaktTitle: "AVR + planetfair", kontaktCopy: "Your contacts for organization, exhibitor documents and trade fair communication.", heroLead: "The exhibitor portal brings together key documents, logos and contacts for your trade fair planning in Kassel.", }, de: { home: "Home", services: "Services", downloads: "Downloads", login: "Aussteller-Login", contact: "Kontakt", downloadsOpen: "Downloads öffnen", contactBtn: "Kontakt aufnehmen", exhibitorService: "Aussteller-Service", allForStand: "Alles für Stand, Fläche und Anreise", servicesCopy: "Die wichtigsten Planungsbereiche sind als Schnellüberblick angelegt und führen in die passenden Portalbereiche.", downloadsTitle: "Materialien für Ihre ETX-Kommunikation", downloadsCopy: "Aktuelle Dateien für Aussteller, Partner und Dienstleister.", loginTitle: "Ihr Ausstellerbereich", loginCopy: "Melden Sie sich an, um Firmendaten zu pflegen und zentrale Aussteller-Services aufzurufen.", kontaktTitle: "AVR + planetfair", kontaktCopy: "Ihre Ansprechpartner für Organisation, Ausstellerunterlagen und Messekommunikation.", heroLead: "Das Ausstellerportal bündelt zentrale Unterlagen, Logos und Ansprechpartner für Ihre Messeplanung in Kassel.", }, }; let currentLang = "de"; function setText(selector, text) { qsa(selector).forEach((element) => { element.textContent = text; }); } function applyTranslations() { const t = translations[currentLang]; setText('.main-nav a[href="#home"]', t.home); setText('.main-nav a[href="#login"]', t.login); setText('.main-nav a[href="#services"]', t.services); setText('.main-nav a[href="#downloads"]', t.downloads); setText('.main-nav a[href="#kontakt"]', t.contact); setText(".hero-actions .button-primary", t.downloadsOpen); setText(".hero-actions .button-secondary", t.contactBtn); setText(".hero-lead", t.heroLead); setText("#services .section-kicker", t.exhibitorService); setText("#services-title", t.allForStand); setText("#services .section-copy", t.servicesCopy); setText("#downloads-title", t.downloadsTitle); setText("#downloads .section-copy", t.downloadsCopy); setText("#login-title", t.loginTitle); setText("#login .section-copy", t.loginCopy); setText("#kontakt-title", t.kontaktTitle); setText("#kontakt .section-copy", t.kontaktCopy); } function initLanguageToggle() { if (!langToggle) return; langToggle.addEventListener("click", () => { currentLang = currentLang === "de" ? "en" : "de"; langToggle.textContent = currentLang.toUpperCase(); applyTranslations(); }); } initLanguageToggle();