// public/assets/js/lang.js const translations = { en: { // Meta / Nav meta_title: "USBCheck – Test your USB drives", nav_how_it_works: "How it works", nav_features: "Features", nav_pricing: "Pricing", nav_faq: "FAQ", btn_login: "Login", // Hero hero_kicker: "USB drive diagnostics", hero_title: "Check your USB sticks – before you trust them.", hero_subtitle: "USBCheck helps you evaluate capacity, speed and data integrity of your USB drives – with a quick browser-based test and an optional Pro mode for deeper analysis.", cta_quick_test: "Start quick test", cta_how_it_works: "How does it work?", hero_bullet_1: "Quick test directly in your browser – no account required.", hero_bullet_2: "Understand real performance, not just what’s printed on the package.", hero_bullet_3: "Optional advanced tests with a local helper app (coming soon).", hero_card_title: "Example values from a good USB 3.2 drive", metric_speed: "Sequential speed", metric_integrity: "Integrity score", metric_confidence: "Confidence", hero_small_hint: "Values are examples – your real USB drive is measured on your own device.", // How it works how_title: "How USBCheck works", how_intro: "USBCheck combines a browser-based quick test with optional advanced tests via a local helper. You decide how deep you want to go – from a simple speed check to extended capacity and integrity tests.", how_step1_title: "1. Choose your drive", how_step1_text: "Start the quick test and select a folder on the USB stick you want to analyse. The browser only sees the folder you explicitly allow.", how_step2_title: "2. Run the quick test", how_step2_text: "USBCheck creates temporary test data, measures write & read speed and checks whether everything can be read back correctly.", how_step3_title: "3. Understand the results", how_step3_text: "You receive a compact report with speed, integrity and hints on how the result compares to typical values for similar drives.", how_step4_title: "4. Go deeper (Pro mode, coming soon)", how_step4_text: "With an optional helper app, advanced tests can check the effective capacity, test larger areas and produce detailed logs – directly controlled from the web interface.", // Features features_title: "Designed for transparency and control", features_intro: "Whether you just want a quick check or a detailed analysis – USBCheck gives you control over how your USB drive is tested.", feature_free_title: "Quick test in the browser", feature_free_1: "No installation – everything runs in your browser.", feature_free_2: "Select a folder on the USB drive and run a short write/read test.", feature_free_3: "Get a clear, human-friendly summary of your results.", feature_pro_title: "Pro mode with helper app", feature_pro_1: "Extended tests with larger data volumes (planned).", feature_pro_2: "Optional integration with established tools on your system.", feature_pro_3: "Detailed reports and export options for documentation.", label_coming_soon: "Coming soon", // Pricing pricing_title: "Fair model: quick test free, advanced tests optional", pricing_intro: "The quick browser-based check will remain free. For extended tests and power features, we are planning a transparent Pro model.", pricing_free_title: "Quick test", pricing_free_price: "Free", pricing_free_1: "Browser-based speed and integrity test", pricing_free_2: "No registration required", pricing_free_3: "Local test – your data remains on your device", pricing_free_cta: "Start quick test now", pricing_pro_title: "Pro mode", pricing_pro_price: "Planned", pricing_pro_1: "Extended capacity and surface tests", pricing_pro_2: "Detailed logs and export options", pricing_pro_3: "Priority support and more configuration options", pricing_pro_cta: "Pro mode not yet available", // FAQ faq_title: "Frequently asked questions", faq_intro: "Here you’ll find answers to common questions about how USBCheck works and how your data is handled.", faq_q1: "Is my data uploaded to usbcheck.it during the test?", faq_a1: "No. The quick test runs in your browser and writes temporary data only to the USB drive you have selected. Test data can be deleted afterwards. Only if you actively choose to share anonymous statistics in the future will any information be sent to the server.", faq_q2: "Can USBCheck detect fake capacity drives?", faq_a2: "The quick test is designed for speed and integrity. For suspicious drives or capacity checks, the planned Pro mode with helper app will offer deeper tests that can uncover inconsistencies between reported and actual capacity.", faq_q3: "Which operating systems are supported?", faq_a3: "The browser-based quick test is available on modern desktop browsers (for example Chromium-based). The Pro mode will support Windows, macOS and Linux via a small helper application.", faq_q4: "Is frequent testing harmful to my USB drive?", faq_a4: "Flash memory has a limited number of write cycles. The quick test uses moderate data volumes. For very intensive or repeated tests with large data sizes, we will explicitly point out the potential wear in the Pro mode.", // Footer footer_imprint: "Imprint", footer_privacy: "Privacy" }, de: { meta_title: "USBCheck – USB-Sticks testen", nav_how_it_works: "Funktionsweise", nav_features: "Funktionen", nav_pricing: "Preise", nav_faq: "FAQ", btn_login: "Login", hero_kicker: "USB-Stick-Diagnose", hero_title: "Prüfe deinen USB-Stick – bevor du ihm vertraust.", hero_subtitle: "USBCheck hilft dir, Kapazität, Geschwindigkeit und Datenintegrität deiner USB-Sticks einzuschätzen – mit einem schnellen Browser-Test und einem geplanten Pro-Modus für tiefere Analysen.", cta_quick_test: "Schnelltest starten", cta_how_it_works: "So funktioniert es", hero_bullet_1: "Schneller Test direkt im Browser – ohne Registrierung.", hero_bullet_2: "Verstehe die tatsächliche Leistung, nicht nur die Herstellerangaben.", hero_bullet_3: "Optional erweiterte Tests mit lokaler Helper-App (in Planung).", hero_card_title: "Beispielwerte eines guten USB-3.2-Sticks", metric_speed: "Sequenzielle Geschwindigkeit", metric_integrity: "Integrität", metric_confidence: "Einschätzung", hero_small_hint: "Die gezeigten Werte sind Beispiele – dein eigener USB-Stick wird auf deinem Gerät gemessen.", how_title: "So funktioniert USBCheck", how_intro: "USBCheck kombiniert einen schnellen Browser-Test mit optional erweiterten Prüfungen über eine lokale Helper-App. Du bestimmst, wie tief die Analyse gehen soll.", how_step1_title: "1. Stick auswählen", how_step1_text: "Starte den Schnelltest und wähle einen Ordner auf dem USB-Stick, den du prüfen möchtest. Der Browser sieht nur den Ordner, den du freigibst.", how_step2_title: "2. Schnelltest ausführen", how_step2_text: "USBCheck schreibt Testdaten, misst Schreib- und Lesegeschwindigkeit und prüft, ob sich alle Daten fehlerfrei zurücklesen lassen.", how_step3_title: "3. Ergebnisse verstehen", how_step3_text: "Du erhältst einen kompakten Bericht mit Geschwindigkeit, Integrität und Hinweisen, wie dein Stick im Vergleich zu typischen Werten abschneidet.", how_step4_title: "4. Tiefere Tests (Pro-Modus, geplant)", how_step4_text: "Mit einer optionalen Helper-App können größere Bereiche und Kapazität detaillierter geprüft werden – gesteuert über das Web-Interface.", features_title: "Transparente Tests für deine USB-Sticks", features_intro: "Ob schneller Check oder detaillierte Analyse – USBCheck gibt dir Kontrolle darüber, wie dein USB-Stick geprüft wird.", feature_free_title: "Schnelltest im Browser", feature_free_1: "Keine Installation – der Test läuft im Browser.", feature_free_2: "Wähle einen Ordner auf dem Stick und starte einen kurzen Schreib-/Lesetest.", feature_free_3: "Erhalte eine verständliche Zusammenfassung deiner Ergebnisse.", feature_pro_title: "Pro-Modus mit Helper-App", feature_pro_1: "Erweiterte Tests mit größeren Datenmengen (geplant).", feature_pro_2: "Optionale Anbindung an vorhandene Tools auf deinem System.", feature_pro_3: "Detaillierte Protokolle und Export-Möglichkeiten.", label_coming_soon: "Bald verfügbar", pricing_title: "Faires Modell: Schnelltest kostenlos", pricing_intro: "Der Browser-Schnelltest bleibt kostenlos. Für erweiterte Prüfungen planen wir ein transparentes Pro-Modell.", pricing_free_title: "Schnelltest", pricing_free_price: "Kostenlos", pricing_free_1: "Browserbasierter Geschwindigkeits- und Integritätstest", pricing_free_2: "Keine Registrierung erforderlich", pricing_free_3: "Lokaler Test – deine Daten bleiben auf deinem Gerät", pricing_free_cta: "Jetzt Schnelltest starten", pricing_pro_title: "Pro-Modus", pricing_pro_price: "In Planung", pricing_pro_1: "Erweiterte Kapazitäts- und Oberflächentests", pricing_pro_2: "Detaillierte Logs und Export", pricing_pro_3: "Priorisierter Support und mehr Optionen", pricing_pro_cta: "Pro-Modus noch nicht verfügbar", faq_title: "Häufige Fragen", faq_intro: "Hier findest du Antworten auf häufige Fragen zur Funktionsweise von USBCheck und zum Umgang mit deinen Daten.", faq_q1: "Werden meine Daten während des Tests zu usbcheck.it hochgeladen?", faq_a1: "Nein. Der Schnelltest läuft im Browser und schreibt temporäre Testdaten nur auf den von dir ausgewählten USB-Stick. Testdaten können anschließend gelöscht werden. Erst wenn du später ausdrücklich zustimmst, können anonyme Statistiken übertragen werden.", faq_q2: "Kann USBCheck gefälschte Kapazitäten erkennen?", faq_a2: "Der Schnelltest ist auf Geschwindigkeit und Integrität ausgelegt. Für verdächtige Sticks oder Kapazitätsprüfungen ist im Pro-Modus eine tiefere Analyse geplant, die Unstimmigkeiten zwischen angegebener und tatsächlicher Kapazität aufdecken kann.", faq_q3: "Welche Betriebssysteme werden unterstützt?", faq_a3: "Der Browser-Schnelltest funktioniert auf modernen Desktop-Browsern (zum Beispiel Chromium-basiert). Der Pro-Modus wird eine kleine Helper-App für Windows, macOS und Linux nutzen.", faq_q4: "Schadet häufiges Testen meinem USB-Stick?", faq_a4: "Flash-Speicher hat nur eine begrenzte Zahl an Schreibzyklen. Der Schnelltest verwendet moderate Datenmengen. Bei sehr intensiven oder wiederholten Tests mit großen Volumina weisen wir im Pro-Modus explizit auf möglichen Verschleiß hin.", footer_imprint: "Impressum", footer_privacy: "Datenschutz" }, it: { meta_title: "USBCheck – Test dei supporti USB", nav_how_it_works: "Come funziona", nav_features: "Funzionalità", nav_pricing: "Prezzi", nav_faq: "FAQ", btn_login: "Login", hero_kicker: "Diagnostica delle unità USB", hero_title: "Controlla le tue chiavette USB prima di fidarti.", hero_subtitle: "USBCheck ti aiuta a valutare capacità, velocità e integrità dei dati delle tue unità USB – con un rapido test nel browser e una modalità Pro pianificata per analisi più approfondite.", cta_quick_test: "Avvia test rapido", cta_how_it_works: "Come funziona", hero_bullet_1: "Test rapido direttamente nel browser – nessuna registrazione.", hero_bullet_2: "Comprendi le prestazioni reali, non solo le promesse sulla confezione.", hero_bullet_3: "Test avanzati con app locale di supporto (in arrivo).", hero_card_title: "Valori di esempio di una buona unità USB 3.2", metric_speed: "Velocità sequenziale", metric_integrity: "Integrità", metric_confidence: "Valutazione", hero_small_hint: "I valori mostrati sono di esempio – la tua unità USB viene misurata direttamente sul tuo dispositivo.", how_title: "Come funziona USBCheck", how_intro: "USBCheck combina un test rapido nel browser con test avanzati opzionali tramite un'app locale. Sei tu a decidere quanto approfondita debba essere l'analisi.", how_step1_title: "1. Seleziona l'unità", how_step1_text: "Avvia il test rapido e seleziona una cartella sulla chiavetta USB che desideri analizzare. Il browser vede solo la cartella che autorizzi.", how_step2_title: "2. Esegui il test", how_step2_text: "USBCheck scrive dati di prova, misura la velocità di scrittura e lettura e controlla che tutto possa essere letto correttamente.", how_step3_title: "3. Analizza i risultati", how_step3_text: "Ricevi un report compatto con velocità, integrità e indicazioni su come la tua unità si confronta con valori tipici.", how_step4_title: "4. Analisi più approfondite (modalità Pro)", how_step4_text: "Con un'app di supporto opzionale, test estesi possono verificare capacità effettiva e porzioni più grandi dell'unità – gestiti dall'interfaccia web.", features_title: "Trasparenza e controllo sui tuoi supporti USB", features_intro: "Che tu voglia solo un controllo veloce o un’analisi dettagliata, USBCheck ti offre il livello di test adatto alle tue esigenze.", feature_free_title: "Test rapido nel browser", feature_free_1: "Nessuna installazione – il test avviene nel browser.", feature_free_2: "Seleziona una cartella sull’unità USB ed esegui un breve test di scrittura/lettura.", feature_free_3: "Ottieni un riepilogo chiaro e comprensibile dei risultati.", feature_pro_title: "Modalità Pro con app locale", feature_pro_1: "Test estesi con volumi di dati maggiori (in arrivo).", feature_pro_2: "Integrazione opzionale con strumenti disponibili sul sistema.", feature_pro_3: "Report dettagliati ed esportazione dei risultati.", label_coming_soon: "Prossimamente", pricing_title: "Modello equo: test rapido gratuito", pricing_intro: "Il test rapido basato su browser rimarrà gratuito. Per test avanzati stiamo pianificando una modalità Pro trasparente.", pricing_free_title: "Test rapido", pricing_free_price: "Gratuito", pricing_free_1: "Test di velocità e integrità nel browser", pricing_free_2: "Senza registrazione", pricing_free_3: "Test locale – i tuoi dati restano sul dispositivo", pricing_free_cta: "Avvia test rapido", pricing_pro_title: "Modalità Pro", pricing_pro_price: "In arrivo", pricing_pro_1: "Test di capacità e superficie più approfonditi", pricing_pro_2: "Log dettagliati ed esportazione", pricing_pro_3: "Supporto prioritario e maggiori opzioni", pricing_pro_cta: "Modalità Pro non ancora disponibile", faq_title: "Domande frequenti", faq_intro: "Qui trovi le risposte alle domande più comuni su come funziona USBCheck e su come vengono gestiti i tuoi dati.", faq_q1: "I miei dati vengono caricati su usbcheck.it durante il test?", faq_a1: "No. Il test rapido viene eseguito nel browser e scrive dati di prova solo sull’unità USB selezionata. I dati di test possono essere eliminati dopo. Solo se in futuro sceglierai esplicitamente di condividere statistiche anonime saranno inviati dati al server.", faq_q2: "USBCheck può rilevare unità con capacità falsa?", faq_a2: "Il test rapido è pensato per velocità e integrità. Per unità sospette o controlli di capacità, la modalità Pro offrirà test più approfonditi per individuare discrepanze tra capacità dichiarata e reale.", faq_q3: "Quali sistemi operativi sono supportati?", faq_a3: "Il test rapido funziona sui moderni browser desktop (ad esempio basati su Chromium). La modalità Pro utilizzerà una piccola app locale per Windows, macOS e Linux.", faq_q4: "Test frequenti possono danneggiare la chiavetta USB?", faq_a4: "La memoria flash ha un numero limitato di cicli di scrittura. Il test rapido utilizza volumi di dati moderati. Per test molto intensivi e ripetuti con grandi quantità di dati, nella modalità Pro segnaleremo chiaramente il possibile usura.", footer_imprint: "Note legali", footer_privacy: "Privacy" }, fr: { meta_title: "USBCheck – Tester vos clés USB", nav_how_it_works: "Fonctionnement", nav_features: "Fonctionnalités", nav_pricing: "Tarifs", nav_faq: "FAQ", btn_login: "Connexion", hero_kicker: "Diagnostic de clés USB", hero_title: "Testez vos clés USB avant de leur confier vos données.", hero_subtitle: "USBCheck vous aide à évaluer la capacité, la vitesse et l’intégrité des données de vos clés USB – avec un test rapide dans le navigateur et une future version Pro pour des analyses plus poussées.", cta_quick_test: "Lancer le test rapide", cta_how_it_works: "Comment ça marche ?", hero_bullet_1: "Test rapide directement dans le navigateur – sans inscription.", hero_bullet_2: "Comprenez les performances réelles, pas seulement ce qui est écrit sur l’emballage.", hero_bullet_3: "Tests avancés avec une application locale (bientôt disponible).", hero_card_title: "Valeurs d’exemple pour une bonne clé USB 3.2", metric_speed: "Vitesse séquentielle", metric_integrity: "Intégrité", metric_confidence: "Évaluation", hero_small_hint: "Les valeurs affichées sont des exemples – votre propre clé USB est mesurée directement sur votre appareil.", how_title: "Comment fonctionne USBCheck", how_intro: "USBCheck combine un test rapide dans le navigateur avec des tests avancés optionnels via une application locale. Vous choisissez le niveau d’analyse souhaité.", how_step1_title: "1. Choisissez la clé", how_step1_text: "Lancez le test rapide et sélectionnez un dossier sur la clé USB à analyser. Le navigateur n’accède qu’au dossier que vous autorisez.", how_step2_title: "2. Exécutez le test", how_step2_text: "USBCheck écrit des données de test, mesure la vitesse d’écriture et de lecture, puis vérifie si tout peut être relu correctement.", how_step3_title: "3. Interprétez les résultats", how_step3_text: "Vous obtenez un rapport synthétique avec vitesse, intégrité et des indications pour situer votre clé par rapport à des valeurs typiques.", how_step4_title: "4. Analyses avancées (mode Pro)", how_step4_text: "Avec une application locale optionnelle, des tests plus approfondis peuvent vérifier la capacité effective et de plus grandes zones – le tout piloté via l’interface web.", features_title: "Transparence et contrôle pour vos clés USB", features_intro: "Que vous ayez besoin d’un simple contrôle ou d’une analyse détaillée, USBCheck vous laisse décider du niveau de test.", feature_free_title: "Test rapide dans le navigateur", feature_free_1: "Aucune installation – tout se fait dans le navigateur.", feature_free_2: "Sélectionnez un dossier sur la clé USB et lancez un court test d’écriture/lecture.", feature_free_3: "Recevez un résumé clair et compréhensible des résultats.", feature_pro_title: "Mode Pro avec application locale", feature_pro_1: "Tests étendus avec un volume de données plus important (bientôt).", feature_pro_2: "Intégration optionnelle avec des outils présents sur votre système.", feature_pro_3: "Rapports détaillés et options d’export.", label_coming_soon: "Bientôt disponible", pricing_title: "Modèle équitable : test rapide gratuit", pricing_intro: "Le test rapide dans le navigateur restera gratuit. Pour les tests avancés, un mode Pro transparent est prévu.", pricing_free_title: "Test rapide", pricing_free_price: "Gratuit", pricing_free_1: "Test de vitesse et d’intégrité dans le navigateur", pricing_free_2: "Aucune inscription requise", pricing_free_3: "Test local – vos données restent sur votre appareil", pricing_free_cta: "Lancer le test rapide", pricing_pro_title: "Mode Pro", pricing_pro_price: "À venir", pricing_pro_1: "Tests de capacité et de surface plus approfondis", pricing_pro_2: "Journalisation détaillée et export", pricing_pro_3: "Support prioritaire et réglages avancés", pricing_pro_cta: "Mode Pro pas encore disponible", faq_title: "Questions fréquentes", faq_intro: "Voici des réponses aux questions les plus fréquentes sur le fonctionnement d’USBCheck et la gestion de vos données.", faq_q1: "Mes données sont-elles envoyées à usbcheck.it pendant le test ?", faq_a1: "Non. Le test rapide s’exécute dans le navigateur et écrit des données de test uniquement sur la clé USB que vous avez choisie. Ces données peuvent être supprimées ensuite. Seules des statistiques anonymes pourront être envoyées si vous l’acceptez explicitement à l’avenir.", faq_q2: "USBCheck peut-il détecter une capacité falsifiée ?", faq_a2: "Le test rapide est axé sur la vitesse et l’intégrité. Pour les clés suspectes ou les vérifications de capacité, le mode Pro offrira des tests plus approfondis afin de détecter des incohérences entre capacité annoncée et réelle.", faq_q3: "Quels systèmes d’exploitation sont supportés ?", faq_a3: "Le test rapide fonctionne sur les navigateurs modernes de bureau (par exemple basés sur Chromium). Le mode Pro utilisera une petite application locale pour Windows, macOS et Linux.", faq_q4: "Des tests fréquents peuvent-ils endommager ma clé USB ?", faq_a4: "La mémoire flash dispose d’un nombre limité de cycles d’écriture. Le test rapide utilise un volume de données modéré. Pour des tests très intensifs et répétés avec beaucoup de données, nous signalerons explicitement ce risque dans le mode Pro.", footer_imprint: "Mentions légales", footer_privacy: "Confidentialité" } }; // Helper to get lang from URL function getLangFromUrl() { const params = new URLSearchParams(window.location.search); const l = (params.get('lang') || "").toLowerCase(); if (["de", "en", "it", "fr"].includes(l)) return l; return null; } // Helper to detect from browser function detectBrowserLang() { const navLang = (navigator.language || navigator.userLanguage || "en").toLowerCase(); if (navLang.startsWith("de")) return "de"; if (navLang.startsWith("it")) return "it"; if (navLang.startsWith("fr")) return "fr"; return "en"; } function applyLang(lang) { const dict = translations[lang] || translations.en; // Update and document.documentElement.lang = lang; if (dict.meta_title) { document.title = dict.meta_title; } // Update text nodes document.querySelectorAll("[data-i18n]").forEach(el => { const key = el.getAttribute("data-i18n"); const text = dict[key]; if (typeof text === "string") { el.textContent = text; } }); // Language switcher label const currentBtn = document.getElementById("lang-current"); if (currentBtn) { currentBtn.textContent = lang.toUpperCase(); } // Update quick-test link to keep lang parameter if present const quickBtn = document.getElementById("quick-test-btn"); if (quickBtn) { const base = "/fakecheck/"; // optional: append ?lang=xx for deep links quickBtn.href = base + "?lang=" + lang; } } function initLangSwitcher(currentLang) { const trigger = document.getElementById("lang-current"); const menu = document.getElementById("lang-menu"); if (!trigger || !menu) return; trigger.addEventListener("click", () => { menu.classList.toggle("hidden"); }); menu.querySelectorAll("button[data-lang]").forEach(btn => { btn.addEventListener("click", () => { const newLang = btn.getAttribute("data-lang"); const url = new URL(window.location.href); url.searchParams.set("lang", newLang); window.location.href = url.toString(); }); }); document.addEventListener("click", (e) => { if (!menu.contains(e.target) && e.target !== trigger) { menu.classList.add("hidden"); } }); } function initLoginAvatar() { const loginBtn = document.getElementById("login-button"); const avatar = document.getElementById("user-avatar"); if (!loginBtn || !avatar) return; // Demo: toggle avatar on click; später durch echte Session-Logik ersetzen loginBtn.addEventListener("click", () => { // Hier würdest du redirect zum echten Login einbauen. // Für das Layout-Demo simulieren wir einfach "eingeloggt". loginBtn.classList.add("hidden"); avatar.classList.remove("hidden"); // Avatar-Initialen könnten später vom Usernamen kommen. }); } document.addEventListener("DOMContentLoaded", () => { const urlLang = getLangFromUrl(); const lang = urlLang || detectBrowserLang(); applyLang(lang); initLangSwitcher(lang); initLoginAvatar(); });