# -*- coding: utf-8 -*-
"""Paper Review feature translations for OpenJudge Studio.

Contains translations for:
- Paper Review feature header and description
- Sidebar settings (API, model, review options)
- Single paper review (upload, progress, results)
- Batch paper review
- History panel
- Help/guide content
"""

# =============================================================================
# English Translations
# =============================================================================
EN: dict[str, str] = {
    # Feature Info
    "paper_review.name": "Paper Review",
    "paper_review.description": "AI-powered academic paper review system",
    # Tabs
    "paper_review.tabs.single": "Single Paper",
    "paper_review.tabs.bib_check": "BIB Verify",
    "paper_review.tabs.batch": "Batch Review",
    "paper_review.tabs.history": "History",
    "paper_review.tabs.help": "Help",
    # BIB Check
    "paper_review.bib_check.upload_title": "Upload .bib File",
    "paper_review.bib_check.upload_bib": "Upload .bib",
    "paper_review.bib_check.upload_bib_help": "Upload a BibTeX file to verify references",
    "paper_review.bib_check.missing_bib": "Please upload a .bib file",
    "paper_review.bib_check.start": "Verify References",
    "paper_review.bib_check.result_title": "Verification Results",
    "paper_review.bib_check.empty_state": "Upload a .bib file to verify references",
    "paper_review.bib_check.in_progress": "Verifying references...",
    "paper_review.bib_check.parsing": "Parsing BibTeX file...",
    "paper_review.bib_check.completed": "Verification complete",
    "paper_review.bib_check.summary": "Verification Summary",
    # Sidebar - API Settings
    "paper_review.sidebar.api_settings": "API Settings",
    "paper_review.sidebar.custom_endpoint": "API Endpoint",
    "paper_review.sidebar.endpoint_help": "Optional. Leave empty for default OpenAI endpoint.",
    "paper_review.sidebar.api_key": "API Key",
    "paper_review.sidebar.api_key_placeholder": "Enter your API key",
    "paper_review.sidebar.api_configured": "API key configured",
    "paper_review.sidebar.api_required": "API key required",
    # Sidebar - Model Settings
    "paper_review.sidebar.model_settings": "Model Settings",
    "paper_review.sidebar.model": "Model",
    "paper_review.sidebar.temperature": "Temperature",
    "paper_review.sidebar.temperature_help": "Lower values for more focused output, higher for creativity",
    "paper_review.sidebar.custom_model": "Custom Model Name",
    "paper_review.sidebar.custom_model_help": "Enter any model name (e.g., claude-3-5-sonnet, qwen-max)",
    # Sidebar - Review Options
    "paper_review.sidebar.review_options": "Review Options",
    "paper_review.sidebar.enable_safety": "Safety Check",
    "paper_review.sidebar.enable_safety_help": "Check for jailbreaking attempts and format compliance",
    "paper_review.sidebar.enable_correctness": "Correctness Analysis",
    "paper_review.sidebar.enable_correctness_help": "Detect objective errors in the paper",
    "paper_review.sidebar.enable_review": "Paper Review",
    "paper_review.sidebar.enable_review_help": "Generate comprehensive review with score",
    "paper_review.sidebar.enable_criticality": "Criticality Verification",
    "paper_review.sidebar.enable_criticality_help": "Verify severity of detected issues",
    "paper_review.sidebar.enable_bib": "Bibliography Verification",
    "paper_review.sidebar.enable_bib_help": "Verify references using CrossRef API",
    # Sidebar - Advanced
    "paper_review.sidebar.advanced": "Advanced Settings",
    "paper_review.sidebar.crossref_email": "CrossRef Email",
    "paper_review.sidebar.crossref_email_help": "Email for CrossRef API (improves rate limits)",
    # Single Review - Upload
    "paper_review.single.placeholder": "Upload a PDF to start review",
    "paper_review.single.upload_title": "Upload Paper",
    "paper_review.single.upload_pdf": "Upload PDF",
    "paper_review.single.upload_pdf_help": "Select a PDF file to review",
    "paper_review.single.upload_bib": "Upload .bib (Optional)",
    "paper_review.single.upload_bib_help": "Upload bibliography file for reference verification",
    "paper_review.single.paper_name": "Paper Name",
    "paper_review.single.paper_name_placeholder": "Enter paper name for the report",
    "paper_review.single.start": "Start Review",
    "paper_review.single.missing_pdf": "Please upload a PDF file",
    "paper_review.single.missing_api_key": "Please configure API key in sidebar",
    # Single Review - Result
    "paper_review.single.result_title": "Review Result",
    "paper_review.single.empty_state": "Upload a paper to see results here",
    "paper_review.single.in_progress": "Review in progress...",
    "paper_review.single.completed": "Review completed!",
    # Progress - Stage names (used as i18n keys from backend)
    "paper_review.progress.loading_pdf": "Loading PDF",
    "paper_review.progress.loading_pdf_desc": "Loading and encoding PDF file",
    "paper_review.progress.safety_check": "Safety Check",
    "paper_review.progress.safety_check_desc": "Running safety and format checks",
    "paper_review.progress.correctness": "Correctness Analysis",
    "paper_review.progress.correctness_desc": "Analyzing paper correctness",
    "paper_review.progress.review": "Paper Review",
    "paper_review.progress.review_desc": "Generating comprehensive review",
    "paper_review.progress.criticality": "Criticality Verification",
    "paper_review.progress.criticality_desc": "Verifying issue criticality",
    "paper_review.progress.bib_verification": "Bibliography Verification",
    "paper_review.progress.bib_verification_desc": "Verifying bibliography references",
    "paper_review.progress.completed": "Completed",
    "paper_review.progress.completed_desc": "Review completed successfully",
    "paper_review.progress.failed": "Failed",
    "paper_review.progress.failed_desc": "Review failed",
    # Result Display
    "paper_review.result.safety": "Safety Check",
    "paper_review.result.safety_passed": "Passed",
    "paper_review.result.safety_failed": "Issues Detected",
    "paper_review.result.format_compliant": "Format Compliant",
    "paper_review.result.review_score": "Review Score",
    "paper_review.result.correctness_score": "Correctness Score",
    "paper_review.result.criticality_score": "Criticality Score",
    "paper_review.result.key_issues": "Key Issues",
    "paper_review.result.major_issues": "Major Issues",
    "paper_review.result.minor_issues": "Minor Issues",
    "paper_review.result.false_positives": "False Positives",
    "paper_review.result.bib_summary": "Bibliography Summary",
    "paper_review.result.total_refs": "Total References",
    "paper_review.result.verified": "Verified",
    "paper_review.result.suspect": "Suspect",
    "paper_review.result.errors": "Errors",
    "paper_review.result.verification_rate": "Verification Rate",
    "paper_review.result.suspect_refs": "Suspect References",
    "paper_review.result.download_report": "Download Report",
    "paper_review.result.copy_report": "Copy Report",
    # Batch Review
    "paper_review.batch.placeholder": "Batch review coming soon...",
    "paper_review.batch.upload_title": "Upload Papers",
    "paper_review.batch.upload_help": "Upload multiple PDF files for batch review",
    "paper_review.batch.start": "Start Batch Review",
    "paper_review.batch.max_concurrency": "Max Concurrency",
    "paper_review.batch.max_concurrency_help": "Number of papers to review concurrently (1-3 recommended)",
    "paper_review.batch.progress_title": "Batch Progress",
    "paper_review.batch.total_papers": "Total Papers",
    "paper_review.batch.completed_papers": "Completed",
    "paper_review.batch.current_paper": "Current Paper",
    "paper_review.batch.download_all": "Download All Reports",
    "paper_review.batch.export_csv": "Export Summary CSV",
    "paper_review.batch.pending": "Pending",
    "paper_review.batch.running": "Running",
    "paper_review.batch.failed": "Failed",
    "paper_review.batch.cancelled": "Cancelled",
    # History
    "paper_review.history.placeholder": "Review history coming soon...",
    "paper_review.history.title": "Review History",
    "paper_review.history.no_history": "No review history yet",
    "paper_review.history.view": "View",
    "paper_review.history.delete": "Delete",
    "paper_review.history.deleted": "Task deleted",
    "paper_review.history.clear_all": "Clear All",
    "paper_review.history.total_reviews": "Total Reviews",
    "paper_review.history.successful": "Successful",
    "paper_review.history.avg_review_score": "Avg Review Score",
    "paper_review.history.avg_correctness": "Avg Correctness",
    # Help
    "paper_review.help.title": "Quick Start Guide",
    "paper_review.help.step1_title": "Configure API",
    "paper_review.help.step1_desc": "Set up your API provider and key in the sidebar. Models must support PDF input.",
    "paper_review.help.step2_title": "Upload Paper",
    "paper_review.help.step2_desc": "Upload a PDF file. Optionally upload a .bib file for reference verification.",
    "paper_review.help.step3_title": "Start Review",
    "paper_review.help.step3_desc": "Click 'Start Review' to begin the AI-powered review process.",
    "paper_review.help.step4_title": "View Results",
    "paper_review.help.step4_desc": "Review the scores, feedback, and download the Markdown report.",
    # Help - Stages
    "paper_review.help.stages_title": "Review Stages",
    "paper_review.help.stage_safety": "Safety Check",
    "paper_review.help.stage_safety_desc": "Checks for malicious content and format compliance.",
    "paper_review.help.stage_correctness": "Correctness Analysis",
    "paper_review.help.stage_correctness_desc": "Detects objective errors in methodology, math, or claims.",
    "paper_review.help.stage_review": "Paper Review",
    "paper_review.help.stage_review_desc": "Generates comprehensive review with strengths, "
    "weaknesses, and recommendations.",
    "paper_review.help.stage_criticality": "Criticality Verification",
    "paper_review.help.stage_criticality_desc": "Classifies detected issues by severity (major/minor/false positive).",
    "paper_review.help.stage_bib": "Bibliography Verification",
    "paper_review.help.stage_bib_desc": "Verifies references using CrossRef API to detect potential fabrications.",
    # Error Messages
    "paper_review.error.pipeline_failed": "Review pipeline failed: {error}",
    "paper_review.error.pdf_load_failed": "Failed to load PDF file",
    "paper_review.error.bib_parse_failed": "Failed to parse .bib file",
}

# =============================================================================
# Chinese Translations
# =============================================================================
ZH: dict[str, str] = {
    # Feature Info
    "paper_review.name": "论文审稿",
    "paper_review.description": "AI驱动的学术论文审稿系统",
    # Tabs
    "paper_review.tabs.single": "单篇审稿",
    "paper_review.tabs.bib_check": "BIB验证",
    "paper_review.tabs.batch": "批量审稿",
    "paper_review.tabs.history": "历史记录",
    "paper_review.tabs.help": "帮助",
    # BIB Check
    "paper_review.bib_check.upload_title": "上传 .bib 文件",
    "paper_review.bib_check.upload_bib": "上传 .bib",
    "paper_review.bib_check.upload_bib_help": "上传BibTeX文件以验证参考文献",
    "paper_review.bib_check.missing_bib": "请上传 .bib 文件",
    "paper_review.bib_check.start": "验证参考文献",
    "paper_review.bib_check.result_title": "验证结果",
    "paper_review.bib_check.empty_state": "上传 .bib 文件以验证参考文献",
    "paper_review.bib_check.in_progress": "正在验证参考文献...",
    "paper_review.bib_check.parsing": "正在解析BibTeX文件...",
    "paper_review.bib_check.completed": "验证完成",
    "paper_review.bib_check.summary": "验证摘要",
    # Sidebar - API Settings
    "paper_review.sidebar.api_settings": "API 设置",
    "paper_review.sidebar.custom_endpoint": "API 端点",
    "paper_review.sidebar.endpoint_help": "可选。留空则使用默认OpenAI端点。",
    "paper_review.sidebar.api_key": "API Key",
    "paper_review.sidebar.api_key_placeholder": "输入您的API Key",
    "paper_review.sidebar.api_configured": "API Key 已配置",
    "paper_review.sidebar.api_required": "需要配置API Key",
    # Sidebar - Model Settings
    "paper_review.sidebar.model_settings": "模型设置",
    "paper_review.sidebar.model": "模型",
    "paper_review.sidebar.temperature": "温度",
    "paper_review.sidebar.temperature_help": "较低值输出更集中，较高值更有创意",
    "paper_review.sidebar.custom_model": "自定义模型名称",
    "paper_review.sidebar.custom_model_help": "输入任意模型名称（如 claude-3-5-sonnet, qwen-max）",
    # Sidebar - Review Options
    "paper_review.sidebar.review_options": "审稿选项",
    "paper_review.sidebar.enable_safety": "安全检查",
    "paper_review.sidebar.enable_safety_help": "检查恶意注入和格式合规性",
    "paper_review.sidebar.enable_correctness": "正确性分析",
    "paper_review.sidebar.enable_correctness_help": "检测论文中的客观错误",
    "paper_review.sidebar.enable_review": "论文审稿",
    "paper_review.sidebar.enable_review_help": "生成包含评分的全面审稿意见",
    "paper_review.sidebar.enable_criticality": "关键性验证",
    "paper_review.sidebar.enable_criticality_help": "验证检测到的问题的严重程度",
    "paper_review.sidebar.enable_bib": "参考文献验证",
    "paper_review.sidebar.enable_bib_help": "使用CrossRef API验证参考文献",
    # Sidebar - Advanced
    "paper_review.sidebar.advanced": "高级设置",
    "paper_review.sidebar.crossref_email": "CrossRef 邮箱",
    "paper_review.sidebar.crossref_email_help": "用于CrossRef API的邮箱（可提高请求限制）",
    # Single Review - Upload
    "paper_review.single.placeholder": "上传PDF开始审稿",
    "paper_review.single.upload_title": "上传论文",
    "paper_review.single.upload_pdf": "上传 PDF",
    "paper_review.single.upload_pdf_help": "选择要审稿的PDF文件",
    "paper_review.single.upload_bib": "上传 .bib（可选）",
    "paper_review.single.upload_bib_help": "上传参考文献文件用于引用验证",
    "paper_review.single.paper_name": "论文名称",
    "paper_review.single.paper_name_placeholder": "输入论文名称用于报告",
    "paper_review.single.start": "开始审稿",
    "paper_review.single.missing_pdf": "请上传PDF文件",
    "paper_review.single.missing_api_key": "请在侧边栏配置API Key",
    # Single Review - Result
    "paper_review.single.result_title": "审稿结果",
    "paper_review.single.empty_state": "上传论文后在此查看结果",
    "paper_review.single.in_progress": "审稿进行中...",
    "paper_review.single.completed": "审稿完成！",
    # Progress - Stage names (used as i18n keys from backend)
    "paper_review.progress.loading_pdf": "加载PDF",
    "paper_review.progress.loading_pdf_desc": "正在加载并编码PDF文件",
    "paper_review.progress.safety_check": "安全检查",
    "paper_review.progress.safety_check_desc": "正在运行安全和格式检查",
    "paper_review.progress.correctness": "正确性分析",
    "paper_review.progress.correctness_desc": "正在分析论文正确性",
    "paper_review.progress.review": "论文审稿",
    "paper_review.progress.review_desc": "正在生成全面审稿意见",
    "paper_review.progress.criticality": "关键性验证",
    "paper_review.progress.criticality_desc": "正在验证问题严重程度",
    "paper_review.progress.bib_verification": "参考文献验证",
    "paper_review.progress.bib_verification_desc": "正在验证参考文献",
    "paper_review.progress.completed": "已完成",
    "paper_review.progress.completed_desc": "审稿成功完成",
    "paper_review.progress.failed": "失败",
    "paper_review.progress.failed_desc": "审稿失败",
    # Result Display
    "paper_review.result.safety": "安全检查",
    "paper_review.result.safety_passed": "通过",
    "paper_review.result.safety_failed": "检测到问题",
    "paper_review.result.format_compliant": "格式合规",
    "paper_review.result.review_score": "审稿评分",
    "paper_review.result.correctness_score": "正确性评分",
    "paper_review.result.criticality_score": "关键性评分",
    "paper_review.result.key_issues": "关键问题",
    "paper_review.result.major_issues": "主要问题",
    "paper_review.result.minor_issues": "次要问题",
    "paper_review.result.false_positives": "误报",
    "paper_review.result.bib_summary": "参考文献摘要",
    "paper_review.result.total_refs": "总引用数",
    "paper_review.result.verified": "已验证",
    "paper_review.result.suspect": "可疑",
    "paper_review.result.errors": "错误",
    "paper_review.result.verification_rate": "验证率",
    "paper_review.result.suspect_refs": "可疑引用",
    "paper_review.result.download_report": "下载报告",
    "paper_review.result.copy_report": "复制报告",
    # Batch Review
    "paper_review.batch.placeholder": "批量审稿即将推出...",
    "paper_review.batch.upload_title": "上传论文",
    "paper_review.batch.upload_help": "上传多个PDF文件进行批量审稿",
    "paper_review.batch.start": "开始批量审稿",
    "paper_review.batch.max_concurrency": "最大并发数",
    "paper_review.batch.max_concurrency_help": "同时审稿的论文数量（建议1-3）",
    "paper_review.batch.progress_title": "批量进度",
    "paper_review.batch.total_papers": "总论文数",
    "paper_review.batch.completed_papers": "已完成",
    "paper_review.batch.current_paper": "当前论文",
    "paper_review.batch.download_all": "下载所有报告",
    "paper_review.batch.export_csv": "导出CSV摘要",
    "paper_review.batch.pending": "等待中",
    "paper_review.batch.running": "运行中",
    "paper_review.batch.failed": "失败",
    "paper_review.batch.cancelled": "已取消",
    # History
    "paper_review.history.placeholder": "历史记录即将推出...",
    "paper_review.history.title": "审稿历史",
    "paper_review.history.no_history": "暂无审稿历史",
    "paper_review.history.view": "查看",
    "paper_review.history.delete": "删除",
    "paper_review.history.deleted": "任务已删除",
    "paper_review.history.clear_all": "清空全部",
    "paper_review.history.total_reviews": "总审稿数",
    "paper_review.history.successful": "成功",
    "paper_review.history.avg_review_score": "平均审稿评分",
    "paper_review.history.avg_correctness": "平均正确性",
    # Help
    "paper_review.help.title": "快速入门指南",
    "paper_review.help.step1_title": "配置API",
    "paper_review.help.step1_desc": "在侧边栏设置API服务商和密钥。模型需支持PDF输入。",
    "paper_review.help.step2_title": "上传论文",
    "paper_review.help.step2_desc": "上传PDF文件。可选上传.bib文件用于参考文献验证。",
    "paper_review.help.step3_title": "开始审稿",
    "paper_review.help.step3_desc": "点击「开始审稿」启动AI审稿流程。",
    "paper_review.help.step4_title": "查看结果",
    "paper_review.help.step4_desc": "查看评分、反馈，并下载Markdown报告。",
    # Help - Stages
    "paper_review.help.stages_title": "审稿阶段",
    "paper_review.help.stage_safety": "安全检查",
    "paper_review.help.stage_safety_desc": "检查恶意内容和格式合规性。",
    "paper_review.help.stage_correctness": "正确性分析",
    "paper_review.help.stage_correctness_desc": "检测方法论、数学或论断中的客观错误。",
    "paper_review.help.stage_review": "论文审稿",
    "paper_review.help.stage_review_desc": "生成包含优缺点和建议的全面审稿意见。",
    "paper_review.help.stage_criticality": "关键性验证",
    "paper_review.help.stage_criticality_desc": "按严重程度分类检测到的问题（主要/次要/误报）。",
    "paper_review.help.stage_bib": "参考文献验证",
    "paper_review.help.stage_bib_desc": "使用CrossRef API验证引用，检测可能的捏造引用。",
    # Error Messages
    "paper_review.error.pipeline_failed": "审稿流程失败: {error}",
    "paper_review.error.pdf_load_failed": "加载PDF文件失败",
    "paper_review.error.bib_parse_failed": "解析.bib文件失败",
}
