"""Chinese translations for docscan_gui."""

TRANSLATIONS = {
    # Window and Tab Titles
    "window_title": "文档扫描器",
    "input_config_tab": "输入配置",
    "scan_options_tab": "扫描选项",
    # Input Section
    "input_directory": "输入目录:",
    "browse": "浏览...",
    "rules_file": "规则文件:",
    "file_types": "文件类型:",
    # Options Section
    "use_pdf_ocr": "使用 PDF OCR",
    "use_process_pool": "使用进程池 (CPU 密集型)",
    "threads": "线程数:",
    "batch_size": "批处理大小:",
    # Action Buttons
    "start_scan": "开始扫描",
    "pause": "暂停",
    "resume": "恢复",
    "stop": "停止",
    "save_results": "保存结果",
    "clear_results": "清除结果",
    # Results Section
    "results": "结果",
    "files_scanned": "已扫描文件:",
    "files_with_matches": "包含匹配项的文件:",
    "progress_log": "进度日志:",
    "match_details": "匹配详情:",
    "selected_match_context": "选中匹配项的上下文:",
    # Table Headers
    "file": "文件",
    "type": "类型",
    "matches": "匹配数",
    "time": "时间 (s)",
    # Dialogs and Messages
    "select_input_directory": "选择输入目录",
    "select_rules_file": "选择规则文件",
    "json_files": "JSON 文件 (*.json)",
    "save_results_dialog": "保存结果",
    "default_results_filename": "扫描结果_{datetime}.json",
    # Error Messages
    "error": "错误",
    "warning": "警告",
    "success": "成功",
    "invalid_input_directory": "无效的输入目录",
    "no_valid_rules": "没有找到有效的规则",
    "failed_to_load_rules": "加载规则失败: {error}",
    "no_results_to_save": "没有可保存的结果",
    "failed_to_save_results": "保存结果失败: {error}",
    "scan_failed": "扫描失败: {error}",
    # Progress Messages
    "starting_scan": "开始扫描...",
    "scan_complete": "扫描完成!",
    "pausing_scan": "暂停扫描...",
    "stopping_scan": "停止扫描...",
    "scan_completed": "扫描完成",
    "scan_stopped": "扫描已停止",
    "scan_resumed": "扫描已恢复",
    "found_matches_files": "在 {count} 个文件中找到匹配项",
    # File Info
    "file_info": "文件",
    "type_info": "类型",
    "size": "大小",
    "bytes": "字节",
    # Match Info
    "rule": "规则",
    "description": "描述",
    "line": "行 {line}: {match}",
    "context": "上下文",
    "default_file_types": "pdf,docx,xlsx,pptx,txt,odt,rtf,epub,csv,xml,html,md,jpg,jpeg,png,gif,bmp,tiff",
    "default_rules_file": "rules.json",
    # Menu Items
    "file_menu": "文件(&F)",
    "settings_menu": "设置(&S)",
    "help_menu": "帮助(&H)",
    "preferences": "首选项(&P)...",
    "exit": "退出(&X)",
    "about": "关于(&A)",
    "about_title": "关于文档扫描器",
    "about_text": "文档扫描器 GUI\n\n版本 1.0",
    "language": "语言",
    # Open Results
    "open_results": "打开结果...",
    "open_results_file": "打开扫描结果",
    "loaded_results_from": "已从以下位置加载结果: {path}",
    "results_loaded_successfully": "结果已成功从以下位置加载:\n{path}",
    "failed_to_load_results": "加载结果失败: {error}",
    # Settings Dialog
    "language_settings": "语言设置",
    "processing_options": "处理选项",
    "performance_settings": "性能设置",
    "language_label": "语言:",
    "ocr_tooltip": "为扫描的 PDF 文件启用 OCR 以从图像中提取文本",
    "process_pool_tooltip": "对 CPU 密集型操作使用多进程(可能会增加内存使用)",
    "threads_tooltip": "工作线程数量(较高的值可能会提高速度但会使用更多 CPU)",
    "batch_size_tooltip": "每批处理的文件数量(较大的批次可能会提高吞吐量)",
    "file_types_tooltip": "要扫描的文件类型(逗号分隔)",
    # Results Saved Message
    "results_saved_to": "结果已保存至:\t{path}",
    # Default Values
    "files_scanned_zero": "已扫描文件: 0",
    "files_with_matches_zero": "包含匹配项的文件: 0",
    # Apply Button
    "apply": "应用",
    # Command-line specific translations
    "document_scanner_description": "扫描文档并使用特定规则提取文本、图像和元数据。",
    "input_directory_help": "包含待扫描文档的输入目录",
    "rules_file_help": "规则文件 (JSON格式)",
    "recursive_help": "递归扫描文件",
    "file_types_help": "要扫描的文件类型(逗号分隔)",
    "use_pdf_ocr_help": "对基于图像的PDF文件使用OCR",
    "use_process_pool_help": "使用进程池而非线程池(更适合CPU密集型任务)",
    "batch_size_help": "每批次处理的文件数量",
    "threads_help": "并行扫描的线程数",
    "progress_help": "显示进度条",
    "verbose_help": "详细输出",
    "language_help": "设置语言(en表示英文, zh表示中文)",
    # Status and logging messages
    "scanning_directory": "正在扫描目录: {directory}",
    "found_files_to_scan": "发现 {count} 个文件待扫描",
    "scan_stopped_before_submitting_tasks": "用户在提交所有任务之前停止扫描",
    "scan_paused": "扫描已暂停",
    "scan_stopped_while_paused": "扫描在暂停状态下停止",
    "scan_stopped_by_user_canceling_tasks": "用户停止扫描, 正在取消剩余任务...",
    "task_timeout_scan_may_be_stopping": "任务超时, 扫描可能正在停止",
    "error_scanning_file": "扫描文件时出错: {error}",
    "progress_report": "进度: {processed}/{total} 文件已处理",
    "force_shutting_down_executor": "强制关闭执行器...",
    "scan_stopped_processed_files": "扫描已停止。已处理 {processed} 个文件",
    "scan_complete_found_matches": "扫描完成。在 {matches_count} 个文件中找到匹配项",
    "found_matches_in_file": "找到匹配项: {file_name}",
    "processed_file_info": "已处理 {file_name} ({ext}), 耗时 {time:.3f}秒 - 找到 {matches_count} 个匹配项",
    "could_not_extract_text_from_file": "无法从 {file_path} 提取文本: {error}",
    "pymupdf_failed_for_file": "{file_name} 的 PyMuPDF 失败: {error}",
    "pypdf_also_failed_for_file": "{file_name} 的 pypdf 也失败: {error}",
    "no_pdf_library_installed": "未安装PDF库 (pymupdf 或 pypdf)",
    "pymupdf_not_installed": "未安装 PyMuPDF",
    "no_pages_found_in_file": "在 {file_path} 中未找到页面",
    "no_metadata_found_in_file": "在 {file_path} 中未找到元数据",
    "pymupdf_error_trying_fallback": "PyMuPDF 在 {file_path} 上出错: {error}, 尝试使用 pypdf 回退",
    "pypdf_not_installed_skipping_extraction": "未安装 pypdf, 跳过PDF提取",
    "error_extracting_pdf_with_pypdf": "使用 pypdf 提取PDF时出错: {error}",
    "odfpy_not_installed_skipping_extraction": "未安装 odfpy, 跳过ODT提取",
    "error_extracting_odt": "提取ODT时出错: {error}",
    "error_extracting_rtf": "提取RTF时出错: {error}",
    "ebooklib_not_installed_skipping_extraction": "未安装 ebooklib, 跳过EPUB提取",
    "error_extracting_epub": "提取EPUB时出错: {error}",
    "error_extracting_csv": "提取CSV时出错: {error}",
    "error_extracting_xml": "提取XML时出错: {error}",
    "error_extracting_html": "提取HTML时出错: {error}",
    "error_extracting_markdown": "提取Markdown时出错: {error}",
    "python_docx_not_installed_skipping_extraction": "未安装 python-docx, 跳过DOCX提取",
    "openpyxl_not_installed_skipping_extraction": "未安装 openpyxl, 跳过XLSX提取",
    "python_pptx_not_installed_skipping_extraction": "未安装 python-pptx, 跳过PPTX提取",
    "pillow_or_tesseract_not_installed_skipping_ocr": "未安装 PIL 或 pytesseract, 跳过图像OCR",
    "could_not_perform_ocr_on_file": "无法对 {file_path} 执行OCR: {error}",
    "input_directory_does_not_exist": "输入目录不存在: {input_dir}",
    "using_rules_file": "使用规则文件: {rules_file}",
    "invalid_json_in_rules_file": "规则文件中的JSON无效: {error}",
    "invalid_rules_format": "无效的规则格式。期望包含'rules'键的列表或字典",
    "no_valid_rules_found": "未找到有效规则",
    "total_time_elapsed": "总耗时: {time:.2f}秒",
    "invalid_regex_pattern": "无效的正则表达式模式 '{pattern}': {error}",
    "rules_file_does_not_exist_alt": "规则文件不存在: {rules_file}",
    "image_files_supported": "支持的图像文件(需要OCR)",
    "include_image_formats": "包含图像格式",
    "include_image_formats_tooltip": "在扫描中包含图像格式(jpg, jpeg, png, gif, bmp, tiff)",
    # Tooltips and Status Messages
    "browse_directory_tooltip": "浏览选择输入目录",
    "browse_rules_tooltip": "浏览选择规则文件",
    "clear_results_tooltip": "清除当前结果",
    "completed_status": "已完成",
    "open_results_tooltip": "打开之前保存的结果",
    "pause_resume_tooltip": "暂停或恢复扫描",
    "ready_status": "就绪",
    "save_results_tooltip": "将扫描结果保存到文件",
    "scanning_status": "扫描中...",
    "start_scan_tooltip": "开始文档扫描",
    "status_bar_tooltip": "当前应用程序状态",
    "add_type_button": "+ 添加类型",
    "remove_type_button": "- 移除类型",
    "all_types_group": "📂 全部类型",
    "document_files_group": "📄 文档文件",
    "spreadsheet_files_group": "📊 表格文件",
    "image_files_group": "🖼️ 图像文件",
    "web_files_group": "🌐 网页文件",
    "archive_files_group": "📦 压缩文件",
}
