lllin000_PaperForge/paperforge/plugin/src/i18n.ts
LLLin000 b4ac277438 Merge branch 'feat/retrieval-recovery'
# Conflicts:
#	paperforge/commands/embed.py
2026-07-11 01:26:37 +08:00

652 lines
33 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { App } from "obsidian";
const LANG: Record<string, Record<string, string>> = {
en: {
action_running: "Running ",
api_key_missing: "Missing",
api_key_set: "Entered",
btn_install: "Open Setup Wizard",
btn_install_desc:
"Check whether the environment is ready, then open the step-by-step setup wizard",
btn_reconfig: "Reconfigure",
btn_reconfig_desc:
"Open the setup wizard again to change directories, platform, or API keys",
btn_validate: "Validate",
check_bbt_fail: "Not detected",
check_bbt_ok: "Installed",
check_python_fail: "Not found",
check_python_ok: "Ready",
check_zotero_fail: "Not detected",
check_zotero_ok: "Found",
complete_export_path: "Save Better BibTeX JSON exports into:",
complete_next: "Recommended next steps",
complete_step1: "Open Dashboard",
complete_step1_desc:
'Press Ctrl+P and run "PaperForge: Open Main Panel", or click the PaperForge icon in the left sidebar.',
complete_step2: "Sync Literature",
complete_step2_desc:
"In the main panel, click Sync Library to bring papers from Zotero into Obsidian and generate notes.",
complete_step3: "Run OCR",
complete_step3_desc:
"In the Obsidian Base view, mark do_ocr:true on papers, then run OCR in the main panel.",
complete_step4: "Configure Better BibTeX Auto-export",
complete_step4_desc:
'In Zotero, right-click the library or collection you want to sync -> Export -> Better BibTeX JSON -> enable "Keep updated".',
complete_summary: "Saved Configuration",
complete_title: "Setup Complete",
copied: "Copied!",
copy_pf_deep_cmd: "Copy /pf-deep Command",
dashboard_drift_warning:
"PaperForge CLI (v{0}) differs from plugin (v{1}). Open Settings → Runtime Health to sync.",
deep_reading_not_found: "Deep reading file not found",
desc: "Obsidian + Zotero literature pipeline. Sync papers, generate notes, run OCR, and read deeply in one place.",
dir_base: "Base Dir",
dir_index: "Index Dir",
dir_notes: "Notes Dir",
dir_resources: "Resource Dir",
dir_system: "System Dir",
dir_vault: "Vault Path",
error_copied: "Copied!",
error_copy_diagnostic: "Copy diagnostic",
feat_agent_platform: "Agent Platform",
feat_agent_platform_desc:
"Select which agent platform to manage skills for.",
feat_api_base_url: "API Base URL",
feat_api_base_url_desc:
"Custom OpenAI-compatible API endpoint. Leave empty for default.",
feat_api_model: "API Model",
feat_api_model_desc: "Embedding model name for this endpoint.",
feat_build_btn: "Build",
feat_build_complete: "Vector build complete.",
feat_build_failed: "Build failed. See terminal output.",
feat_building: "Building...",
feat_cache_remove_failed: "Failed: {0}",
feat_cache_removed: "Model cache removed.",
feat_checking: "Checking...",
feat_checking_btn: "Checking...",
feat_deps_checking: "Checking dependencies...",
feat_deps_missing:
"Dependencies not installed. Required: chromadb, openai.",
feat_enter_key: "Enter a valid OpenAI API key.",
feat_install_btn: "Install",
feat_install_deps: "Install Dependencies",
feat_install_deps_desc: "pip install chromadb openai (~35MB).",
feat_install_done: "Dependencies installed. Building vectors...",
feat_install_failed: "Install failed: ",
feat_installing: "Installing...",
feat_installing_pkgs: "Installing {pkgs}...",
feat_key_rejected: "API key rejected.",
feat_memory_desc:
"The Memory Layer is the core data engine of PaperForge, powered by SQLite. It integrates literature metadata (papers, assets, aliases, reading events), provides FTS5 metadata search across titles, abstracts, authors, domains, and collections, and powers agent-context and paper-status. Always active — no toggle needed.",
feat_memory_rebuild_btn: "Rebuild",
feat_memory_rebuild_done: "Memory DB rebuilt.",
feat_memory_rebuild_failed: "Rebuild failed.",
feat_memory_rebuilding: "Rebuilding...",
feat_model_changed_warn:
"Model changed ({0} -> {1}). Existing vectors are incompatible — rebuild required.",
feat_network_error: "Network error: ",
feat_no_python: "No Python found. Check Installation tab.",
feat_not_cached: "Not cached",
feat_openai_key: "OpenAI API Key",
feat_openai_key_desc:
"Used for API embedding calls. Model is defined below.",
feat_output_copied: "Output copied to clipboard.",
feat_rebuild_btn: "Rebuild",
feat_rebuild_vectors: "Rebuild Vectors",
feat_rebuild_vectors_changed:
"Model changed — rebuild to update all vectors.",
feat_rebuild_vectors_desc:
"Rebuild all OCR fulltext vectors. Required after model or mode change.",
feat_removing: "Removing...",
feat_retry_btn: "Retry",
feat_skills_desc:
"Manage and enable/disable agent skills installed in your vault. Each row corresponds to a SKILL.md file — toggle off to prevent the agent from auto-invoking that skill.",
feat_skills_system:
"System Skills ship with PaperForge and are updated alongside PaperForge.",
feat_skills_user:
"User Skills are custom skills you install from community or create yourself.",
feat_uninstall_btn: "Uninstall",
feat_valid_key: "API key valid.",
feat_vector_config_label: "Vector Settings",
feat_vector_corrupted: "Vector index corrupted — needs force rebuild.",
feat_vector_desc:
"Vector Database enables semantic search across OCR-extracted fulltext via API embedding. Documents are split into chunks, embedded via OpenAI-compatible API, and stored in ChromaDB.",
feat_vector_enable: "Enable Vector Retrieval",
feat_vector_enable_desc:
"Semantic search across OCR fulltext. Requires: pip install openai chromadb (~35MB).",
feat_vector_rebuild_force_btn: "Force Rebuild",
feat_verify: "Verify",
feat_verify_btn: "Verify",
field_paddleocr: "PaddleOCR API Key",
field_python_custom: "Custom Path",
field_python_interp: "Python Interpreter",
field_zotero_data: "Zotero Data Dir",
field_zotero_placeholder:
"Required. Path to Zotero data directory for PDF attachment resolution.",
guide_ocr: "Run OCR",
guide_ocr_desc:
"In the main panel, click Run OCR to extract full text and figures from PDFs for later reading and analysis.",
guide_open: "Open Main Panel",
guide_open_desc:
'Press Ctrl+P and run "PaperForge: Open Main Panel", or click the PaperForge icon in the left sidebar.',
guide_sync: "Sync Literature",
guide_sync_desc:
"After Better BibTeX JSON export is configured, click Sync Library to import papers from Zotero into Obsidian and generate notes automatically.",
header_title: "PaperForge",
install_bootstrapping:
"PaperForge Python package not found. Installing automatically...",
install_btn: "Start Install",
install_btn_retry: "Retry",
install_btn_running: "Installing...",
install_complete: "Installation complete!",
install_failed: "Installation failed: ",
install_validating: "Validating setup...",
jump_to_deep_reading: "Open Deep Reading",
label_agent: "Agent Platform",
nav_close: "Close",
nav_next: "Next",
nav_prev: "Back",
not_set: "Not entered",
notice_check_fail: "Missing: ",
notice_python_missing:
"Python was not detected. Install Python 3.10+ and add it to PATH.",
ocr_privacy_title: "OCR Privacy Notice",
ocr_privacy_warning:
"OCR will upload PDFs to the PaddleOCR API. Do not upload sensitive or confidential documents.",
ocr_queue_add: "Add to OCR Queue",
ocr_queue_added: "Added to OCR queue",
ocr_queue_remove: "Remove from OCR Queue",
ocr_queue_removed: "Removed from OCR queue",
ocr_understand: "I understand, continue",
optional_later: "(can be set later in Settings)",
orphan_delete_failed: "Prune failed",
orphan_delete_selected: "Delete {count} selected",
orphan_deleted: "Deleted {count} orphan workspace(s)",
orphan_desc: "These papers are no longer in your Zotero library.",
orphan_deselect_all: "Deselect all",
orphan_explain: "Removed from Zotero. Workspace files remain on disk.",
orphan_keep_all: "Keep all",
orphan_none_selected: "No papers selected for deletion",
orphan_select_all: "Select all",
orphan_title: "Found {count} orphan paper(s)",
panel_actions: "Quick Actions",
prep_bbt: "Better BibTeX",
prep_bbt_desc: "In Zotero: Tools -> Add-ons -> install Better BibTeX.",
prep_export: "Better BibTeX Auto-export",
prep_export_desc:
'In Zotero, right-click the collection you want to sync -> Export Collection -> BetterBibTeX JSON -> enable "Keep updated" -> save the JSON file into the exports folder shown below. Obsidian Base views will use the JSON filename as the Base name:',
prep_export_path_label: "Save the exported JSON file into this folder:",
prep_key: "PaddleOCR Key",
prep_key_desc: "Get your API key from https://aistudio.baidu.com/paddleocr",
prep_python: "Python 3.10+",
prep_python_desc:
"Python must be available from the command line. If you are not sure, click below to auto-detect.",
prep_zotero: "Zotero Desktop",
prep_zotero_desc: "Install Zotero from https://www.zotero.org",
run_in_agent: "Run in {0}",
runtime_health: "Runtime Health",
runtime_health_checking: "Checking...",
runtime_health_desc:
"Check whether the installed paperforge Python package matches the plugin version and whether the deployed skill contract is current.",
runtime_health_match: "Match",
runtime_health_mismatch: "Mismatch",
runtime_health_package_ver: "Python package v{0}",
runtime_health_plugin_ver: "Plugin v{0}",
runtime_health_sync: "Sync Runtime",
runtime_health_sync_done: "Runtime synced to v{0}",
runtime_health_sync_fail: "Sync failed: {0}",
runtime_health_syncing: "Syncing...",
section_config: "Current Configuration",
section_guide: "How To Use",
section_prep: "Preparation",
section_prep_desc:
"Before first use, finish these 4 preparation items. Better BibTeX auto-export is configured after setup:",
setup_done: "PaperForge environment is ready",
setup_pending:
"Not installed yet. Finish the preparation items below, then open the wizard.",
tab_features: "Features",
tab_setup: "Installation",
tab_maintenance: "Maintenance",
validate_base: "Base directory is required",
validate_fail: "Please complete the required fields below",
validate_index: "Index directory is required",
validate_key: "PaddleOCR API key (optional, needed for OCR)",
validate_notes: "Notes directory is required",
validate_resources: "Resources directory is required",
validate_system: "System directory is required",
validate_vault: "Vault path is required",
validate_zotero: "Zotero data directory (optional, needed for PDF linking)",
wizard_agent_hint:
"Choose the AI agent platform you use most often. PaperForge will place the matching command and skill files in the correct location.",
wizard_dir_hint:
"PaperForge stores user-facing literature data under the resources directory. These folders will live there:",
wizard_dir_sub_hint: "Resolved folder preview based on the names below:",
wizard_intro:
"This wizard walks you through the full setup. In most cases, the default values are fine to keep.",
wizard_keys_hint:
"Enter your PaddleOCR API key below. If you want PaperForge to auto-locate Zotero PDFs, you can also fill in the Zotero data directory.",
wizard_preview:
"After installation, system files stay at the vault root while literature data stays under the resources directory.",
wizard_safety:
"Safety: if the selected folders already contain files, setup preserves existing files and only creates missing PaperForge folders and files.",
wizard_step1: "Overview",
wizard_step2: "Directory Setup",
wizard_step3: "Platform & Keys",
wizard_step4: "Install",
wizard_step5: "Done",
wizard_skip_ocr_desc:
"OCR will not be available until you configure a valid PaddleOCR API key. You can continue setup now and configure it later in Settings.",
wizard_skip_ocr_continue: "Continue without OCR key",
wizard_skip_ocr_back: "Back to configure",
wizard_api_hint_skip:
"OCR key is optional — you may skip it and configure later.",
wizard_sys_hint:
"These folders live at the vault root, outside the resources directory:",
wizard_title: "PaperForge Setup Wizard",
ocr_maint_no_action: "No Action Needed",
ocr_maint_rebuild: "Rebuild Recommended",
ocr_maint_failed: "OCR Failed",
ocr_maint_limited: "Result Limited",
ocr_maint_needs_attention: "Needs Attention",
ocr_maint_limitations: "Result Limitations",
ocr_maint_hero_ok: "OCR looks usable overall.",
ocr_maint_hero_warn:
"OCR needs attention: {rebuild} rebuild recommended, {failed} failed.",
ocr_maint_hero_note:
"This page only promotes issues where maintenance is likely to help. Some papers may have limitations that maintenance will not improve.",
ocr_maint_limitations_intro:
"These papers look less certain, but PaperForge does not currently have a high-confidence maintenance action to recommend.",
ocr_maint_all_papers: "All Papers",
ocr_maint_rebuild_btn: "Rebuild results",
ocr_maint_redo_btn: "Rerun OCR",
maintenance_group_retry: "Needs Retry",
maintenance_group_rebuild: "Can Rebuild",
maintenance_group_legacy: "Upgrade Available (Optional)",
maintenance_btn_retry: "Retry",
maintenance_btn_rebuild: "Rebuild",
maintenance_btn_upgrade: "Upgrade",
maintenance_refresh_spinning: "Updating…",
maintenance_all_good: "✅ All good — no action needed",
maintenance_n_pending: "{n} need attention",
version_panel_title: "Version History",
version_panel_back: "Back",
version_filter_placeholder: "Filter papers...",
version_papers_count: "{n} papers",
version_current: "current",
version_restore_btn: "Restore",
version_compare_btn: "Compare",
version_restore_selected: "Restore selected",
version_clear_old: "Clear old versions (free {size})",
version_no_backups: "No version history available",
version_restore_confirm: "Restore {label} for {paper}?",
version_restore_done: "Restored {label}",
version_compare_title: "{vA} vs {vB}",
version_compare_paragraphs: "{n} paragraphs changed",
version_error_read: "Cannot read version data",
retrieval_search_placeholder: "Search papers... (@ for deep search)",
retrieval_search_placeholder_deep: "Search papers via deep retrieval...",
retrieval_search_idle_hint:
"Type to search metadata, or start with @ for deep semantic search",
retrieval_searching_metadata: "Searching metadata...",
retrieval_searching_deep: "Running deep search...",
retrieval_search_cancel: "Cancel",
retrieval_results_count: "{n} result{s}",
retrieval_empty: "No matching papers found.",
retrieval_empty_tips: "Try broader terms or @ deep search.",
retrieval_vectors_not_built: "Vectors Not Built",
retrieval_vectors_not_built_desc:
"Vector index has not been built. Search requires a built vector index.",
retrieval_open_vector_settings: "Open Vector Settings",
retrieval_backend_unavailable: "Backend Unavailable",
retrieval_backend_unavailable_desc:
"The Python CLI search backend is not responding.",
retrieval_run_doctor: "Run Doctor",
retrieval_retry: "Retry",
retrieval_timeout_title: "Search Timed Out",
retrieval_timeout_desc:
"The search took too long. You can retry or try a simpler query.",
retrieval_model_changed: "Model Changed",
retrieval_model_changed_desc:
"The embedding model has changed since vectors were built. Rebuilding is required.",
retrieval_rebuild_vectors: "Rebuild Vectors",
retrieval_internal_error:
"An internal error occurred. Check the console for details.",
retrieval_build_idle: "Vectors not yet built",
retrieval_build_ready: "Vectors ready",
retrieval_build_stopping: "Stopping...",
retrieval_build_stopped: "Build stopped. Resume to continue.",
retrieval_build_failed: "Build failed",
retrieval_build_stale:
"Previous build was interrupted. Resume to continue.",
retrieval_build_deps_missing: "Dependencies not installed",
retrieval_build_runtime_mismatch: "Plugin and CLI versions differ",
retrieval_stop: "Stop",
retrieval_force_rebuild: "Force Rebuild",
retrieval_rebuild_warning:
"Rebuild will replace {n} existing chunk(s). Continue?",
retrieval_no_python: "No Python found. Check Installation tab.",
},
zh: {
action_running: "正在执行 ",
api_key_missing: "未配置 ✗",
api_key_set: "已配置 ✓",
btn_install: "打开安装向导",
btn_install_desc: "自动检测 Python + 前置环境,通过后打开分步安装向导",
btn_reconfig: "重新配置",
btn_reconfig_desc: "重新运行安装向导,修改目录或密钥配置",
btn_validate: "验证",
check_bbt_fail: "未检测到",
check_bbt_ok: "已安装",
check_python_fail: "未安装",
check_python_ok: "已就绪",
check_zotero_fail: "未检测到",
check_zotero_ok: "已安装",
complete_next: "下一步操作",
complete_step1: "打开 PaperForge Dashboard",
complete_step1_desc:
"Ctrl+P → 输入 PaperForge: Open Dashboard或点左侧书本图标",
complete_step2: "同步文献",
complete_step2_desc:
"Dashboard 中点 Sync Library从 Zotero 拉取文献生成笔记",
complete_step3: "运行 OCR",
complete_step3_desc: "Dashboard 中点 Run OCR提取 PDF 全文与图表",
complete_step4: "配置 BBT 自动导出",
complete_summary: "当前完整配置",
complete_title: "✓ PaperForge 安装完成",
copied: "已复制!",
copy_pf_deep_cmd: "复制 /pf-deep 命令",
dashboard_drift_warning:
'插件版本与 Python 运行时版本不匹配。请在设置中点击"同步运行时"。',
deep_reading_not_found: "精读文件未找到",
desc: "Obsidian + Zotero 文献管理流水线。自动同步文献、生成笔记、OCR 提取全文,一站式文献精读工作流。",
dir_base: "Base 目录",
dir_index: "索引目录",
dir_notes: "正文目录",
dir_resources: "资源目录",
dir_system: "系统目录",
dir_vault: "Vault 路径",
error_copied: "已复制!",
error_copy_diagnostic: "复制诊断信息",
feat_agent_platform: "Agent 平台",
feat_agent_platform_desc: "选择要管理的 Agent 平台。",
feat_api_base_url: "API 地址",
feat_api_base_url_desc: "自定义 OpenAI 兼容 API 端点。留空使用默认地址。",
feat_api_model: "API 模型",
feat_api_model_desc: "该端点使用的嵌入模型名称。",
feat_build_btn: "构建",
feat_build_complete: "向量构建完成。",
feat_build_failed: "构建失败。请查看终端输出。",
feat_building: "构建中…",
feat_cache_remove_failed: "失败:{0}",
feat_cache_removed: "模型缓存已清除。",
feat_checking: "检测中…",
feat_checking_btn: "检测中…",
feat_deps_checking: "正在检测依赖…",
feat_deps_missing: "依赖未安装。需要chromadb, openai。",
feat_enter_key: "请输入有效的 OpenAI API Key。",
feat_install_btn: "安装",
feat_install_deps: "安装依赖",
feat_install_done: "依赖已安装。正在构建向量…",
feat_install_failed: "安装失败:",
feat_installing: "安装中…",
feat_installing_pkgs: "正在安装 {pkgs}...",
feat_key_rejected: "API Key 被拒绝。",
feat_memory_desc:
"记忆层是 PaperForge 的核心数据引擎,基于 SQLite 构建。它整合了文献元数据(论文、资源文件、别名、阅读事件),支持 FTS5 元数据检索标题、摘要、作者、domain、collection并为 agent-context 和 paper-status 命令提供数据支撑。始终运行,无需手动开启。",
feat_memory_rebuild_btn: "重建数据库",
feat_memory_rebuild_done: "记忆数据库重建完成。",
feat_memory_rebuild_failed: "重建失败。",
feat_memory_rebuilding: "重建中…",
feat_model: "模型",
feat_model_changed_warn:
"模型已更换({0} -> {1})。已有向量不兼容——需要重建。",
feat_network_error: "网络错误:",
feat_no_python: "未找到 Python。请查看安装标签页。",
feat_not_cached: "未缓存",
feat_openai_key: "OpenAI API Key",
feat_openai_key_desc: "用于 API 嵌入调用,模型在下方定义。",
feat_output_copied: "输出已复制到剪贴板。",
feat_rebuild_btn: "重建",
feat_rebuild_vectors: "重建向量",
feat_rebuild_vectors_changed: "模型已更换 — 需要重建向量。",
feat_rebuild_vectors_desc:
"重建所有 OCR 全文向量。更换模型或模式后需要重建。",
feat_removing: "删除中…",
feat_retry_btn: "重试",
feat_skills_desc:
"管理 Vault 中已安装的 Agent 技能。每行对应一个 SKILL.md 文件,关闭开关可阻止 Agent 自动调用该技能。",
feat_skills_system:
"系统技能随 PaperForge 一同发布,会跟随 PaperForge 版本更新。",
feat_skills_user: "用户技能是你自行安装或创建的自定义技能。",
feat_uninstall_btn: "卸载",
feat_valid_key: "API Key 有效。",
feat_vector_config_label: "向量库配置",
feat_vector_corrupted: "向量索引已损坏 — 需要强制重建。",
feat_vector_desc:
"向量数据库通过嵌入模型实现 OCR 全文的语义搜索。文档被切分为文本块chunk编码为向量存入 ChromaDB。支持本地模型免费CPU 运行)或 OpenAI API付费更快速。",
feat_vector_enable: "启用向量检索",
feat_vector_enable_desc:
"对 OCR 全文进行语义搜索。需安装: pip install chromadb sentence-transformers openai (~500MB)。",
feat_vector_rebuild_force_btn: "强制重建",
feat_verify: "验证",
feat_verify_btn: "验证",
field_paddleocr: "PaddleOCR API 密钥",
field_python_custom: "自定义 Python 路径",
field_python_interp: "当前 Python 解释器",
field_zotero_data: "Zotero 数据目录",
field_zotero_placeholder: "可选,用于自动检测 PDF",
guide_ocr: "运行 OCR",
guide_ocr_desc: "Dashboard 中点 Run OCR提取 PDF 全文与图表",
guide_open: "打开 Dashboard",
guide_open_desc:
"Ctrl+P → 输入 PaperForge: Open Dashboard或点左侧书本图标",
guide_sync: "同步文献",
guide_sync_desc: "Dashboard 中点 Sync Library从 Zotero 拉取文献生成笔记",
header_title: "PaperForge",
install_bootstrapping: "未检测到 PaperForge Python 包,正在自动安装…",
install_btn: "开始安装",
install_btn_retry: "重试",
install_btn_running: "正在安装...",
install_complete: "✓ 安装完成!",
install_failed: "✗ 安装失败:",
install_validating: "正在校验安装环境…",
jump_to_deep_reading: "跳转到精读",
label_agent: "Agent 平台",
nav_close: "关闭",
nav_next: "下一步 →",
nav_prev: "← 上一步",
no_pending_ocr: "所有 OCR 任务已完成",
not_set: "未设置",
notice_check_fail: "未通过: ",
notice_python_missing: "Python 未检测到,请先安装 Python 3.10+ 并加入 PATH",
ocr_privacy_title: "OCR 隐私提示",
ocr_privacy_warning:
"OCR 会将 PDF 上传到 PaddleOCR API 进行处理。请不要上传包含敏感信息或无法外传的文献。",
ocr_queue_add: "加入 OCR 队列",
ocr_queue_added: "已加入 OCR 队列",
ocr_queue_remove: "移出 OCR 队列",
ocr_queue_removed: "已移出 OCR 队列",
ocr_understand: "我了解,继续",
optional_later: "(稍后可在设置中补充)",
orphan_delete_failed: "清理失败",
orphan_delete_selected: "删除 {count} 篇",
orphan_deleted: "已删除 {count} 篇残留文献",
orphan_desc: "这些文献已从 Zotero 中移除。",
orphan_deselect_all: "取消全选",
orphan_explain: "已从 Zotero 中移除。工作区文件仍保留在磁盘上。",
orphan_keep_all: "保留全部",
orphan_none_selected: "未选择任何文献",
orphan_select_all: "全选",
orphan_title: "发现 {count} 篇残留文献",
panel_actions: "快捷操作",
prep_bbt: "Better BibTeX",
prep_bbt_desc: "Zotero → 工具 → 插件 → 安装 Better BibTeX",
prep_export: "BBT 自动导出",
prep_export_desc:
"右键文献子分类 → 导出分类 → BetterBibTeX JSON → 勾选保持更新 → 导出到JSON 文件名即为 Base 名):",
prep_key: "PaddleOCR Key",
prep_key_desc: "在 https://aistudio.baidu.com/paddleocr 获取 API Key",
prep_python: "Python 3.10+",
prep_python_desc: "确保 Python 可命令行调用。点击下方按钮自动检测。",
prep_zotero: "Zotero 桌面版",
prep_zotero_desc: "安装 Zotero (https://www.zotero.org)",
run_in_agent: "在 {0} 中运行",
runtime_health: "运行时状态",
runtime_health_checking: "正在检测…",
runtime_health_desc:
"检查插件与 Python 运行时版本的匹配情况,并确认已部署的 skill contract 是否为当前版本。",
runtime_health_match: "匹配",
runtime_health_mismatch: "不匹配",
runtime_health_package_ver: "Python 包 v{0}",
runtime_health_plugin_ver: "插件 v{0}",
runtime_health_sync: "同步运行时",
runtime_health_sync_done: "运行时已同步至 v{0}",
runtime_health_sync_fail: "运行时同步失败:{0}",
runtime_health_syncing: "正在同步…",
section_config: "当前配置",
section_guide: "操作方式",
section_prep: "安装准备",
section_prep_desc: "首次使用前,请依次完成以下准备:",
setup_done: "✓ PaperForge 环境已配置完成",
setup_pending: "尚未安装,完成安装准备后点击安装向导",
tab_features: "功能",
tab_setup: "安装",
tab_maintenance: "维护",
validate_base: "Base 目录未填写",
validate_fail: "配置验证失败",
validate_index: "索引目录未填写",
validate_key: "PaddleOCR API 密钥未填写",
validate_notes: "正文目录未填写",
validate_resources: "资源目录未填写",
validate_system: "系统目录未填写",
validate_vault: "Vault 路径未填写",
validate_zotero: "Zotero 数据目录为必填项",
wizard_agent_hint:
"选择你使用的 AI Agent 平台,安装时将按对应格式部署技能文件:",
wizard_dir_hint:
"资源目录是文献数据的统一根目录,以下子目录将创建在其内部:",
wizard_dir_sub_hint: "资源目录内的两个子目录:",
wizard_intro:
"本向导将引导您完成 PaperForge 环境的完整配置。安装过程会自动创建所有目录结构,无需手动操作。",
wizard_keys_hint: "以下为 API 密钥与 Zotero 配置:",
wizard_preview:
"系统文件和 Agent 配置位于 Vault 根目录下。文献数据(正文、索引)统一存放在资源目录内。安装后仍可在设置中修改。",
wizard_safety:
"安全说明:如果你选择的目录里已经有文件,安装向导会保留已有内容,只补充缺失的 PaperForge 文件和目录。",
wizard_step1: "概览",
wizard_step2: "目录",
wizard_step3: "Agent",
wizard_step4: "安装",
wizard_step5: "完成",
wizard_skip_ocr_desc:
"OCR 功能在配置有效的 PaddleOCR API 密钥之前不可用。您可以继续完成设置,稍后在设置中配置。",
wizard_skip_ocr_continue: "继续,稍后配置密钥",
wizard_skip_ocr_back: "返回配置",
wizard_api_hint_skip: "OCR 密钥为选填项 — 可跳过,稍后在设置中配置。",
wizard_sys_hint: "独立于资源目录的系统文件:",
wizard_title: "PaperForge 安装向导",
ocr_maint_no_action: "无需处理",
ocr_maint_rebuild: "建议重建",
ocr_maint_failed: "OCR 失败",
ocr_maint_limited: "结果一般",
ocr_maint_needs_attention: "需要处理",
ocr_maint_limitations: "结果说明",
ocr_maint_hero_ok: "OCR 整体正常。",
ocr_maint_hero_warn:
"OCR 需要关注:{rebuild} 篇建议重建,{failed} 篇处理失败。",
ocr_maint_hero_note:
"本页只提示维护后大概率会改善的问题。部分论文效果一般,维护未必能改善。",
ocr_maint_limitations_intro:
"这类论文通常表示版式复杂或信号偏弱PaperForge 目前没有高置信度的维护建议。",
ocr_maint_all_papers: "全部论文",
ocr_maint_rebuild_btn: "重建结果",
maintenance_group_retry: "需要重试",
maintenance_group_rebuild: "可重建结果",
maintenance_group_legacy: "可升级旧结果(可选)",
maintenance_btn_retry: "重试",
maintenance_btn_rebuild: "重建",
maintenance_btn_upgrade: "升级",
maintenance_refresh_spinning: "正在更新…",
maintenance_all_good: "✅ 全部正常",
maintenance_n_pending: "{n} 篇需要处理",
version_panel_title: "版本历史",
version_panel_back: "返回",
version_filter_placeholder: "搜索论文...",
version_papers_count: "{n} 篇论文",
version_current: "当前",
version_restore_btn: "恢复",
version_compare_btn: "对比",
version_restore_selected: "恢复选中版本",
version_clear_old: "清除旧版本 (释放 {size})",
version_no_backups: "没有可恢复的历史版本",
version_restore_confirm: "确认将 {paper} 恢复到 {label}",
version_restore_done: "已恢复到 {label}",
version_compare_title: "{vA} vs {vB}",
version_compare_paragraphs: "{n} 段有变化",
version_error_read: "无法读取版本数据",
retrieval_search_placeholder: "搜索论文... (@ 进行深度搜索)",
retrieval_search_placeholder_deep: "通过深度检索搜索论文...",
retrieval_search_idle_hint:
"输入关键字搜索元数据,或以 @ 开头进行深度语义搜索",
retrieval_searching_metadata: "正在搜索元数据...",
retrieval_searching_deep: "正在运行深度搜索...",
retrieval_search_cancel: "取消",
retrieval_results_count: "找到 {n} 条结果",
retrieval_empty: "未找到匹配的论文。",
retrieval_empty_tips: "尝试更宽泛的关键词,或使用 @ 进行深度搜索。",
retrieval_vectors_not_built: "向量索引未构建",
retrieval_vectors_not_built_desc:
"向量索引尚未构建,搜索需要先构建向量索引。",
retrieval_open_vector_settings: "打开向量设置",
retrieval_backend_unavailable: "后端不可用",
retrieval_backend_unavailable_desc: "Python CLI 搜索后端无响应。",
retrieval_run_doctor: "运行诊断",
retrieval_retry: "重试",
retrieval_timeout_title: "搜索超时",
retrieval_timeout_desc: "搜索耗时过长。你可以重试,或尝试简化查询。",
retrieval_model_changed: "模型已更换",
retrieval_model_changed_desc: "嵌入模型已更换,需要重建向量。",
retrieval_rebuild_vectors: "重建向量",
retrieval_internal_error: "发生内部错误。请查看控制台了解详情。",
retrieval_build_idle: "向量索引尚未构建",
retrieval_build_ready: "向量索引就绪",
retrieval_build_stopping: "正在停止…",
retrieval_build_stopped: "构建已停止。点击继续以恢复。",
retrieval_build_failed: "构建失败",
retrieval_build_stale: "上次构建被中断。点击继续以恢复。",
retrieval_build_deps_missing: "依赖未安装",
retrieval_build_runtime_mismatch: "插件与 CLI 版本不匹配",
retrieval_stop: "停止",
retrieval_force_rebuild: "强制重建",
retrieval_rebuild_warning: "重建将替换 {n} 个已有的 chunk。是否继续",
retrieval_no_python: "未找到 Python。请查看安装标签页。",
},
};
let T: Record<string, string> | null = null;
export function langFromApp(app: App): "zh" | "en" {
try {
const vault = app.vault as unknown as Record<string, unknown>;
if (typeof vault.getConfig === "function") {
const l = vault.getConfig("language") as string;
if (l && String(l).startsWith("zh")) return "zh";
}
} catch {}
try {
if (typeof localStorage !== "undefined") {
const l = localStorage.getItem("language");
if (l && String(l).startsWith("zh")) return "zh";
}
} catch {}
return "en";
}
export function setLanguage(app: App): void {
T = langFromApp(app) === "zh" ? LANG.zh : LANG.en;
}
export function t(key: string): string {
return (T && T[key]) || LANG.en[key] || key;
}