This commit is contained in:
2025-11-25 22:07:05 +01:00
parent ea171ef815
commit 2c1f1c8338
11 changed files with 416 additions and 14 deletions

View File

@@ -1,6 +1,8 @@
<?php <?php
// 0) Umgebung / Domains / Error-Level
require_once __DIR__ . "/config.php"; require_once __DIR__ . "/config.php";
// ----------------------------------------------------------- // -----------------------------------------------------------
// Session starten // Session starten
// ----------------------------------------------------------- // -----------------------------------------------------------
@@ -40,7 +42,11 @@ if (is_string($lang)) {
// 2) Verfügbare JSON-Sprachen erkennen // 2) Verfügbare JSON-Sprachen erkennen
// ----------------------------------------------------------- // -----------------------------------------------------------
$i18nDir = __DIR__ . '/../public/assets/i18n'; $i18nDir = __DIR__ . '/../public/assets/i18n';
$langFiles = [];
if (is_dir($i18nDir)) {
$langFiles = glob($i18nDir . '/*.json') ?: []; $langFiles = glob($i18nDir . '/*.json') ?: [];
}
$availableLangs = []; $availableLangs = [];
@@ -52,7 +58,15 @@ foreach ($langFiles as $file) {
} }
$meta = $json['meta']; $meta = $json['meta'];
$code = strtolower($meta['code'] ?? basename($file, '.json'));
// Option: nur Sprachen mit enabled=true anzeigen (Template-Dateien rausfiltern)
if (isset($meta['enabled']) && $meta['enabled'] === false) {
continue;
}
$code = isset($meta['code']) && is_string($meta['code'])
? strtolower($meta['code'])
: strtolower(basename($file, '.json'));
$availableLangs[$code] = [ $availableLangs[$code] = [
'code' => $code, 'code' => $code,
@@ -74,7 +88,6 @@ if (empty($availableLangs)) {
// Falls Sprache ungültig oder nicht in available → erste verfügbare Sprache wählen // Falls Sprache ungültig oder nicht in available → erste verfügbare Sprache wählen
if (!$lang || !isset($availableLangs[$lang])) { if (!$lang || !isset($availableLangs[$lang])) {
// erste Sprache aus dem Array, ohne array_key_first (falls ältere PHP-Version)
$keys = array_keys($availableLangs); $keys = array_keys($availableLangs);
$lang = $keys[0] ?? 'en'; $lang = $keys[0] ?? 'en';
} }
@@ -119,6 +132,5 @@ $GLOBALS['i18n'] = [
// ----------------------------------------------------------- // -----------------------------------------------------------
// 6) Rest des Systems laden // 6) Rest des Systems laden
// ----------------------------------------------------------- // -----------------------------------------------------------
require_once __DIR__ . "/db.php"; require_once __DIR__ . "/db.php";
require_once __DIR__ . '/../src/functions.php'; require_once __DIR__ . '/../src/functions.php';

View File

@@ -2,7 +2,8 @@
"meta": { "meta": {
"code": "at", "code": "at",
"label": "Deutsch (AT)", "label": "Deutsch (AT)",
"flag": "🇦🇹" "flag": "🇦🇹",
"enabled": true
}, },
"header": { "header": {

View File

@@ -2,7 +2,8 @@
"meta": { "meta": {
"code": "ch", "code": "ch",
"label": "Schwiizerdütsch (Züri)", "label": "Schwiizerdütsch (Züri)",
"flag": "🇨🇭" "flag": "🇨🇭",
"enabled": true
}, },
"header": { "header": {
"header_slogan": "USB-Sticks testen", "header_slogan": "USB-Sticks testen",

View File

@@ -2,7 +2,8 @@
"meta": { "meta": {
"code": "de", "code": "de",
"label": "Deutsch", "label": "Deutsch",
"flag": "🇩🇪" "flag": "🇩🇪",
"enabled": true
}, },
"header": { "header": {

View File

@@ -2,7 +2,8 @@
"meta": { "meta": {
"code": "dk", "code": "dk",
"label": "Dansk", "label": "Dansk",
"flag": "🇩🇰" "flag": "🇩🇰",
"enabled": true
}, },
"header": { "header": {

383
public/assets/i18n/en.json Normal file
View File

@@ -0,0 +1,383 @@
{
"meta": {
"code": "en",
"label": "English",
"flag": "🇬🇧",
"enabled": true
},
"header": {
"header_slogan": "Test USB drives",
"btn_login": "Login",
"nav_how": "How it works",
"nav_problem": "Why it matters",
"nav_features": "Features",
"nav_security": "Security",
"nav_faq": "FAQ"
},
"brand": {
"brand_wordmark": "{{primary_domain}}",
"brand_subtitle": "Check USB drives for fakes"
},
"footer": {
"footer_imprint": "Legal",
"footer_privacy": "Privacy",
"footer_copy": "© {year} {{primary_domain}}. All rights reserved."
},
"fake_ui": {
"error_fsapi_not_supported": "This browser doesnt support the File System Access API.",
"error_no_directory_selected": "No directory selected.",
"error_no_space_detected": "Couldnt reserve free space in the selected directory.",
"log_capacity_probe_start": "Measuring available storage in the selected directory...",
"log_capacity_probe_result": "Detected usable space for tests: {size} (write probe).",
"log_quick_prepare": "Quick check: preparing... (test size: {size})",
"log_quick_verify_start": "Quick check: writing done. Verifying data...",
"log_quick_data_error": "Quick check: data error at byte {byte}.",
"error_quick_data_error": "Data error in the quick check at byte {byte}.",
"log_quick_delete_warn": "Quick check: couldnt delete test file (not critical).",
"log_quick_success": "Quick check completed successfully.",
"log_bench_start": "Benchmark: starting writing test file ({size})...",
"log_bench_read_start": "Benchmark: reading & timing...",
"log_bench_delete_warn": "Benchmark: couldnt delete test file (not critical).",
"log_bench_success": "Benchmark finished successfully.",
"log_wv_start": "Write/Verify: starting {blocks} blocks of {size} (total {total})...",
"log_wv_block_start": "Write/Verify: block {num}/{blocks} {file}",
"log_wv_data_error": "Write/Verify: data error in block {num} at byte {byte}.",
"error_wv_data_error": "Data error in block {num} at byte {byte}.",
"log_wv_delete_warn": "Write/Verify: couldnt delete block file {file} (not critical).",
"log_wv_success": "Write/Verify: all blocks verified successfully.",
"log_all_subtest_start": "All-inclusive: starting subtest \"{mode}\" ({num}/{total})...",
"error_unknown_mode": "Unknown mode: {mode}",
"log_fsapi_partial": "Your browser only partially supports the File System Access API. Some features are disabled.",
"selected_path_label": "USB folder selected (name: \"{name}\").",
"selected_path_none": "No directory selected yet.",
"status_ready": "Ready. Select your USB drive first.",
"status_mode_none": "No mode selected",
"status_dir_selected": "USB directory selected. Choose a test mode next.",
"status_mode_selected": "Mode \"{mode}\" selected. You can start the test now.",
"status_running": "Test running... please do not remove the USB drive.",
"status_done": "Test completed.",
"status_aborted": "Test was canceled.",
"status_error": "Error: {msg}",
"status_error_unknown": "Unknown error in the test.",
"overall_initial": "No test has been run yet.",
"overall_running": "Test running...",
"overall_done": "Browser test completed successfully.",
"overall_aborted": "Test canceled.",
"overall_error": "Browser test error.",
"log_dir_selected": "Directory selected: {name}",
"log_dir_reset": "Directory selection reset.",
"log_pick_abort": "Directory selection canceled.",
"log_pick_error": "Error while selecting directory: {msg}",
"log_pick_error_unknown": "Unknown error while selecting directory.",
"log_mode_selected": "Mode selected: {mode}",
"log_test_start": "Starting tests in mode: {mode}",
"log_test_aborted": "Test was canceled by the user.",
"log_test_error": "Error during the test: {msg}",
"log_test_error_unknown": "Unknown error during the test.",
"log_loaded": "USB browser test (fakecheck) loaded. Waiting for directory selection and mode.",
"mode_quick": "Quick check",
"mode_benchmark": "Benchmark",
"mode_writeverify": "Write & Verify",
"mode_all": "All-inclusive (all browser tests)",
"log_backend_save_error_status": "Backend: couldnt save result ({status}).",
"log_backend_save_ok": "Backend: test result saved{suffix}.",
"log_backend_save_error": "Error while saving to the backend: {msg}"
},
"serial": {
"rating_label": "Rating",
"rating": {
"ok": {
"label": "Plausible",
"desc": "No obvious anomalies detected."
},
"needs_review": {
"label": "Needs review",
"desc": "Minor anomalies. Combine with a technical test for a clearer picture."
},
"suspicious": {
"label": "Suspicious",
"desc": "Significant anomalies detected. A capacity or write/read test is strongly recommended."
},
"invalid": {
"label": "Invalid",
"desc": "The serial number couldnt be evaluated."
},
"unknown": {
"label": "Unclear",
"desc": "No clear assessment possible."
}
},
"heading_input": "Input data",
"heading_analysis": "Serial number analysis",
"heading_consistency": "Manufacturer consistency",
"input": {
"manufacturer": "Manufacturer (user entry):",
"vidpid": "VID/PID:",
"vendor_detected": "Vendor from VID:"
},
"analysis": {
"serial": "Serial number:",
"length": "Length:",
"category": "Category:",
"score": "Score:",
"issues": "Irregularities:"
},
"chars": "characters",
"none": "not provided",
"issues_none": "No notable irregularities.",
"vendor_detected": "{vendor} (VID {vid})",
"vendor_unknown": "Unknown manufacturer for VID {vid}",
"vendor_none": "No vendor ID provided",
"disclaimer": "This assessment is based on heuristics and cannot guarantee authenticity.",
"error": {
"no_serial": "Please enter a serial number.",
"api": "Error during the check: {msg}",
"unknown": "Unexpected response from the server."
}
},
"pages": {
"landing": {
"meta": {
"title": "{{primary_domain}} Test USB drives for fakes",
"description": "USBCheck combines a quick browser check with a professional Pro mode so you can spot fake drives, missing capacity and sluggish controllers before your files disappear."
},
"sections": {
"hero": {
"kicker": "Spot fake USB drives before you lose data",
"title": "Is my USB drive a fake?",
"lead": "USBCheck combines a quick browser check with a professional Pro mode so you can spot fake drives, missing capacity and sluggish controllers before your files disappear.",
"cta_quick": "Start the free quick check",
"cta_learn": "More about Free &amp; Pro"
},
"trust": {
"t1_title": "No install for quick check",
"t1_text": "Browser-based test directly on your drive.",
"t2_title": "Real write &amp; read tests",
"t2_text": "Write/read tests with real data no synthetic benchmarks.",
"t3_title": "Privacy first",
"t3_text": "Your test data stays local upload reports only if you want."
},
"quick": {
"label": "Quick check preview",
"title": "Test a USB drive in under 2 minutes",
"badge_free": "Free",
"intro": "The quick check writes a defined data set on your drive and measures:",
"li1": "Write and read speed",
"li2": "Data integrity (hash comparison)",
"li3": "Suspicious aborts or errors",
"metric1_label": "Write performance",
"metric1_value": "~ 75120 MB/s*",
"metric2_label": "Integrity check",
"metric2_value": "512 MB of test data",
"footnote": "*Example values your results depend on drive, port &amp; system.",
"cta": "Go to the free quick check",
"visual_title": "Quick check display",
"visual_text": "This is the quick check preview: green marks stable data, orange warns when write speed drops.",
"visual_window": "Result window"
},
"how": {
"kicker": "How USBCheck works",
"title": "Quick check in the browser, Pro mode with deep analysis.",
"intro": "USBCheck was designed to combine two worlds: an easy quick check for everyone and an in-depth Pro mode for power users, technicians and admins. The quick check runs right in the browser with no install. The Pro mode uses a helper tool that can perform F3/badblocks-style scans to unmask capacity fakes.",
"step1_title": "Start the browser test",
"step1_text": "Open the quick check at <strong>{{primary_url}}/fakecheck/</strong>, select your USB drive or a folder on it and define how much data should be tested.",
"step2_title": "Write, read and integrity test",
"step2_text": "The browser creates test files, measures write/read speed and compares hashes to detect data errors everything locally without uploading your content.",
"step3_title": "Optional: Pro mode for full scan",
"step3_text": "If you need more detail, install the optional helper tool. It can test the entire capacity, spot fakes and generate detailed reports ideal for refurbishers, IT teams or labs.",
"side_title": "Free vs. Pro at a glance",
"side_free": "<strong>Free quick check:</strong> Browser speed &amp; integrity test ideal for quick assessments.",
"side_pro": "<strong>Pro mode:</strong> Deep scan, capacity validation, extended reports and API integration for businesses.",
"side_account": "<strong>Account &amp; login:</strong> After logging in you can save tests, export reports and manage multiple devices."
},
"problem": {
"kicker": "Why fake USB drives are risky",
"title": "Fake drives cost money and worst case your data.",
"p1": "Many cheap drives advertise unrealistic capacity. Controllers are manipulated: a stick claims 256 GB even though only 32 GB are physically present. Files appear to copy fine but later get silently overwritten or corrupted.",
"p2": "USBCheck helps you spot these fakes before you rely on them whether you use drives privately or check larger batches for your company.",
"card1_title": "Loss of important files",
"card1_text": "Photos, project files, backups everything is at risk when the drive stores less than promised. Defective sectors often stay unnoticed until its too late.",
"card2_title": "Costs from bad batches",
"card2_text": "Businesses, resellers and agencies hand out drives in volume. Fakes mean complaints, reputation damage and re-production costs.",
"card3_title": "Unreliable performance",
"card3_text": "Slow controllers, unstable firmware and fluctuating write speeds are typical for fake drives. That raises the risk of errors especially with large files."
},
"features": {
"kicker": "Free &amp; Pro features",
"title": "Start with the free quick check switch to Pro when you need more.",
"intro": "USBCheck grows with your needs: private users usually just need a quick verdict. Pros want full insight, verify capacity and archive reports. Thats what Pro mode is for.",
"free_title": "Free quick check",
"free_badge": "Recommended for most users",
"free_text": "Perfect for anyone who wants to see if a drive runs decently fast and stable without installing anything.",
"free_li1": "• Browser-based quick check directly on your drive",
"free_li2": "• Write/read speed with real test data",
"free_li3": "• Hash-based integrity check of a sample size",
"free_li4": "• Pick from different test levels (e.g. 200 MB, 2 GB)",
"free_li5": "• No registration required",
"free_cta": "Start free quick check",
"pro_title": "Pro mode",
"pro_badge": "For power users &amp; teams",
"pro_text": "For IT departments, technicians, refurbishers or companies testing larger volumes who need full control.",
"pro_li1": "• Deep scan of the entire capacity (similar to F3/badblocks)",
"pro_li2": "• Detects capacity fakes and defective areas",
"pro_li3": "• Detailed, savable test reports (JSON, PDF)",
"pro_li4": "• Optional API access for automated workflows",
"pro_li5": "• Multi-device and multi-user support via the login area",
"pro_note": "Pro mode requires a small helper tool on your system. It runs locally and can link with your USBCheck account if needed."
},
"security": {
"kicker": "Security &amp; privacy",
"title": "Privacy-first design: your test data belongs to you.",
"intro": "USBCheck was built so your data stays protected. The browser quick check only uses test files. Your own documents, photos or backups are neither read nor uploaded. In Pro mode you decide if and which reports sync with your account.",
"card1_title": "Local-only tests",
"card1_text": "All write/read tests happen locally on your drive. The browser only touches the test files not your personal content.",
"card2_title": "Transparent reports",
"card2_text": "If you log in you can store reports in your account, export them or delete them again. You decide what stays in the system.",
"card3_title": "Gentle on your hardware",
"card3_text": "The quick check uses moderate data sizes to avoid unnecessary wear. Pro mode clearly warns when a full, write-heavy scan is triggered."
},
"faq": {
"kicker": "FAQ",
"title": "Frequently asked questions about USBCheck",
"intro": "Here are answers to common questions. Expand the FAQ any time when new use cases appear or you receive user feedback.",
"q1": "Is the quick check completely in the browser?",
"a1": "Yes. The quick check runs fully inside the browser and uses modern APIs to write and read test files on your drive. Nothing is uploaded without your consent.",
"q2": "Do I need an account to use the quick check?",
"a2": "No. The free quick check works without registration. Login is only needed if you want to save reports, manage multiple drives or use Pro mode.",
"q3": "Can USBCheck reliably detect every fake drive?",
"a3": "No tool can promise 100%. The Pro mode with full scan is built to detect the typical manipulation patterns (reported capacity vs. physical, unstable zones, errors after certain fill levels) very reliably.",
"q4": "How does the tool fit into my workflow?",
"a4": "USBCheck is designed for automation. Via Pro mode and the planned API you can integrate tests into existing workflows e.g. incoming goods checks or QA."
}
}
},
"fakecheck": {
"meta": {
"title": "FakeCheck Browser test for USB drives",
"description": "FakeCheck helps you uncover typical fake drives: browser-based write/read tests and plausibility checks of usable capacity no install required."
},
"sections": {
"hero": {
"kicker": "FakeCheck browser mode",
"title": "Is my USB drive fake?",
"lead": "FakeCheck helps you uncover typical fake drives: browser-based write/read tests and capacity plausibility checks without installation.",
"cta_start": "Start browser test (demo)",
"cta_back_home": "Back to overview",
"hint": "The FakeCheck browser mode works with test files and read/write patterns that you create in a selected folder. Your real files stay untouched."
},
"capabilities": {
"title": "What the browser test can do",
"point1_title": "Write/read test with test files",
"point1_text": "The browser creates test files in the selected folder, measures write/read speeds and checks whether read data matches the written patterns.",
"point2_title": "Capacity plausibility check",
"point2_text": "The amount of data written and verified gives you a realistic idea of how much usable capacity is actually stable.",
"point3_title": "JSON report for documentation",
"point3_text": "All results go into a structured JSON report you can save, upload or reuse later."
},
"app": {
"title": "Browser test interface (preview)",
"intro": "Heres where the FakeCheck web app will live: pick a folder, configure the test amount, see progress and the result panel. For now the button above shows a demo output.",
"point1": "Quick test with a small data set.",
"point2": "Light benchmark: write/read speed over a limited time.",
"point3": "Write/Verify: write test files and immediately verify them."
},
"result": {
"title": "Demo output of the browser test",
"hint": "This output is just a preview. Later the real JSON report from the browser test will appear here."
}
}
},
"login": {
"meta": {
"title": "Login {{primary_domain}}",
"description": "Sign in to {{primary_domain}} to save tests, use Pro mode and manage multiple devices."
},
"sections": {
"auth": {
"kicker": "Account &amp; login",
"title": "Sign in to USBCheck",
"intro": "With an account you can save tests, export reports and use Pro mode across multiple devices. Registration is free upgrade to Pro later any time.",
"tab_login": "Login",
"tab_register": "Register",
"login_title": "Login",
"login_text": "Sign in with your email address and password.",
"login_email_label": "Email address",
"login_password_label": "Password",
"login_submit": "Sign in",
"login_forgot": "Forgot password?",
"register_title": "Register for free",
"register_text": "Create a free account to save tests, export reports and unlock Pro mode later.",
"register_name_label": "Name",
"register_email_label": "Email address",
"register_password_label": "Password",
"register_submit": "Create account",
"register_hint": "By registering you accept the privacy policy and legal notice of USBCheck."
}
}
},
"dashboard": {
"meta": {
"title": "Dashboard {{primary_domain}}",
"description": "Manage your USB tests, devices and Pro mode settings in your personal dashboard."
},
"sections": {
"main": {
"kicker": "Dashboard",
"title": "Welcome",
"intro": "Manage your USB tests, keep devices organized and soon enable Pro mode. This area is still under construction but you already get a first glimpse.",
"plan_label": "Current plan",
"card_tests_title": "Latest tests",
"card_tests_text": "Your latest quick checks and Pro scans will appear here including status, speed and integrity info.",
"card_tests_empty": "No test data yet. Start your first test via the browser or Pro mode.",
"card_devices_title": "Your USB devices",
"card_devices_text": "Soon youll manage tested drives here: manufacturer, model, serial number and detected capacity.",
"card_devices_empty": "No devices stored yet. After your first tests you can add USB drives here.",
"card_next_title": "Next steps",
"card_next_text": "USBCheck is still evolving. Youre among the first users later youll find Pro options, API access and detailed reports here.",
"card_next_item1": "• Try the browser FakeCheck and share feedback",
"card_next_item2": "• Define Pro mode features (e.g. full scan, reports, API)",
"card_next_item3": "• Finalize accounts &amp; SSO (my-log.in)",
"card_next_cta": "Go to browser FakeCheck"
}
}
}
}
}

View File

@@ -2,7 +2,8 @@
"meta": { "meta": {
"code": "es", "code": "es",
"label": "Español", "label": "Español",
"flag": "🇪🇸" "flag": "🇪🇸",
"enabled": true
}, },
"header": { "header": {

View File

@@ -2,7 +2,8 @@
"meta": { "meta": {
"code": "fr", "code": "fr",
"label": "Français", "label": "Français",
"flag": "🇫🇷" "flag": "🇫🇷",
"enabled": true
}, },
"header": { "header": {

View File

@@ -2,7 +2,8 @@
"meta": { "meta": {
"code": "it", "code": "it",
"label": "Italiano", "label": "Italiano",
"flag": "🇮🇹" "flag": "🇮🇹",
"enabled": true
}, },
"header": { "header": {

View File

@@ -2,7 +2,8 @@
"meta": { "meta": {
"code": "us", "code": "us",
"label": "English (US)", "label": "English (US)",
"flag": "🇺🇸" "flag": "🇺🇸",
"enabled": true
}, },
"header": { "header": {

View File

@@ -1,5 +1,4 @@
<?php <?php
echo "blub";
$GLOBALS['page_header_scripts'] = $GLOBALS['page_header_scripts'] ?? []; $GLOBALS['page_header_scripts'] = $GLOBALS['page_header_scripts'] ?? [];
$GLOBALS['page_footer_scripts'] = $GLOBALS['page_footer_scripts'] ?? []; $GLOBALS['page_footer_scripts'] = $GLOBALS['page_footer_scripts'] ?? [];
$GLOBALS['page_styles'] = $GLOBALS['page_styles'] ?? []; $GLOBALS['page_styles'] = $GLOBALS['page_styles'] ?? [];