# -*- coding: utf-8 -*-
"""Auto Rubric feature translations for OpenJudge Studio.

Contains translations for:
- Feature header and description
- Sidebar settings (LLM config, generation settings)
- Simple Rubric configuration panel
- Iterative Rubric configuration panel (Phase 2)
- Data upload panel (Phase 2)
- Result panel
- Export functionality
- History management (Phase 2)
- Help content

Key prefix conventions:
- rubric.*            : General Auto Rubric feature
- rubric.sidebar.*    : Sidebar settings
- rubric.config.*     : Configuration panel
- rubric.iterative.*  : Iterative mode specific
- rubric.upload.*     : Data upload
- rubric.result.*     : Result panel
- rubric.export.*     : Export functionality
- rubric.history.*    : History management
- rubric.help.*       : Help content
"""

# =============================================================================
# English Translations
# =============================================================================
EN: dict[str, str] = {
    # Feature Info
    "rubric.name": "Grader Generator",
    "rubric.description": "Automatically generate evaluation graders without manual design",
    # Tabs
    "rubric.tabs.new": "New",
    "rubric.tabs.history": "History",
    "rubric.tabs.help": "Help",
    # Mode Selection
    "rubric.mode.title": "Generation Mode",
    "rubric.mode.simple": "Simple Rubric",
    "rubric.mode.simple_desc": "Zero-shot generation from task description",
    "rubric.mode.iterative": "Iterative Rubric",
    "rubric.mode.iterative_desc": "Data-driven generation from labeled data",
    # Sidebar - LLM Config
    "rubric.sidebar.llm_config": "LLM Configuration",
    "rubric.sidebar.provider_help": "Select API provider for rubric generation",
    "rubric.sidebar.api_key_help": "API key for the selected provider",
    "rubric.sidebar.model_help": "Model to use for rubric generation",
    # Sidebar - Generation Settings
    "rubric.sidebar.gen_settings": "Generation Settings",
    "rubric.sidebar.language": "Language",
    "rubric.sidebar.language_help": "Language for generated rubrics and evaluation",
    "rubric.sidebar.eval_mode": "Evaluation Mode",
    "rubric.sidebar.eval_mode_help": "Pointwise: score each response; Listwise: rank multiple responses",
    "rubric.sidebar.pointwise": "Pointwise (Scoring)",
    "rubric.sidebar.listwise": "Listwise (Ranking)",
    "rubric.sidebar.score_range": "Score Range",
    "rubric.sidebar.min_score": "Min Score",
    "rubric.sidebar.max_score": "Max Score",
    # Sidebar - Advanced Settings
    "rubric.sidebar.advanced": "Advanced Settings",
    "rubric.sidebar.max_retries": "Max Retries",
    "rubric.sidebar.max_retries_help": "Maximum retry attempts for LLM API calls",
    # Config Panel - Simple Rubric
    "rubric.config.grader_name": "Grader Name",
    "rubric.config.grader_name_placeholder": "e.g., medical_qa_grader",
    "rubric.config.grader_name_help": "A unique name for the generated grader",
    "rubric.config.required": "Required",
    "rubric.config.optional": "Optional",
    "rubric.config.task_description": "Task Description",
    "rubric.config.task_description_placeholder": (
        "Describe your task clearly, e.g.:\n"
        "This is a medical Q&A system that answers health-related questions.\n"
        "Responses should be accurate, complete, and use appropriate medical terminology."
    ),
    "rubric.config.task_description_help": "Clear description of what your system does and evaluation focus",
    "rubric.config.scenario": "Usage Scenario (Optional)",
    "rubric.config.scenario_placeholder": "e.g., Healthcare professionals seeking quick medical knowledge",
    "rubric.config.scenario_help": "Optional context about who uses this system and how",
    "rubric.config.sample_queries": "Sample Queries (Optional)",
    "rubric.config.sample_queries_placeholder": (
        "Enter sample queries, one per line:\n" "What are the symptoms of flu?\n" "How to lower blood pressure?"
    ),
    "rubric.config.sample_queries_help": "Example queries to help generate relevant rubrics",
    "rubric.config.generate": "Generate Rubric",
    # Result Panel
    "rubric.result.title": "Generated Grader",
    "rubric.result.empty_title": "Ready to Generate",
    "rubric.result.empty_desc": "Configure your settings and click <strong>Generate Rubric</strong> to create a grader",
    "rubric.result.empty_tip": "Tip: Provide a clear task description for better rubric quality",
    "rubric.result.success": "Generation Successful!",
    "rubric.result.rubrics_title": "Generated Rubrics",
    "rubric.result.grader_info": "Grader Information",
    "rubric.result.name_label": "Name",
    "rubric.result.mode_label": "Mode",
    "rubric.result.score_range_label": "Score Range",
    "rubric.result.language_label": "Language",
    "rubric.result.copy": "Copy Rubrics",
    "rubric.result.copy_success": "Rubrics copied to clipboard!",
    "rubric.result.test": "Test Grader",
    "rubric.result.export": "Export",
    "rubric.result.generating": "Generating rubrics...",
    "rubric.result.init_model": "Initializing model...",
    "rubric.result.calling_api": "Calling API to generate rubrics...",
    "rubric.result.processing": "Processing results...",
    "rubric.result.complete": "Generation complete ({time})",
    "rubric.result.failed": "Generation Failed",
    "rubric.result.error": "Error: {error}",
    # Export Panel
    "rubric.export.title": "Export Grader",
    "rubric.export.format": "Export Format",
    "rubric.export.python": "Python Code (.py)",
    "rubric.export.yaml": "YAML Config (.yaml)",
    "rubric.export.json": "JSON Config (.json)",
    "rubric.export.preview": "Preview",
    "rubric.export.download": "Download",
    "rubric.export.copy": "Copy to Clipboard",
    "rubric.export.copy_success": "Code copied to clipboard!",
    # Test Panel
    "rubric.test.title": "Test Grader",
    "rubric.test.query": "Query",
    "rubric.test.query_placeholder": "Enter a test query...",
    "rubric.test.response": "Response",
    "rubric.test.response_placeholder": "Enter a response to evaluate...",
    "rubric.test.run": "Run Evaluation",
    "rubric.test.result": "Evaluation Result",
    "rubric.test.score": "Score",
    "rubric.test.rank": "Ranking",
    "rubric.test.reason": "Reasoning",
    "rubric.test.running": "Running evaluation...",
    "rubric.test.no_grader": "Generate a grader first to enable testing",
    "rubric.test.error": "Test failed",
    "rubric.test.clear": "Clear Result",
    "rubric.test.responses_hint": "Enter multiple responses to rank (minimum 2)",
    "rubric.test.add_response": "Add Response",
    "rubric.test.remove_response": "Remove Response",
    # Iterative Mode
    "rubric.iterative.task_desc_title": "Task Description (Optional)",
    "rubric.iterative.task_desc_placeholder": "Optional: describe the task to provide additional context",
    "rubric.iterative.task_desc_help": "Task description helps guide rubric generation",
    "rubric.iterative.advanced": "Advanced Settings",
    "rubric.iterative.advanced_desc": "Fine-tune the rubric generation process",
    "rubric.iterative.enable_categorization": "Enable Categorization",
    "rubric.iterative.enable_categorization_help": "Group similar rubrics into categories",
    "rubric.iterative.categories_number": "Number of Categories",
    "rubric.iterative.categories_number_help": "Target number of rubric categories",
    "rubric.iterative.query_specific_number": "Rubrics per Sample",
    "rubric.iterative.query_specific_number_help": "Number of rubrics to generate from each training sample",
    "rubric.iterative.generating_rubrics": "Generating rubrics from training data...",
    "rubric.iterative.data_count": "Training samples",
    "rubric.iterative.time_estimate": "Estimated time: {count} samples × ~2-5 seconds each",
    "rubric.iterative.time_estimate_mins": "Estimated time: ~{minutes} min (please be patient)",
    "rubric.iterative.please_wait": "This may take a few minutes, please wait...",
    "rubric.iterative.total_time": "Total time",
    "rubric.iterative.elapsed": "Elapsed",
    "rubric.iterative.remaining": "Remaining",
    "rubric.iterative.no_cancel_warning": "Once started, the task cannot be cancelled. Please wait for completion.",
    # Data Upload
    "rubric.upload.title": "Training Data",
    "rubric.upload.label": "Upload Data File",
    "rubric.upload.help": "Upload a JSON, JSONL, or CSV file with labeled training data",
    "rubric.upload.format_hint": "File format requirements:",
    "rubric.upload.required_fields": "Required fields",
    "rubric.upload.supported_formats": "Supported: .json, .jsonl, .csv",
    "rubric.upload.parsing": "Parsing data...",
    "rubric.upload.success": "Successfully loaded {count} records",
    "rubric.upload.success_short": "Data loaded successfully",
    "rubric.upload.records": "records",
    "rubric.upload.score_range_label": "Score range",
    "rubric.upload.error": "Failed to parse data",
    "rubric.upload.warnings": "Warnings",
    "rubric.upload.details": "Details",
    "rubric.upload.preview": "Data Preview",
    "rubric.upload.drop_hint": "Drag and drop or click to upload",
    "rubric.upload.sample_title": "Select data amount for rubric generation",
    "rubric.upload.sample_count": "Records to use",
    "rubric.upload.sample_help": "Select how many records to use. Fewer records = faster generation.",
    "rubric.upload.quick_select": "Quick select",
    "rubric.upload.use_all": "Use all",
    "rubric.upload.sampled_info": "Using {selected} randomly sampled records from {total} total records",
    "rubric.upload.detected_score_range": "Detected score range",
    # History
    "rubric.history.title": "Generation History",
    "rubric.history.empty": "No history yet",
    "rubric.history.empty_hint": "Generated rubrics will appear here",
    "rubric.history.count": "{count} saved graders",
    "rubric.history.view": "View",
    "rubric.history.export": "Export",
    "rubric.history.delete": "Delete",
    "rubric.history.deleted": "Deleted task {task_id}",
    "rubric.history.delete_failed": "Failed to delete task",
    "rubric.history.back": "Back",
    "rubric.history.task_not_found": "Task not found",
    # Validation
    "rubric.validation.name_required": "Grader name is required",
    "rubric.validation.task_required": "Task description is required",
    "rubric.validation.api_key_required": "API key is required",
    "rubric.validation.model_required": "Model selection is required",
    "rubric.validation.data_required": "Training data is required",
    "rubric.validation.min_data_required": "At least {count} training samples required",
    # Help
    "rubric.help.title": "Quick Start Guide",
    "rubric.help.overview": "Auto Rubric generates evaluation criteria (rubrics) for your LLM apps.",
    "rubric.help.simple_title": "Simple Rubric Mode",
    "rubric.help.simple_step1": "Configure your LLM API in the sidebar",
    "rubric.help.simple_step2": "Enter a clear task description",
    "rubric.help.simple_step3": "Optionally add usage scenario and sample queries",
    "rubric.help.simple_step4": 'Click "Generate Rubric" to create your grader',
    "rubric.help.iterative_title": "Iterative Rubric Mode",
    "rubric.help.iterative_step1": "Prepare labeled training data (JSON/JSONL/CSV)",
    "rubric.help.iterative_step2": "Upload your data file",
    "rubric.help.iterative_step3": "Configure advanced settings (optional)",
    "rubric.help.iterative_step4": "Generate data-driven rubrics",
    "rubric.help.tips_title": "Tips for Better Results",
    "rubric.help.tip1": "Be specific about what your system does",
    "rubric.help.tip2": "Describe the target audience and use case",
    "rubric.help.tip3": "Include quality dimensions you care about",
    "rubric.help.tip4": "Provide representative sample queries",
    "rubric.help.export_title": "Export Options",
    "rubric.help.export_desc": (
        "Export your generated grader as Python code for direct use, "
        "or as YAML/JSON config for integration with existing workflows."
    ),
}

# =============================================================================
# Chinese Translations
# =============================================================================
ZH: dict[str, str] = {
    # Feature Info
    "rubric.name": "Grader 生成",
    "rubric.description": "自动生成评估器，无需手动设计",
    # Tabs
    "rubric.tabs.new": "新建",
    "rubric.tabs.history": "历史",
    "rubric.tabs.help": "帮助",
    # Mode Selection
    "rubric.mode.title": "生成模式",
    "rubric.mode.simple": "Simple Rubric",
    "rubric.mode.simple_desc": "基于任务描述零样本生成",
    "rubric.mode.iterative": "Iterative Rubric",
    "rubric.mode.iterative_desc": "基于标注数据的数据驱动生成",
    # Sidebar - LLM Config
    "rubric.sidebar.llm_config": "LLM 配置",
    "rubric.sidebar.provider_help": "选择用于生成 Rubric 的 API 提供商",
    "rubric.sidebar.api_key_help": "所选提供商的 API 密钥",
    "rubric.sidebar.model_help": "用于生成 Rubric 的模型",
    # Sidebar - Generation Settings
    "rubric.sidebar.gen_settings": "生成设置",
    "rubric.sidebar.language": "语言",
    "rubric.sidebar.language_help": "生成的 Rubric 和评估使用的语言",
    "rubric.sidebar.eval_mode": "评估模式",
    "rubric.sidebar.eval_mode_help": "Pointwise：对每个回答打分；Listwise：对多个回答排序",
    "rubric.sidebar.pointwise": "Pointwise（打分）",
    "rubric.sidebar.listwise": "Listwise（排序）",
    "rubric.sidebar.score_range": "分数范围",
    "rubric.sidebar.min_score": "最低分",
    "rubric.sidebar.max_score": "最高分",
    # Sidebar - Advanced Settings
    "rubric.sidebar.advanced": "高级设置",
    "rubric.sidebar.max_retries": "最大重试次数",
    "rubric.sidebar.max_retries_help": "LLM API 调用的最大重试次数",
    # Config Panel - Simple Rubric
    "rubric.config.grader_name": "Grader 名称",
    "rubric.config.grader_name_placeholder": "例如：medical_qa_grader",
    "rubric.config.grader_name_help": "为生成的 Grader 指定一个唯一名称",
    "rubric.config.required": "必填",
    "rubric.config.optional": "可选",
    "rubric.config.task_description": "任务描述",
    "rubric.config.task_description_placeholder": (
        "清晰描述您的任务，例如：\n"
        "这是一个医疗问答系统，回答健康相关问题。\n"
        "回答应该准确、完整，并使用恰当的医学术语。"
    ),
    "rubric.config.task_description_help": "清晰描述您的系统功能和评估重点",
    "rubric.config.scenario": "使用场景（可选）",
    "rubric.config.scenario_placeholder": "例如：医疗专业人员寻求快速医学知识",
    "rubric.config.scenario_help": "可选的用户群体和使用方式描述",
    "rubric.config.sample_queries": "示例查询（可选）",
    "rubric.config.sample_queries_placeholder": "输入示例查询，每行一个：\n感冒的症状有哪些？\n如何降低血压？",
    "rubric.config.sample_queries_help": "示例查询有助于生成更相关的 Rubric",
    "rubric.config.generate": "生成 Rubric",
    # Result Panel
    "rubric.result.title": "生成的 Grader",
    "rubric.result.empty_title": "准备就绪",
    "rubric.result.empty_desc": "配置设置后点击 <strong>生成 Rubric</strong> 来创建 Grader",
    "rubric.result.empty_tip": "提示：提供清晰的任务描述可获得更好的 Rubric 质量",
    "rubric.result.success": "生成成功！",
    "rubric.result.rubrics_title": "生成的 Rubrics",
    "rubric.result.grader_info": "Grader 信息",
    "rubric.result.name_label": "名称",
    "rubric.result.mode_label": "模式",
    "rubric.result.score_range_label": "分数范围",
    "rubric.result.language_label": "语言",
    "rubric.result.copy": "复制 Rubrics",
    "rubric.result.copy_success": "Rubrics 已复制到剪贴板！",
    "rubric.result.test": "测试 Grader",
    "rubric.result.export": "导出",
    "rubric.result.generating": "正在生成 Rubrics...",
    "rubric.result.init_model": "正在初始化模型...",
    "rubric.result.calling_api": "正在调用 API 生成 Rubrics...",
    "rubric.result.processing": "正在处理结果...",
    "rubric.result.complete": "生成完成（{time}）",
    "rubric.result.failed": "生成失败",
    "rubric.result.error": "错误：{error}",
    # Export Panel
    "rubric.export.title": "导出 Grader",
    "rubric.export.format": "导出格式",
    "rubric.export.python": "Python 代码 (.py)",
    "rubric.export.yaml": "YAML 配置 (.yaml)",
    "rubric.export.json": "JSON 配置 (.json)",
    "rubric.export.preview": "预览",
    "rubric.export.download": "下载",
    "rubric.export.copy": "复制到剪贴板",
    "rubric.export.copy_success": "代码已复制到剪贴板！",
    # Test Panel
    "rubric.test.title": "测试 Grader",
    "rubric.test.query": "问题",
    "rubric.test.query_placeholder": "输入测试问题...",
    "rubric.test.response": "回答",
    "rubric.test.response_placeholder": "输入待评估的回答...",
    "rubric.test.run": "运行评估",
    "rubric.test.result": "评估结果",
    "rubric.test.score": "分数",
    "rubric.test.rank": "排名",
    "rubric.test.reason": "评估理由",
    "rubric.test.running": "正在评估...",
    "rubric.test.no_grader": "请先生成 Grader 以启用测试功能",
    "rubric.test.error": "测试失败",
    "rubric.test.clear": "清除结果",
    "rubric.test.responses_hint": "输入多个回答进行排名（至少2个）",
    "rubric.test.add_response": "添加回答",
    "rubric.test.remove_response": "移除回答",
    # Iterative Mode
    "rubric.iterative.task_desc_title": "任务描述（可选）",
    "rubric.iterative.task_desc_placeholder": "可选：描述任务以提供额外上下文",
    "rubric.iterative.task_desc_help": "任务描述有助于指导 Rubric 生成",
    "rubric.iterative.advanced": "高级设置",
    "rubric.iterative.advanced_desc": "微调 Rubric 生成过程",
    "rubric.iterative.enable_categorization": "启用分类",
    "rubric.iterative.enable_categorization_help": "将相似的 Rubric 分组到类别中",
    "rubric.iterative.categories_number": "类别数量",
    "rubric.iterative.categories_number_help": "目标 Rubric 类别数量",
    "rubric.iterative.query_specific_number": "每样本 Rubric 数",
    "rubric.iterative.query_specific_number_help": "从每个训练样本生成的 Rubric 数量",
    "rubric.iterative.generating_rubrics": "正在从训练数据生成 Rubrics...",
    "rubric.iterative.data_count": "训练样本数",
    "rubric.iterative.time_estimate": "预计耗时：{count} 条样本 × 每条约 2-5 秒",
    "rubric.iterative.time_estimate_mins": "预计耗时：约 {minutes} 分钟（请耐心等待）",
    "rubric.iterative.please_wait": "可能需要几分钟，请耐心等待...",
    "rubric.iterative.total_time": "总耗时",
    "rubric.iterative.elapsed": "已用时",
    "rubric.iterative.remaining": "预计剩余",
    "rubric.iterative.no_cancel_warning": "任务开始后无法取消，请耐心等待完成",
    # Data Upload
    "rubric.upload.title": "训练数据",
    "rubric.upload.label": "上传数据文件",
    "rubric.upload.help": "上传包含标注训练数据的 JSON、JSONL 或 CSV 文件",
    "rubric.upload.format_hint": "文件格式要求：",
    "rubric.upload.required_fields": "必需字段",
    "rubric.upload.supported_formats": "支持：.json、.jsonl、.csv",
    "rubric.upload.parsing": "正在解析数据...",
    "rubric.upload.success": "成功加载 {count} 条记录",
    "rubric.upload.success_short": "数据加载成功",
    "rubric.upload.records": "条记录",
    "rubric.upload.score_range_label": "分数范围",
    "rubric.upload.error": "数据解析失败",
    "rubric.upload.warnings": "警告",
    "rubric.upload.details": "详情",
    "rubric.upload.preview": "数据预览",
    "rubric.upload.drop_hint": "拖放或点击上传",
    "rubric.upload.sample_title": "选择用于生成 Rubric 的数据量",
    "rubric.upload.sample_count": "使用记录数",
    "rubric.upload.sample_help": "选择使用多少条记录。使用较少记录更快，但可能生成的 Rubric 覆盖面较窄。",
    "rubric.upload.quick_select": "快速选择",
    "rubric.upload.use_all": "全部使用",
    "rubric.upload.sampled_info": "从 {total} 条记录中随机采样 {selected} 条使用",
    "rubric.upload.detected_score_range": "检测到的分数范围",
    # History
    "rubric.history.title": "生成历史",
    "rubric.history.empty": "暂无历史记录",
    "rubric.history.empty_hint": "生成的 Grader 将显示在这里",
    "rubric.history.count": "{count} 个已保存的 Grader",
    "rubric.history.view": "查看",
    "rubric.history.export": "导出",
    "rubric.history.delete": "删除",
    "rubric.history.deleted": "已删除任务 {task_id}",
    "rubric.history.delete_failed": "删除任务失败",
    "rubric.history.back": "返回",
    "rubric.history.task_not_found": "未找到任务",
    # Validation
    "rubric.validation.name_required": "请输入 Grader 名称",
    "rubric.validation.task_required": "请输入任务描述",
    "rubric.validation.api_key_required": "请配置 API 密钥",
    "rubric.validation.model_required": "请选择模型",
    "rubric.validation.data_required": "请上传训练数据",
    "rubric.validation.min_data_required": "至少需要 {count} 条训练样本",
    # Help
    "rubric.help.title": "快速入门",
    "rubric.help.overview": "Auto Rubric 自动为您的 LLM 应用生成评估标准（Rubrics）。",
    "rubric.help.simple_title": "Simple Rubric 模式",
    "rubric.help.simple_step1": "在侧边栏配置 LLM API",
    "rubric.help.simple_step2": "输入清晰的任务描述",
    "rubric.help.simple_step3": "可选：添加使用场景和示例查询",
    "rubric.help.simple_step4": "点击「生成 Rubric」创建 Grader",
    "rubric.help.iterative_title": "Iterative Rubric 模式",
    "rubric.help.iterative_step1": "准备标注好的训练数据（JSON/JSONL/CSV）",
    "rubric.help.iterative_step2": "上传数据文件",
    "rubric.help.iterative_step3": "配置高级设置（可选）",
    "rubric.help.iterative_step4": "生成数据驱动的 Rubrics",
    "rubric.help.tips_title": "提升效果的技巧",
    "rubric.help.tip1": "明确描述您的系统功能",
    "rubric.help.tip2": "说明目标用户群体和使用场景",
    "rubric.help.tip3": "列出您关心的质量维度",
    "rubric.help.tip4": "提供有代表性的示例查询",
    "rubric.help.export_title": "导出选项",
    "rubric.help.export_desc": "将生成的 Grader 导出为 Python 代码直接使用，或导出为 YAML/JSON 配置集成到现有工作流。",
}
