mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 06:50:53 +00:00
feat(plugin): extract i18n language pack to src/i18n.ts
This commit is contained in:
parent
c8b18a7379
commit
8dd270f8ce
1 changed files with 424 additions and 0 deletions
424
paperforge/plugin/src/i18n.ts
Normal file
424
paperforge/plugin/src/i18n.ts
Normal file
|
|
@ -0,0 +1,424 @@
|
|||
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 all literature metadata (papers, assets, aliases, reading events), provides FTS5 full-text search across titles/abstracts/authors/collections, and enables the agent-context and paper-status commands. 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',
|
||||
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',
|
||||
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_sys_hint: 'These folders live at the vault root, outside the resources directory:',
|
||||
wizard_title: 'PaperForge Setup Wizard',
|
||||
},
|
||||
|
||||
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 全文检索(可搜索标题、摘要、作者、分类),并为 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 运行时版本的匹配情况',
|
||||
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: '安装',
|
||||
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_sys_hint: '独立于资源目录的系统文件:',
|
||||
wizard_title: 'PaperForge 安装向导',
|
||||
},
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
Loading…
Reference in a new issue