"""VoxCast UI strings: English (source of truth and fallback).

Rules for every language table in this package:
* Keys and {placeholders} must match en.py exactly (enforced by test_i18n).
* No em-dash in values (user-visible text) - use comma/colon/parentheses.
* User content (custom mode names, typed text) is never translated.
"""

STRINGS: dict[str, str] = {
    # ── Panel (main.qml) ────────────────────────────────────────────────
    "panel_ready": "Ready",
    "panel_transcribing": "Transcribing...",
    "panel_correcting": "Correcting...",
    "panel_enhancing": "Enhancing (AI)…",
    "panel_converting": "Converting...",
    "panel_error": "Error",
    "panel_drop_file": "Drop file → Markdown",
    "panel_acc_ai_mode": "AI mode",
    "panel_acc_settings": "Settings",
    "panel_acc_undock": "Undock",
    "panel_acc_hide": "Hide",

    # ── Settings window ─────────────────────────────────────────────────
    "settings_title": "Settings",
    "sec_interface": "INTERFACE",
    "row_ui_language": "Language",
    "sec_audio": "AUDIO",
    "row_microphone": "Microphone",
    "opt_system_default": "System Default",
    "row_voice_test": "Voice Test",
    "btn_test": "Test",
    "btn_stop": "Stop",
    "btn_play": "Play",
    "sec_recognition": "RECOGNITION",
    "row_model": "Model",
    "model_swift": "Swift",
    "model_precise": "Precise",
    "model_ultra": "Ultra",
    "hint_model_swift": "Fast & light, the right choice for laptops and PCs without a graphics card.",
    "hint_model_precise": "Balanced accuracy, solid everyday choice, runs well on most PCs.",
    "hint_model_ultra": "Highest accuracy, ideal with a graphics card (4 GB); noticeably slower without one.",
    "compat_gpu_ok": "Will run on your graphics card ({vram} GB).",
    "compat_gpu_low": "Your graphics card ({vram} GB) has too little memory for this model, it will run on the processor (slower).",
    "compat_cpu": "No compatible graphics card detected, this model will run on the processor.",
    "compat_cpu_forced": "Will run on the processor (set in settings).",
    "row_language": "Language",
    "row_lang_auto": "Auto-detect language",
    "hint_lang_auto": "Detects the language on every dictation. A fixed language is faster and more accurate.",
    "row_live_mode": "Live transcription",
    "hint_live_mode": "Text appears at your cursor while you speak, instead of after you stop. No AI enhancement in this mode; text is typed at the cursor.",
    "hint_output_live": "Live transcription is on: text is typed at the cursor while you speak, so these output options do not apply.",
    "hint_live_cpu": "Works best with a graphics card; on the processor it may lag behind your speech.",
    "live_cpu_warning": "Live mode runs on the processor and may lag; a graphics card is recommended.",
    "sec_output": "OUTPUT",
    "row_text_output": "Text Output",
    "opt_clipboard": "Clipboard",
    "opt_type_at_cursor": "Type at Cursor",
    "opt_both": "Both",
    "row_insert_method": "Insert Method",
    "opt_paste": "Paste (Ctrl+V)",
    "opt_typing": "Typing",
    "hint_typing": "Simulates keyboard input. Works in terminals.",
    "sec_controls": "CONTROLS",
    "row_hotkey": "Hotkey",
    "row_mode": "Mode",
    "opt_hold": "Hold",
    "opt_toggle": "Toggle",
    "sec_performance": "PERFORMANCE",
    "row_compute": "Compute",
    "opt_auto": "Auto",
    "opt_gpu": "GPU (CUDA)",
    "opt_cpu": "CPU",
    "hint_cpu_slow": "CPU mode is slower.",
    "sec_system": "SYSTEM",
    "row_autostart": "Autostart",
    "row_startup_sound": "Startup Sound",
    "row_recording_sound": "Recording Sound",
    "row_shutdown_sound": "Shutdown Sound",
    "row_always_on_top": "Always on Top",
    "row_small_panel": "Small Panel",
    "sec_file_conversion": "FILE CONVERSION",
    "row_save_mode": "Save Mode",
    "opt_ask": "Ask",
    "opt_beside_file": "Beside file",
    "opt_folder": "Folder",
    "row_folder": "Folder",
    "btn_browse": "Browse",
    "row_timestamps": "Timestamps",
    "row_open_after": "Open After",
    "row_context_menu": "Right-click Menu",
    "hint_context_menu": "Adds 'Convert to Markdown' to Explorer's right-click menu.",
    "sec_ai": "AI ENHANCEMENT",
    "row_enable": "Enable",
    "hint_ai": "Polish dictations with AI (clean up, e-mail, reply…). Pick the active mode by right-clicking the panel or via the panel's AI button.",
    "row_provider": "Provider",
    "row_api_key": "API Key",
    "ph_api_key": "Paste API key",
    "ph_api_key_saved": "•••••••• saved, type to replace",
    "btn_save": "Save",
    "hint_key_stored": "Key stored securely in Windows Credential Manager.",
    "btn_clear": "Clear",
    "btn_load": "Load",
    "btn_loading": "Loading",
    "row_active_mode": "Active Mode",
    "mode_normal": "Normal (no AI)",
    # Display names of the built-in AI modes (shown while the user hasn't
    # renamed them; the stored name stays the English default).
    "mode_cleanup": "Clean up",
    "mode_email": "E-Mail",
    "mode_reply": "Reply",
    "mode_todo": "To-do list",
    "mode_notes": "Notes",
    "mode_formal": "Formal",
    "lbl_custom_modes": "Custom Modes",
    "sec_license": "LICENSE",
    "row_status": "Status",
    "lic_activated": "● Activated",
    "lic_not_activated": "○ Not activated",
    "btn_activate": "Activate",
    "sec_updates": "UPDATES",
    "row_version": "Version",
    "btn_check_updates": "Check for updates",
    "btn_checking": "Checking",
    "btn_downloading_pct": "{pct}%  downloading…",
    "btn_download_install": "Download & Install v{version}",
    "btn_reset": "Reset",
    "reset_title": "Reset Settings",
    "reset_question": "Reset all settings to defaults?",
    "dlg_model_dl_title": "Download required",
    "dlg_model_dl_text": "The selected model is not installed yet. VoxCast will download about {size} of language data and switch afterwards. Start the download now?",

    # ── Mode editor ─────────────────────────────────────────────────────
    "ph_mode_name": "Mode name",
    "tip_remove_mode": "Remove mode",
    "ph_system_prompt": "System prompt, tells the AI how to transform the transcript.",
    "btn_add_mode": "Add mode",
    "mode_new": "New Mode",

    # ── Mode menu (panel) ───────────────────────────────────────────────
    "menu_ai_mode": "AI MODE",
    "menu_ai_mode_off": "AI MODE  ·  OFF",
    "menu_ai_settings": "Settings…",
    "menu_copy_raw": "Copy original transcript",
    "tray_raw_copied": "The original transcript was copied to the clipboard.",

    # ── Activation overlay ──────────────────────────────────────────────
    "act_title": "Activate VoxCast",
    "act_intro": "Enter your license key to activate this device. Activation is a one-time online step, afterwards VoxCast works fully offline.",
    "act_enter_key": "Please enter your license key.",
    "act_button": "Activate",
    "act_button_busy": "Activating…",
    "act_update_available": "Version {version} is available.",
    "act_update_now": "Update now",
    "act_device": "Device: ",
    "act_quit": "Quit",

    # ── First-run overlay ───────────────────────────────────────────────
    "fr_title": "VoxCast Setup",
    "fr_pick_language": "Select your language for speech recognition.\nThis avoids slow auto-detection on every use.",
    "fr_continue": "Continue",
    "fr_preparing": "Preparing models...",
    "fr_hint_label": "Tip:",
    "status_hw_check": "Checking hardware...",
    "fr_hw_gpu": "Graphics card detected ({vram} GB): the {model} model will be set up.",
    "fr_hw_cpu": "No dedicated graphics card detected: the {model} model will be set up.",
    "fr_hint_download": "Models download once and stay on your device, no cloud needed.",
    "fr_hint_hotkey": "Press Ctrl+Shift+Space to start dictating, press again to stop.",
    "fr_hint_ai": "Right-click the panel to pick an AI mode (e.g. E-Mail, Reply).",
    "fr_hint_dragfile": "Drag a file onto the panel to turn it into Markdown.",
    "fr_hint_audio": "Drop an audio file (mp3, ogg, m4a…) to transcribe it.",
    "fr_hint_explorer": "In Explorer, right-click a file → “Convert to Markdown”.",
    "fr_hint_dock": "Dock the panel to a screen edge, it slides away until needed.",
    "fr_hint_settings": "Open Settings to change model, language or hotkey anytime.",

    # ── Status messages (Python → panel) ────────────────────────────────
    "status_init_services": "Initializing services...",
    "status_loading_vad": "Loading voice activity detection...",
    "status_loading_model": "Loading speech recognition model...",
    "status_init_models": "Initializing models...",
    "status_loading": "Loading model...",
    "status_switching_model": "Switching model...",
    "status_downloading_engine": "Downloading speech recognition engine...",
    "status_engine_ready": "Speech recognition engine ready",
    "status_downloading_correction": "Downloading correction model...",
    "status_correction_ready": "Correction model downloaded",

    # ── Meeting recording ────────────────────────────────────────────────
    "menu_meeting_start": "Record meeting",
    "menu_meeting_stop": "Stop meeting recording",
    "meeting_consent_title": "Record meetings",
    "meeting_consent_body": "VoxCast records the system audio and your microphone so you can transcribe calls and meetings.\n\nPlease make sure all participants agree to being recorded, in many countries (including Germany) recording a call without consent is a criminal offence.",
    "meeting_consent_accept": "Got it, start recording",
    "meeting_consent_cancel": "Cancel",
    "status_meeting_recording": "Recording meeting",
    "status_meeting_transcribing": "Transcribing meeting… {pct}%",
    "meeting_done_title": "Meeting transcribed",
    "meeting_done_body": "The transcript has been saved, click here to open it.",
    "meeting_resume_note": "An unfinished meeting recording was found, transcribing it now.",
    "menu_meeting_folder": "Open meetings folder",
    "meeting_source_title": "What to record?",
    "meeting_source_system": "Whole system",
    "meeting_source_empty": "No app is playing audio right now",
    "meeting_app_fallback": "App-only capture could not start, recording the whole system instead.",
    "md_meeting_source": "Source",
    "meeting_partial_note": "The recording ended early, the partial recording was still processed.",
    "meeting_system_silent": "No system audio was captured, check your playback device. Some headsets play audio in a way Windows cannot record; switching the default output device helps.",
    "meeting_summary_failed": "AI summary failed, the transcript was saved without it.",
    "err_meeting_folder": "The meetings folder could not be created. Check the folder in Settings.",
    "err_meeting_disk": "Not enough free disk space, meeting recording stopped.",
    "err_meeting_maxlen": "Maximum meeting length reached (4 h), recording stopped.",
    "err_meeting_capture": "Meeting recording failed, no audio could be captured.",
    "err_meeting_transcribe": "Meeting transcription failed. The audio file was kept so you can retry.",
    "md_meeting_title": "Meeting",
    "md_meeting_date": "Date",
    "md_meeting_duration": "Duration",
    "md_meeting_summary": "Summary",
    "md_meeting_transcript": "Transcript",
    "sec_remote": "Remote Server",
    "row_remote_enable": "Use remote server",
    "hint_remote": "Run transcription on another computer with a stronger GPU or CPU. Dictation, file conversion and meetings are processed on the server.",
    "hint_recognition_remote": "The remote server handles recognition, so the local model below is disabled. Choose the model on the server.",
    "row_remote_url": "Server address",
    "ph_remote_url": "http://192.168.1.10:8590",
    "row_remote_key": "API key",
    "ph_remote_key": "Paste the server's API key",
    "btn_remote_test": "Test connection",
    "remote_testing": "Testing...",
    "btn_remote_discover": "Find server",
    "remote_discovering": "Searching...",
    "remote_discover_none": "No server found. Make sure the server is running, both devices are on the same network, and the server's firewall allows VoxCast Server on the local network.",
    "remote_enhance_available": "AI enhancement available",
    "remote_update_available": "Server update available: {version}",
    "row_tls_mode": "Certificate",
    "tls_verify": "Require a valid certificate",
    "tls_pinned": "Trust this server",
    "tls_insecure": "Allow any certificate",
    "btn_trust_cert": "Check certificate",
    "tls_trust_title": "Trust this server?",
    "tls_trust_body": "The server presented this certificate fingerprint. Confirm it matches your server before trusting it.",
    "tls_trust_confirm": "Trust",
    "tls_trust_failed": "Could not read the server's certificate. Check the address and that HTTPS is enabled.",
    "tls_insecure_warning": "The connection is not verified. Only use this on a network you trust.",
    "row_enhance_source": "AI enhancement",
    "enhance_own": "My own API key",
    "enhance_server": "Use the server",
    "hint_enhance_server": "The server enhances with its own AI key, so you do not need to enter one here.",
    "lbl_server_modes": "Company modes (from the server)",
    "managed_locked": "Managed by your organization",
    "remote_http_warn": "This connection is not encrypted. Use it only on a trusted local network.",
    "remote_live_hint": "Live captions run on this device; they need a model installed locally.",
    "remote_connected": "Connected: {model} on {where}",
    "remote_on_gpu": "GPU ({vram} GB)",
    "remote_on_cpu": "CPU",
    "err_remote_unreachable": "The remote server could not be reached. Check the address and your network.",
    "err_remote_auth": "The remote server rejected the API key.",
    "err_remote_busy": "The remote server is busy. Please try again in a moment.",
    "err_remote_failed": "The remote server could not process this audio.",
    "sec_meeting": "MEETING",
    "row_meeting_mic": "Record microphone",
    "hint_meeting_mic": "Also captures your own voice, not just the other participants.",
    "row_meeting_language": "Language",
    "lang_meeting_auto": "Auto-detect",
    "row_convert_language": "Audio language",
    "lang_convert_auto": "Auto-detect",
    "err_convert_engine_loading": "The speech engine is still loading. Please try the conversion again in a moment.",
    "err_convert_no_speech": "No speech could be recognized in this file. No Markdown file was created.",
    "err_convert_engine_error": "The speech engine reported an error while transcribing.",
    "tray_convert_failed": "Could not convert {name}: {error}",
    "hint_meeting_language": "Auto-detect handles meetings in any language, even when it changes mid-call. Pick a language only if detection struggles.",
    "row_meeting_keep": "Keep audio file",
    "hint_meeting_keep": "Saves the recording as a .wav file next to the transcript.",
    "row_meeting_summary": "AI summary",
    "hint_meeting_summary": "Adds an AI-generated summary on top of the transcript (requires AI enhancement to be set up).",
    "hint_meeting_summary_nokey": "AI enhancement is not set up, summaries will be skipped.",
    "row_meeting_folder": "Save to",
    "meeting_folder_default": "Documents\\VoxCast\\Meetings",
    "btn_open": "Open",

    # ── Errors / tray (Python) ──────────────────────────────────────────
    "err_audio_lib": "Audio library not available",
    "err_gpu_oom": "GPU out of memory. Restart with CPU mode.",
    "err_gpu_fallback": "Graphics card not available, running on the processor (slower).",
    "err_hotkey_init": "Hotkey system not initialized",
    "err_mic": "Microphone error. Check your audio device.",
    "err_mic_test_busy": "A recording is already running. Stop it before testing the microphone.",
    "err_model_switch": "Model switch failed. Please try again.",
    "err_model_download": "Speech model download failed. Check your internet connection.",
    "err_speech_start": "Speech recognition could not be started.",
    "err_transcription": "Transcription failed. Please try again.",
    "err_model_missing": "Speech model not found. Please select a model in Settings.",
    "tray_cpu_fallback": "No compatible GPU found. Running on CPU.\nTranscription will be slower than with GPU acceleration.",
    "tray_cpu_configured": "Running on CPU as configured in settings.",
    "tray_cpu_detected": "No compatible GPU detected. Running on CPU.\nFor faster transcription, a CUDA-compatible GPU is recommended.",
    "tray_file_not_found": "File not found.",
    "tray_no_supported_files": "No supported files to convert.",
    "tray_still_starting": "VoxCast is still starting, try again.",
    "tray_no_output_folder": "Output folder not set, choose where to save.",
    "tray_context_menu_failed": "Could not update the right-click menu.",
    "tray_need_api_key": "Enter and save an API key first.",
    "tray_models_load_failed": "Could not load models.",
    "tray_show_hide": "Show/Hide",

    # ── License (Python user messages) ──────────────────────────────────
    "lic_enter_key": "Please enter your license key.",
    "lic_saved_failed": "Activated, but the license could not be saved on this PC.",
    "lic_success": "VoxCast activated. Thank you!",
    "lic_check_failed": "Activation failed. Please check your key.",
    "lic_no_server": "Could not reach the activation server. Check your internet connection.",
    "lic_unexpected": "Activation failed unexpectedly. Please try again.",

    # ── Updates (Python user messages) ──────────────────────────────────
    "upd_checking": "Checking for updates…",
    "upd_latest": "You're on the latest version.",
    "upd_available": "Version {version} is available.",
    "upd_dialog_title": "Update available",
    "upd_whats_new": "What's new",
    "upd_required": "Required",
    "upd_no_notes": "General improvements and fixes.",
    "upd_later": "Later",
    "upd_install_now": "Download & install",
    "upd_install_note": "The update replaces your current version automatically, nothing else to do.",
    "upd_downloading": "Downloading version {version}…",
    "upd_failed": "Update failed. Please try again.",
    "upd_starting_installer": "Starting installer…",
    "upd_installer_failed": "Could not start the installer.",
    "upd_err_filename": "Unexpected installer filename in update manifest.",
    "upd_err_https": "Update download must use HTTPS.",
    "upd_err_response": "Update server returned an invalid response.",
    "upd_err_no_url": "No download URL provided.",
    "upd_err_no_checksum": "Update manifest is missing a checksum. Aborted.",
    "upd_err_redirect": "Update server returned an unexpected redirect.",
    "upd_err_integrity": "Downloaded file failed integrity check. Aborted.",
    "upd_err_check": "Could not check for updates: {error}",
    "upd_err_download": "Download failed: {error}",
    "upd_err_save": "Could not save the update: {error}",
    "upd_err_host": "Refusing update download from untrusted host '{host}'.",

    # ── LLM (user messages) ─────────────────────────────────────────────
    # ── Late additions (review sweep) ───────────────────────────────────
    "act_first": "Please activate VoxCast first.",
    "llm_enhance_failed": "AI enhancement failed: {error}",
    "llm_truncated": "The AI response was cut off, the original transcript was used instead.",
    "llm_mode_needs_key": "AI mode selected, add an API key in Settings to activate enhancement.",
    "tt_recording": "Recording...",
    "tray_saved": "Saved: {name}",
    "tray_converted": "Converted {n} files to Markdown.",
    "hk_press_key": "Press a key...",
    "hk_acc_record": "Press keys for hotkey",
    "no_folder": "No folder selected",
    "llm_load_models_ph": "Load models →",

    "llm_no_key": "No API key provided.",
    "llm_no_key_configured": "No API key configured.",
    "llm_bad_key": "Invalid or unauthorized API key.",
    "llm_rate_limit": "Rate limit reached. Please try again shortly.",
    "llm_provider_down": "The AI provider is temporarily unavailable.",
    "llm_request_failed": "Request failed ({code}).",
    "llm_network": "Network error: {error}",
    "llm_no_model": "No usable AI model found for this API key.",
}
