// home + fileTree + fileImport + dirView + view + findInPage + importHistory

function spaceDraftsPath(spacePath: string): string {
  return `${spacePath.replace(/\/?$/, '/')}Drafts/`;
}

export const knowledgeEn = {
  home: {
    recentlyModified: 'Recently Modified',
    recentlyActive: 'Recently Active',
    recentlyEdited: 'Recently Edited',
    allSpaces: 'All Spaces',
    spaces: 'Spaces',
    nFiles: (n: number) => `${n} file${n === 1 ? '' : 's'}`,
    other: 'Other',
    newSpace: 'New Space',
    spaceName: 'Space name',
    spaceDescription: 'Description',
    spaceDescPlaceholder: 'Describe the purpose of this space',
    spaceNameNoSlash: 'Name cannot contain / or \\',
    spaceExists: 'A space with this name already exists',
    spaceCreateFailed: 'Failed to create space',
    noSpacesYet: 'No spaces yet. Create one to organize your knowledge.',
    spaceLocation: 'Location',
    rootLevel: 'Root',
    optional: 'optional',
    aiInit: 'AI initialize content',
    aiInitHint: 'AI will generate a description and guidelines for this space',
    aiInitNoKey: 'Configure an API key in Settings → AI to enable',
    aiInitGenerating: (name: string) => `Generating content for ${name}`,
    aiInitReady: (name: string) => `${name} ready`,
    aiInitReview: 'Review',
    aiInitDiscard: 'Discard',
    aiInitReverted: (name: string) => `${name} reverted to template`,
    createSpace: 'Create',
    cancelCreate: 'Cancel',
    continueEditing: 'Continue editing',
    newNote: 'New Notes',
    mindTagline: 'Local Markdown, organized as your personal Mind.',
    builtInSpacesTitle: 'Mind System',
    builtInSpacesDesc: 'MindOS maps built-in semantic modules to your local folders. The visible folders stay user-owned Markdown; the module registry stays in .mindos.',
    builtInSpacesReview: 'Review loop',
    mindAssistant: {
      label: 'Assistant',
      spaceTitle: 'Assistants',
      instructionReady: 'Instruction ready',
      instructionMissing: 'Instruction missing',
      customDrafts: (n: number) => `${n} draft${n === 1 ? '' : 's'}`,
      runOnce: 'Run once',
      view: 'View',
      hide: 'Hide',
      edit: 'Edit',
      editAssistant: 'Edit',
      promptReady: 'Prompt ready',
      promptMissing: 'Prompt missing',
      promptFile: 'Prompt',
      profileFile: 'Profile',
      promptEditor: 'Assistant prompt',
      assistantName: 'Name',
      assistantDescription: 'Description',
      loadingPrompt: 'Loading prompt...',
      loadPromptFailed: 'Failed to load prompt',
      promptMissingHint: 'Prompt file is missing. Saving here will create it.',
      promptEmpty: 'Prompt cannot be empty.',
      unsavedChanges: 'Unsaved changes',
      savedState: 'Saved',
      promptCharacters: (n: number) => `${n.toLocaleString()} chars`,
      resetChanges: 'Reset',
      saveChanges: 'Save changes',
      savingChanges: 'Saving...',
      savedChanges: 'Changes saved',
      saveChangesFailed: 'Failed to save changes',
      assistantId: 'Assistant ID',
      schedule: 'Schedule',
      close: 'Close',
      openSpace: 'Open',
      openInstruction: 'Instruction',
      openDrafts: 'Drafts',
      moreAssistants: (n: number) => `+${n} assistant${n === 1 ? '' : 's'}`,
      assistantCount: (n: number) => `${n} assistant${n === 1 ? '' : 's'}`,
      viewAllAssistants: (n: number) => `View all ${n} assistants`,
      showLessAssistants: 'Show less',
      scheduleMode: {
        manual: 'Manual',
        daily: 'Daily',
        weekly: 'Weekly',
      },
      runPrompt: (spaceTitle: string, assistantName: string, assistantDesc: string, spacePath: string, promptPath: string) => `Act as the "${assistantName}" assistant for the MindOS space "${spaceTitle}" (${spacePath}).

Assistant purpose: ${assistantDesc}

Read the assistant prompt at ${promptPath} first, then read this space's INSTRUCTION.md and inspect relevant notes in the same space. Produce one concise Markdown draft for the user to review. Do not overwrite existing canonical notes directly. If you write a file, write it under ${spaceDraftsPath(spacePath)} with a dated filename. Keep the draft focused, source-aware, and easy to accept or discard.`,
    },
    mindAssistants: {
      dao: [
        { id: 'daily-signal', name: 'Daily signal curator', desc: 'Turns direction, opportunity, and risk signals into a draft.' },
        { id: 'decision-synthesizer', name: 'Decision synthesizer', desc: 'Distills recurring choices into durable judgments.' },
      ],
      fa: [
        { id: 'rule-keeper', name: 'Rule keeper', desc: 'Collects confirmed rules, boundaries, and protocols.' },
        { id: 'boundary-reviewer', name: 'Boundary reviewer', desc: 'Checks new notes against existing commitments and limits.' },
      ],
      shu: [
        { id: 'method-organizer', name: 'Method organizer', desc: 'Turns repeated work into SOPs and checklists.' },
        { id: 'checklist-builder', name: 'Checklist builder', desc: 'Converts loose methods into repeatable execution steps.' },
      ],
      qi: [
        { id: 'tool-inventory', name: 'Tool inventory curator', desc: 'Keeps tools, templates, assets, and sources tidy.' },
        { id: 'resource-auditor', name: 'Resource auditor', desc: 'Finds stale, duplicate, or under-described resources.' },
      ],
    },
    mindPillars: {
      dao: { title: 'Dao', desc: 'Values, direction, long-term judgment' },
      fa: { title: 'Fa', desc: 'Rules, boundaries, commitments' },
      shu: { title: 'Shu', desc: 'Methods, tactics, reusable patterns' },
      qi: { title: 'Qi', desc: 'Tools, assets, channels, templates' },
    },
    builtinFeatures: 'Tools',
    builtinActive: 'Active',
    builtinInactive: 'Not active',
    toolName: {
      'agent-inspector': 'Agent Inspector',
      'config-panel': 'Config Panel',
      'todo': 'TODO Board',
      'workflow-yaml': 'Workflows',
    } as Record<string, string>,
    toolDesc: {
      'agent-inspector': 'View agent tool-call logs and audit trail',
      'config-panel': 'Edit and manage global configuration',
      'todo': 'Manage tasks as an interactive kanban board',
      'workflow-yaml': 'Execute step-by-step workflows with AI assistance',
    } as Record<string, string>,
    plugins: 'Extensions',
    changeHistory: 'Change History',
    showMore: 'Show more',
    showLess: 'Show less',
    viewAll: 'View all',
    wikiTagline: 'Your knowledge spaces, organized.',
    sortRecent: 'Recent',
    sortName: 'A-Z',
    sortCount: 'File Count',
    createToActivate: 'Create {file} to activate',
    shortcuts: {
      searchFiles: 'Search files',
      askAI: 'MindOS',
      editFile: 'Edit file',
      save: 'Save',
      settings: 'Settings',
    },
    relativeTime: {
      justNow: 'just now',
      minutesAgo: (n: number) => `${n}m ago`,
      hoursAgo: (n: number) => `${n}h ago`,
      daysAgo: (n: number) => `${n}d ago`,
    },
    cleanupExamples: (n: number) => `${n} example file${n > 1 ? 's' : ''} from the template can be removed`,
    cleanupExamplesButton: 'Clean up',
    cleanupExamplesDone: 'Example files removed',
  },
  echoSpotlight: {
    title: 'Echo',
    dailyLine: 'Today\'s thought',
    placeholder: 'A quiet line for today...',
    invite: 'Record today\'s one thought',
    inviteDesc: 'One line, no pressure. Echo reflects your thinking patterns over time.',
    goToEcho: 'Open Echo',
    savedLocally: 'Saved locally on this device',
  },
  dailyEcho: {
    // Report generation
    title: 'Daily Echo Report',
    generate: 'Generate today\'s report',
    generating: 'Generating...',
    generated: 'Generated {time}',
    regenerate: 'Regenerate',
    download: 'Download PDF',
    continueAgent: 'Continue in Agent',
    error: 'Generation failed',
    retry: 'Retry',
    // Snapshot
    snapshotTitle: '📊 Today\'s Motion',
    snapshotFilesEdited: 'Files edited',
    snapshotFilesCreated: 'Files created',
    snapshotSessions: 'Chat sessions',
    snapshotKbGrowth: 'KB growth',
    // Themes
    themesTitle: '🎯 Today\'s Themes',
    themeFiles: 'files',
    // Alignment
    alignmentTitle: '✅ Alignment',
    alignmentScore: 'Score',
    alignmentMisaligned: 'Misaligned',
    alignmentPartial: 'Partially aligned',
    alignmentAligned: 'Well aligned',
    // Reflection
    reflectionTitle: '❓ For Tomorrow',
  },
  suggestion: {
    title: 'You might want to',
    staleFiles: (n: number) => `${n} file${n !== 1 ? 's' : ''} not updated in 30+ days`,
    reviewStale: 'Review',
    dismiss: 'Dismiss',
  },
  inbox: {
    title: 'Inbox',
    subtitle: 'Save loose material. Review it when ready.',
    capturePageTitle: 'New capture',
    capturePageSubtitle: 'Paste, drop, save.',
    reviewPageTitle: 'Review queue',
    reviewPageSubtitle: '',
    shelvedPageTitle: 'Shelved',
    shelvedPageSubtitle: 'Captured items you decided to keep out of the active queue for now.',
    donePageTitle: 'Done',
    donePageSubtitle: 'Recent organization records and undo history.',
    viewCapture: 'New capture',
    viewQueue: 'Pending',
    viewShelved: 'Shelved',
    viewHistory: 'Done',
    intentSourceTitle: 'Save only',
    intentSourceDesc: 'Keep the original material safely staged.',
    intentSourceAction: 'Save only',
    intentNoteTitle: 'Make note',
    intentNoteDesc: 'Turn messy input into a readable knowledge note.',
    intentNoteAction: 'Summarize and structure',
    intentJudgmentTitle: 'Extract judgment',
    intentJudgmentDesc: 'Find decisions, preferences, rules, or reusable methods.',
    intentJudgmentAction: 'Find rules',
    intentReflectTitle: 'Reflect later',
    intentReflectDesc: 'Treat it as a signal about your interests, blind spots, or growth.',
    intentReflectAction: 'Send to Echo',
    composerTitle: 'Add to Inbox',
    composerInputLabel: 'Add a link, note, file, or source to Inbox',
    composerPlaceholder: 'Paste a link, write a note, or drop files here...',
    captureTrustLine: 'Local save',
    captureInputKinds: 'Links / Files / Notes / Drops',
    captureNoAiHint: 'Review later',
    captureAutoDetectHint: 'Auto-detects: links · PDF · images · files · notes',
    captureDropHint: 'Paste, type, or drop files.',
    currentDraftHint: (words: number) => `Draft note · ${words} words`,
    captureSessionCount: (n: number) => `${n} in this batch`,
    composerDetected: 'Detected',
    captureAffordanceLink: 'Link',
    captureAffordanceLinkDesc: 'YouTube, Bilibili, XHS',
    captureAffordanceNote: 'Note',
    captureAffordanceNoteDesc: 'Thoughts, excerpts, drafts',
    captureAffordanceFile: 'File',
    captureAffordanceFileDesc: 'PDF, Markdown, docs',
    captureAffordanceDrop: 'Drop',
    captureAffordanceDropDesc: 'Files or page links',
    attachButton: 'Attach',
    stageNoteAction: 'Stage as note',
    stageNoteShortcut: '⌘/Ctrl Enter',
    captureButton: 'Save to Inbox',
    captureButtonCount: (n: number) => `Save ${n} to Inbox`,
    organizeToMindAction: 'Organize to Mind',
    organizeToMindRunning: 'Organizing...',
    organizeToMindEmpty: 'Nothing in Inbox to organize.',
    pendingText: (words: number) => `${words} words`,
    pendingNote: 'Note',
    pendingUrl: 'URL',
    pendingFile: 'File',
    stagedCapturesTitle: 'Staged captures',
    stagedCaptureCount: (n: number) => `${n} staged`,
    stagedCaptureStatus: 'waiting',
    clearComposer: 'Clear',
    signalText: 'Text',
    signalUrl: 'URL',
    signalFile: 'File',
    densityTitle: 'Intent',
    savingText: 'Saving...',
    savingItems: (n: number) => `Saving ${n}...`,
    textSaved: 'Saved text to Inbox',
    lastSavedTitle: (n: number) => `Saved ${n} capture${n === 1 ? '' : 's'} to Inbox`,
    lastSavedDesc: 'Staged locally. Review when you are ready.',
    lastSavedPartialTitle: (saved: number, failed: number) => `${saved} saved, ${failed} need retry`,
    lastSavedPartialDesc: 'Unfinished items stayed in the composer so you can retry or remove them.',
    dismissLastSaved: 'Dismiss saved confirmation',
    removeCaptureItem: (label: string) => `Remove ${label}`,
    backToWiki: 'Back to Wiki',
    queueTitle: 'Review queue',
    queuePreviewDesc: 'Ready when you are.',
    reviewPendingAction: (n: number) => n > 0 ? `Review ${n} pending` : 'Review queue',
    organizationAgentTitle: 'Inbox Organizer',
    organizationAgentPreviewDesc: 'Open Review to select captures. The assistant proposes changes before writing to your Mind.',
    organizationAgentDesc: 'Select captures below. The assistant proposes changes before writing to your Mind.',
    organizationAgentReady: (n: number) => `Ready to organize ${n} selected capture${n === 1 ? '' : 's'}.`,
    organizationCommandTitle: 'Organize to Mind',
    organizationAssistantInitial: 'IO',
    organizationAssistantBadge: 'Built-in assistant',
    organizationAssistantPreviewDesc: 'Open Review to organize.',
    organizationAssistantWorkbenchDesc: 'Choose captures, then run.',
    organizationAssistantReadsLabel: 'Reads',
    organizationAssistantReadsSelected: 'Selected captures',
    organizationAssistantWritesLabel: 'Writes',
    organizationAssistantWritesMind: 'Reviewed Mind updates',
    organizationAssistantEdit: 'Edit',
    selectedCount: (n: number) => `${n} selected`,
    selectAll: 'Select all',
    clearSelection: 'Clear',
    selectItem: (name: string) => `Select ${name}`,
    organizeSelectedAction: (n: number) => n > 0 ? `Organize ${n} selected` : 'Organize selected',
    shelveSelectedAction: (n: number) => n > 0 ? `Shelve ${n} selected` : 'Shelve selected',
    queueEmptyTitle: 'Nothing waiting',
    queueEmptyDesc: 'Use New to add notes, links, or files.',
    shelvedTitle: 'Shelved items',
    shelvedDesc: 'These captures stay in Inbox, but they no longer crowd the active queue.',
    shelvedEmptyTitle: 'Nothing shelved',
    shelvedEmptyDesc: 'Shelve captures when they are worth keeping but do not need attention now.',
    doneSectionTitle: 'Organization records',
    doneEmptyTitle: 'No completed runs yet',
    doneEmptyDesc: 'Finished Organize to Mind runs will appear here.',
    understandingTitle: 'Item preview',
    understandingEmptyTitle: 'Select an item',
    understandingEmptyDesc: 'Select a row to inspect its details and preview.',
    itemDetailsTitle: 'Item details',
    itemDetailsDesc: 'Inspect the selected capture. Organization happens from the queue.',
    contentPreviewTitle: 'Content preview',
    contentPreviewEmpty: 'No previewable text in this capture.',
    contentPreviewUnavailable: 'Preview is not available for this file type. Open the item to inspect it.',
    contentPreviewFailed: 'Could not load preview. The original capture is still in Inbox.',
    sourcePreviewTitle: 'Live source preview',
    sourcePreviewIdleDesc: 'Preview the current input before saving.',
    sourcePreviewActiveDesc: 'Preview the current input before saving.',
    sourcePreviewEmptyTitle: 'Paste any source',
    sourcePreviewEmptyDesc: 'The preview appears here before saving.',
    sourcePreviewType: 'Type',
    sourcePreviewSaveAs: 'Saved as',
    sourcePreviewStatus: 'Status',
    sourcePreviewIntent: 'Intent',
    sourcePreviewReviewPending: 'Review pending',
    sourcePreviewSourcePreserved: 'Source preserved',
    sourcePreviewOriginalFile: 'Original file',
    sourcePreviewWebLink: 'Web link',
    sourcePreviewFileType: 'File',
    sourcePreviewTextCapture: 'Text capture',
    sourcePreviewTextType: 'Text note',
    sourcePreviewAlsoStaged: (n: number) => `+${n} more staged for the same save`,
    suggestedType: 'Type',
    suggestedTarget: 'Target',
    suggestedReason: 'Note',
    relatedSignals: 'Related signals',
    actionOpen: 'Open',
    actionShelve: 'Shelve',
    actionRestore: 'Restore',
    actionRemove: 'Remove',
    typeArticle: 'Article / web reference',
    typeMeeting: 'Meeting or interview notes',
    typeDecision: 'Decision signal',
    typeData: 'Structured data',
    typeDocument: 'Document',
    typeRawNote: 'Raw note',
    targetResearch: 'Research / References',
    targetMeetings: 'Meetings / Interviews',
    targetDecisions: 'Decisions / Past You',
    targetData: 'Data / Tables',
    targetInboxReview: 'Inbox review',
    reasonArticle: 'External source material. Keep the citation and merge it into the closest topic.',
    reasonMeeting: 'Discussion notes. Extract decisions, actions, and useful context.',
    reasonDecision: 'Likely reusable judgment. Turn it into a rule after review.',
    reasonData: 'Structured content. Keep the table shape and link it from the right Space.',
    reasonDocument: 'Long-form material. Summarize first, then route it to the closest Space.',
    reasonRawNote: 'Needs review.',
    count: (n: number) => `${n}`,
    emptyTitle: 'Quick capture, organize later',
    emptyDesc: 'Drag files here or click Upload to save them instantly.',
    uploadButton: 'Upload Files',
    organizeButton: 'Review with Agent',
    organizing: 'Running...',
    viewAll: 'View all',
    more: (n: number) => `${n} more`,
    viewAllFiles: (n: number) => `View all ${n} files in Inbox`,
    viewAllHistory: (n: number) => `View all ${n} records →`,
    agingHint: '7+ days',
    agingCountLabel: 'aging',
    savedToast: (n: number) => `${n} file${n === 1 ? '' : 's'} saved to Inbox`,
    savedToDir: (n: number, dir: string) => `${n} file${n === 1 ? '' : 's'} saved to ${dir}`,
    savedWithSkipped: (saved: number, skipped: number) =>
      saved > 0
        ? `${saved} saved, ${skipped} skipped (unsupported format)`
        : `${skipped} file${skipped === 1 ? '' : 's'} skipped — unsupported format`,
    tooLarge: (n: number) =>
      `${n} file${n === 1 ? '' : 's'} too large (max 10 MB)`,
    savedWithOversized: (saved: number, oversized: number) =>
      `${saved} saved, ${oversized} skipped (too large)`,
    dropOverlay: 'Drop to save to Inbox',
    dropOverlayFormats: 'PDF · Word · MD · TXT · CSV · JSON · Images',
    noMindRoot: 'Please configure your knowledge base first',
    loadFailed: 'Failed to load Inbox.',
    retry: 'Retry',
    saveFailed: 'Failed to save files. Check disk space and permissions.',
    capturePartialFailed: 'Some items could not be saved. Check file permissions and formats.',
    organizeFailed: 'Could not read files for organizing. Check file permissions.',
    organizeNoAi: 'Configure an AI API key before running the Inbox Organizer. Capture still works without AI.',
    organizeBusy: 'Inbox Organizer is already running.',
    organizeReadFailed: (failed: number, skipped: number) =>
      `Inbox Organizer started with readable files. ${failed} unreadable and ${skipped} unsupported file${skipped === 1 ? '' : 's'} skipped.`,
    organizeNoReadableFiles: (skipped: number) =>
      `No readable files for Inbox Organizer. ${skipped} unsupported file${skipped === 1 ? '' : 's'} skipped.`,
    modelFollowSystem: 'Follow system',
    modelNoProvider: 'No provider',
    sidebarPanelTitle: 'Inbox',
    sidebarPanelDesc: 'Save now. Review later.',
    sidebarProcessTitle: 'Processing',
    sidebarLoadingDesc: 'Loading queue...',
    sidebarQueueDesc: (n: number) => n === 1 ? '1 item waiting.' : `${n} items waiting.`,
    sidebarShelvedDesc: (n: number) => n === 1 ? '1 item shelved.' : `${n} items shelved.`,
    sidebarHistoryDesc: (n: number) => n === 1 ? '1 completed run.' : `${n} completed runs.`,
    sidebarNextTitle: 'Pending',
    removeFile: 'Remove from Inbox',
    openFile: 'Open',
    copyName: 'Copy Name',
    fileRemoved: 'File removed from Inbox',
    fileRemoveFailed: 'Failed to remove file',
    fileShelved: 'Capture shelved',
    fileRestored: 'Capture restored to pending',
    fileCount: (n: number) => `${n} file${n === 1 ? '' : 's'}`,
    viewEmptyGuide: 'Files dropped here are staged for AI-powered organization into your knowledge base.',
    viewOrganizeTip: 'Run the Inbox Organizer to sort these files into the right spaces in your knowledge base.',
    clipUrlPlaceholder: 'Paste URL to clip web page...',
    clipButton: 'Clip',
    clipping: 'Clipping...',
    clipSuccess: (title: string) => `Clipped "${title}" to Inbox`,
    clipFailed: 'Failed to clip web page',
    clipInvalidUrl: 'Please enter a valid URL (http:// or https://)',
    dropUrlOverlay: 'Drop to clip web page',
    dropFilesOrLinks: 'Drag files or links, or',
  },
  pulse: {
    title: 'Your Agents',
    manage: 'Manage',
    connectTitle: 'Connect your AI tools',
    connectDesc: 'Let Cursor, Claude Code, and ChatGPT read your notes.',
    connectAction: 'Connect Agent',
    active: 'Connected',
    detected: 'Detected',
    notFound: 'Not found',
    running: 'Online',
    offline: 'Offline',
    summary: (agents: number, skills: number) => `${agents} Agent${agents !== 1 ? 's' : ''} · ${skills} Skills`,
    skillCount: (enabled: number, total: number) => `${enabled}/${total} skills`,
    showMore: (n: number) => `${n} more agent${n !== 1 ? 's' : ''}`,
    showLess: 'Show less',
    otherDetected: 'Detected',
  },
  fileTree: {
    newFileTitle: 'New file in this directory',
    rename: 'Rename',
    delete: 'Delete',
    create: 'Create',
    enterFileName: 'Enter a file name',
    failed: 'Failed',
    confirmDelete: (name: string) => `Delete "${name}"? You can recover from Trash for 30 days.`,
    rules: 'Rules',
    about: 'About',
    viewAll: 'View all',
    editRules: 'Edit Rules',
    viewRules: 'View Rules',
    renameSpace: 'Rename Space',
    deleteSpace: 'Delete Space',
    confirmDeleteSpace: (name: string) => `Delete space "${name}" and all its files? You can recover from Trash for 30 days.`,
    convertToSpace: 'Convert to Space',
    deleteFolder: 'Delete Folder',
    confirmDeleteFolder: (name: string) => `Delete folder "${name}" and all its contents? You can recover from Trash for 30 days.`,
    newFile: 'New File',
    importFile: 'Import File',
    importToSpace: 'Import file to this space',
    convertToSpaceAiRequired: 'Configure an AI API key before converting a folder into a Space. MindOS will not create placeholder Space files without AI generation.',
    copyPath: 'Copy Path',
    pathCopied: 'Path copied',
    pinToFavorites: 'Pin to Favorites',
    removeFromFavorites: 'Remove from Favorites',
    export: 'Export...',
  },
  pinnedFiles: {
    title: 'Pinned Files',
    addedToast: 'Added to Favorites',
    removedToast: 'Removed from Favorites',
    empty: 'No pinned files',
    emptyHint: 'Click the star icon on any file to pin it here',
  },
  trash: {
    title: 'Trash',
    subtitle: 'Items you delete appear here for 30 days.',
    empty: 'No deleted files yet.',
    emptySubtext: 'Items you delete will appear here for 30 days.',
    emptyTrash: 'Empty Trash',
    emptyTrashConfirm: 'Permanently delete all items in Trash? This cannot be undone.',
    restore: 'Restore',
    deletePermanently: 'Delete Forever',
    deletePermanentlyConfirm: (name: string) => `Permanently delete "${name}"? This cannot be undone.`,
    from: 'From',
    deletedAgo: (time: string) => `Deleted ${time}`,
    expiresIn: (days: number) => `Expires in ${days} day${days !== 1 ? 's' : ''}`,
    restored: 'Restored successfully',
    deleted: 'Permanently deleted',
    movedToTrash: 'Deleted',
    undo: 'Undo',
    undoFailed: 'Undo failed',
    restoreFailed: 'Could not restore file. Check disk space and try again.',
    deleteFailed: 'Could not permanently delete. Please try again.',
    emptyFailed: 'Could not empty trash. Please try again.',
    emptied: (count: number) => `Emptied ${count} item${count !== 1 ? 's' : ''} from Trash`,
    restoreConflict: 'A file with this name already exists at the original location.',
    overwrite: 'Overwrite',
    saveAsCopy: 'Save as Copy',
    itemCount: (n: number) => `${n} item${n !== 1 ? 's' : ''}`,
    undoDelete: 'Undo',
    viewInTrash: 'View in Trash',
    fileDeleted: (name: string) => `"${name}" moved to Trash`,
    cancel: 'Cancel',
    justNow: 'just now',
    minutesAgo: (m: number) => `${m}m ago`,
    hoursAgo: (h: number) => `${h}h ago`,
    daysAgo: (d: number) => `${d}d ago`,
  },
  export: {
    title: 'Export',
    exportFile: 'Export File',
    exportSpace: 'Export Space',
    chooseFormat: 'Choose format',
    formatMd: 'Markdown (.md)',
    formatMdDesc: 'Original format, editable',
    formatHtml: 'HTML (.html)',
    formatHtmlDesc: 'Static webpage, shareable',
    formatZipMd: 'Markdown ZIP',
    formatZipMdDesc: 'All files in original format',
    formatZipHtml: 'HTML ZIP',
    formatZipHtmlDesc: 'All files as webpages',
    preview: 'Preview',
    exporting: 'Exporting...',
    exportButton: 'Export',
    cancel: 'Cancel',
    close: 'Done',
    done: 'Export Complete',
    downloadAgain: 'Download Again',
    fileCount: (n: number) => `${n} file${n !== 1 ? 's' : ''}`,
    downloaded: 'Downloaded',
    error: 'Export failed. Please check disk space and try again.',
    retry: 'Retry',
  },
  fileImport: {
    title: 'Import Files',
    subtitle: 'Save files to your knowledge base or let AI organize them',
    dropzoneText: 'Drag files here, or',
    dropzoneButton: 'click to select',
    dropzoneCompact: 'Drag more files, or',
    dropzoneCompactButton: 'click to add',
    dropzoneMobile: 'Tap to select files',
    fileCount: (n: number) => `${n} file${n !== 1 ? 's' : ''}`,
    clearAll: 'Clear all',
    unsupported: 'Unsupported file type',
    tooLarge: (max: string) => `File too large (max ${max})`,
    archiveTitle: 'Save to Knowledge Base',
    archiveDesc: 'Save as-is to a space',
    digestTitle: 'AI Organize',
    digestDesc: 'Extract key points into notes',
    archiveConfigTitle: 'Save to Knowledge Base',
    back: '← Back',
    targetSpace: 'Target space',
    rootDir: 'Root',
    conflictLabel: 'If file already exists',
    conflictRename: 'Auto-rename (add number suffix)',
    conflictSkip: 'Skip',
    conflictOverwrite: 'Overwrite existing file',
    overwriteWarn: 'This will permanently replace existing file content',
    cancel: 'Cancel',
    importButton: (n: number) => `Save ${n} file${n !== 1 ? 's' : ''}`,
    importing: 'Saving...',
    preparing: 'Preparing...',
    successToast: (n: number, space: string) => `Saved ${n} file${n !== 1 ? 's' : ''} to ${space || 'knowledge base'}`,
    updatedIndex: (n: number) => `Updated ${n} index file${n !== 1 ? 's' : ''}`,
    partialToast: (ok: number, total: number) => `Saved ${ok}/${total} files`,
    skipReason: 'File already exists',
    failToast: 'Import failed',
    retry: 'Retry',
    undo: 'Undo',
    discardTitle: 'Discard import?',
    discardMessage: (n: number) => `Discard ${n} selected file${n !== 1 ? 's' : ''}?`,
    discardConfirm: 'Discard',
    discardCancel: 'Cancel',
    dropOverlay: 'Drop files to import into knowledge base',
    dropOverlayFormats: 'Supports .md .txt .pdf .doc .docx .csv .json .yaml .xml .html',
    onboardingHint: 'Already have notes? Import files →',
    digestPromptSingle: (name: string, targetSpace?: string) => {
      const loc = targetSpace ? ` under the "${targetSpace}" space` : '';
      return `The user uploaded "${name}". You MUST:\n1. Read the content from the "USER-UPLOADED FILES" section above\n2. Extract and reorganize the key information into well-structured Markdown notes\n3. Save the result${loc} in the knowledge base — create new files or update existing ones as appropriate\n\nDo NOT just reply with a text summary. You must actually write to the knowledge base.`;
    },
    digestPromptMulti: (n: number, targetSpace?: string) => {
      const loc = targetSpace ? ` under the "${targetSpace}" space` : '';
      return `The user uploaded ${n} files. You MUST:\n1. Read their content from the "USER-UPLOADED FILES" section above\n2. Extract and reorganize the key information into well-structured Markdown notes\n3. Save the results${loc} in the knowledge base — create new files or update existing ones as appropriate\n\nDo NOT just reply with a text summary. You must actually write to the knowledge base.`;
    },
    arrowTo: '→',
    remove: 'Remove',
    aiRecommended: 'Recommended',
    aiRecommendedHint: 'Auto-matched by filename',
    conflictsFound: (n: number) => `${n} file${n !== 1 ? 's' : ''} already exist${n === 1 ? 's' : ''}`,
    organizeTitle: 'AI Organizing',
    organizeProcessing: 'AI is analyzing and organizing your files...',
    organizeConnecting: 'Connecting to AI...',
    organizeAnalyzing: 'AI is analyzing your files...',
    organizeReading: (detail?: string) => detail ? `Reading ${detail}...` : 'Reading files...',
    organizeThinking: 'AI is thinking deeply...',
    organizeWriting: (detail?: string) => detail ? `Writing ${detail}...` : 'Writing files...',
    organizeElapsed: (seconds: number) => {
      const m = Math.floor(seconds / 60);
      const s = seconds % 60;
      return `${m}:${s.toString().padStart(2, '0')}`;
    },
    organizeCancel: 'Cancel',
    organizeMinimize: 'Continue browsing',
    organizeExpand: 'View',
    organizeCreating: (path: string) => `Creating ${path}`,
    organizeUpdating: (path: string) => `Updating ${path}`,
    organizeReviewTitle: 'Organization Complete',
    organizeErrorTitle: 'Organization Failed',
    organizeReviewDesc: (n: number) => `AI organized your files into ${n} change${n !== 1 ? 's' : ''}`,
    organizeCreated: 'Created',
    organizeUpdated: 'Updated',
    organizeFailed: 'Failed',
    organizeNoChanges: 'AI analyzed your files but made no changes.',
    organizeToolCallsInfo: (n: number) => `AI executed ${n} operation${n > 1 ? 's' : ''} — check knowledge base for updates`,
    organizeError: 'Organization failed',
    organizeRetry: 'Retry',
    organizeDone: 'Done',
    organizeUndoAll: 'Undo All',
    organizeUndoOne: 'Undo',
    organizeUndone: 'Undone',
    organizeViewFile: 'View file',
    organizeUndoSuccess: (n: number) => `Reverted ${n} file${n !== 1 ? 's' : ''}`,
    organizeDetailTitle: 'AI Organize Details',
    organizeSourceFiles: 'Source Files',
    organizeSummaryLabel: 'AI Summary',
    organizeChangesLabel: (n: number) => `Changes (${n})`,
    organizeNoSummary: 'AI is working...',
    organizeMinimizeModal: 'Minimize',
  },
  importHistory: {
    title: 'Import History',
    clearAll: 'Clear history',
    clearConfirm: 'Clear all history? This cannot be undone.',
    emptyTitle: 'No import history yet',
    emptyDesc: 'AI organize results will appear here',
    back: '← Back',
    sourceLabel: 'Source',
    changesCount: (ok: number, total: number) => `${ok}/${total} changes`,
    changesSummary: (n: number) => `→ ${n} ${n === 1 ? 'change' : 'changes'}`,
    nFiles: (n: number) => `${n} file${n === 1 ? '' : 's'}`,
    statusUndone: 'undone',
    statusCreated: 'created',
    statusUpdated: 'updated',
    recordCount: (n: number) => `${n} record${n !== 1 ? 's' : ''}`,
    today: 'Today',
    yesterday: 'Yesterday',
    older: 'Older',
    processedArchive: 'Processed files are archived in Inbox/.processed/',
  },
  dirView: {
    gridView: 'Grid view',
    listView: 'List view',
    emptyFolder: 'This folder is empty.',
    fileCount: (n: number) => `${n} files`,
    newFile: 'New file',
    uninitTitle: 'Space not yet initialized',
    uninitDesc: 'README.md and INSTRUCTION.md contain default templates. Configure an AI API key in Settings to auto-generate personalized content, or edit them manually.',
    uninitEditReadme: 'Edit README',
    uninitEditInstruction: 'Edit Instruction',
    uninitSettings: 'Settings',
    overviewNoFiles: 'No files to analyze yet.',
    overviewCta: 'Generate Overview',
    overviewCtaHint: (n: number) => `Scan ${n} file${n !== 1 ? 's' : ''} to create a summary`,
    overviewCtaNoKey: 'Configure an AI key in Settings first',
    overviewOrEdit: 'or edit README.md manually',
    overviewGenerating: 'Generating overview…',
    overviewScanningFiles: (n: number) => `Scanning ${n} file${n !== 1 ? 's' : ''}`,
    overviewRegenerate: 'Regenerate overview with AI',
    overviewRegenerateLabel: 'Refresh',
    overviewRegenerateConfirm: 'This will scan changed files and refresh the overview, which uses AI credits.',
    overviewRegenerateCancel: 'Cancel',
    overviewRegenerateStart: 'Refresh Now',
    overviewUnchanged: 'Overview is up to date — no files changed.',
    overviewLastCompiled: (time: string) => `Last refreshed ${time}`,
    overviewIncremental: (n: number) => `Updated from ${n} changed file${n !== 1 ? 's' : ''}`,
    overviewError: 'Could not generate overview',
    overviewRetry: 'Retry',
  },
  view: {
    saveDirectory: 'Directory',
    saveFileName: 'File name',
    delete: 'Delete',
    deleteConfirm: (name: string) => `Delete "${name}"? It will be moved to Trash.`,
    cancel: 'Cancel',
    rename: 'Rename',
    copyPath: 'Copy Path',
    more: 'More',
    dismiss: 'Dismiss',
    tocTitle: 'On this page',
    tocCollapse: 'Collapse',
    tocExpand: 'Expand',
    emptyNote: 'This note is empty. Press E to start writing.',
    switchToDoc: 'Document view',
    switchToGraph: 'Wiki Graph',
  },
  findInPage: {
    placeholder: 'Find in document…',
    matchCount: (current: number, total: number) => `${current} of ${total}`,
    noResults: 'No results',
  },
} as const;

export const knowledgeZh = {
  home: {
    recentlyModified: '最近修改',
    recentlyActive: '最近活跃',
    recentlyEdited: '最近编辑',
    allSpaces: '所有空间',
    spaces: '心智空间',
    nFiles: (n: number) => `${n} 个文件`,
    other: '其他',
    newSpace: '新建空间',
    spaceName: '空间名称',
    spaceDescription: '描述',
    spaceDescPlaceholder: '描述这个空间的用途',
    spaceNameNoSlash: '名称不能包含 / 或 \\',
    spaceExists: '已存在同名空间',
    spaceCreateFailed: '创建空间失败',
    noSpacesYet: '还没有空间，创建一个来整理你的知识吧。',
    spaceLocation: '位置',
    rootLevel: '根目录',
    optional: '可选',
    aiInit: 'AI 初始化内容',
    aiInitHint: 'AI 将自动生成空间说明和操作指南',
    aiInitNoKey: '在 设置 → AI 中配置 API 密钥以启用',
    aiInitGenerating: (name: string) => `正在为「${name}」生成内容`,
    aiInitReady: (name: string) => `「${name}」已就绪`,
    aiInitReview: '查看',
    aiInitDiscard: '撤销',
    aiInitReverted: (name: string) => `「${name}」已恢复为模板`,
    createSpace: '创建',
    cancelCreate: '取消',
    continueEditing: '继续编辑',
    newNote: '新建笔记',
    mindTagline: '本地 Markdown 上的个人 Mind 工作台。',
    builtInSpacesTitle: 'Mind 系统',
    builtInSpacesDesc: 'MindOS 将内置语义模块映射到你的本地目录。可见目录仍由用户拥有，模块账本保存在 .mindos。',
    builtInSpacesReview: '复盘闭环',
    mindAssistant: {
      label: '助手',
      spaceTitle: '助手',
      instructionReady: '说明已就绪',
      instructionMissing: '缺少说明',
      customDrafts: (n: number) => `${n} 个草稿`,
      runOnce: '运行一次',
      view: '查看',
      hide: '收起',
      edit: '编辑',
      editAssistant: '编辑',
      promptReady: 'Prompt 已就绪',
      promptMissing: '缺少 Prompt',
      promptFile: 'Prompt',
      profileFile: '资料',
      promptEditor: '助手 Prompt',
      assistantName: '名称',
      assistantDescription: '描述',
      loadingPrompt: '正在加载 Prompt...',
      loadPromptFailed: '加载 Prompt 失败',
      promptMissingHint: 'Prompt 文件不存在，在这里保存会创建它。',
      promptEmpty: 'Prompt 不能为空。',
      unsavedChanges: '未保存修改',
      savedState: '已保存',
      promptCharacters: (n: number) => `${n.toLocaleString()} 个字符`,
      resetChanges: '还原',
      saveChanges: '保存修改',
      savingChanges: '保存中...',
      savedChanges: '修改已保存',
      saveChangesFailed: '保存修改失败',
      assistantId: '助手 ID',
      schedule: '日程',
      close: '关闭',
      openSpace: '打开空间',
      openInstruction: '说明',
      openDrafts: '草稿',
      moreAssistants: (n: number) => `+${n} 个助手`,
      assistantCount: (n: number) => `${n} 个助手`,
      viewAllAssistants: (n: number) => `查看全部 ${n} 个助手`,
      showLessAssistants: '收起',
      scheduleMode: {
        manual: '手动',
        daily: '每日',
        weekly: '每周',
      },
      runPrompt: (spaceTitle: string, assistantName: string, assistantDesc: string, spacePath: string, promptPath: string) => `请作为 MindOS 空间「${spaceTitle}」（${spacePath}）里的「${assistantName}」助手工作。

助手职责：${assistantDesc}

请先读取助手 Prompt：${promptPath}，再读取这个空间的 INSTRUCTION.md，并查看同一空间内相关笔记。请产出一份简洁的 Markdown 草稿供用户确认，不要直接覆盖正式笔记。如果需要写入文件，请写到 ${spaceDraftsPath(spacePath)} 下，并使用带日期的文件名。草稿要聚焦、可追溯，并方便用户确认或丢弃。`,
    },
    mindAssistants: {
      dao: [
        { id: 'daily-signal', name: '每日信号整理', desc: '把方向、机会、风险信号整理成草稿。' },
        { id: 'decision-synthesizer', name: '决策沉淀', desc: '把反复出现的选择沉淀成长期判断。' },
      ],
      fa: [
        { id: 'rule-keeper', name: '规则整理', desc: '沉淀已确认的原则、边界和协议。' },
        { id: 'boundary-reviewer', name: '边界复核', desc: '检查新内容是否触碰既有承诺和限制。' },
      ],
      shu: [
        { id: 'method-organizer', name: '方法整理', desc: '把重复做法整理成 SOP 和 checklist。' },
        { id: 'checklist-builder', name: '清单生成', desc: '把松散方法转成可复用执行步骤。' },
      ],
      qi: [
        { id: 'tool-inventory', name: '工具整理', desc: '维护工具、模板、资产和资料源。' },
        { id: 'resource-auditor', name: '资源巡检', desc: '发现过期、重复或说明不足的资源。' },
      ],
    },
    mindPillars: {
      dao: { title: '道', desc: '价值、方向、长期判断' },
      fa: { title: '法', desc: '规则、边界、承诺' },
      shu: { title: '术', desc: '方法、策略、可复用套路' },
      qi: { title: '器', desc: '工具、资产、渠道、模板' },
    },
    builtinFeatures: '工具面板',
    builtinActive: '已启用',
    builtinInactive: '未激活',
    toolName: {
      'agent-inspector': '审计面板',
      'config-panel': '配置面板',
      'todo': '待办面板',
      'workflow-yaml': '工作流',
    } as Record<string, string>,
    toolDesc: {
      'agent-inspector': '查看 Agent 操作日志与调用轨迹',
      'config-panel': '编辑和管理全局配置项',
      'todo': '以看板形式管理待办事项',
      'workflow-yaml': '执行多步骤工作流，AI 辅助执行',
    } as Record<string, string>,
    plugins: '扩展',
    changeHistory: '变更历史',
    showMore: '查看更多',
    showLess: '收起',
    viewAll: '查看全部',
    wikiTagline: '你的知识空间，井然有序。',
    sortRecent: '最近',
    sortName: '字母序',
    sortCount: '文件数',
    createToActivate: '创建 {file} 以启用',
    shortcuts: {
      searchFiles: '搜索文件',
      askAI: 'MindOS',
      editFile: '编辑文件',
      save: '保存',
      settings: '设置',
    },
    relativeTime: {
      justNow: '刚刚',
      minutesAgo: (n: number) => `${n} 分钟前`,
      hoursAgo: (n: number) => `${n} 小时前`,
      daysAgo: (n: number) => `${n} 天前`,
    },
    cleanupExamples: (n: number) => `有 ${n} 个模板示例文件可以清理`,
    cleanupExamplesButton: '一键清理',
    cleanupExamplesDone: '示例文件已清理',
  },
  echoSpotlight: {
    title: '回响',
    dailyLine: '今日一行',
    placeholder: '写下今天的一行想法…',
    invite: '记录今天的一行想法',
    inviteDesc: '一行就够。回响会沉淀你的思维模式。',
    goToEcho: '打开回响',
    savedLocally: '保存在本设备',
  },
  dailyEcho: {
    // Report generation
    title: '每日回响报告',
    generate: '生成今日报告',
    generating: '生成中...',
    generated: '生成于 {time}',
    regenerate: '重新生成',
    download: '下载 PDF',
    continueAgent: '继续与 Agent',
    error: '生成失败',
    retry: '重试',
    // Snapshot
    snapshotTitle: '📊 今日动向',
    snapshotFilesEdited: '文件编辑',
    snapshotFilesCreated: '新建文件',
    snapshotSessions: '聊天会话',
    snapshotKbGrowth: '知识库增长',
    // Themes
    themesTitle: '🎯 今日主题',
    themeFiles: '个文件',
    // Alignment
    alignmentTitle: '✅ 对齐度',
    alignmentScore: '评分',
    alignmentMisaligned: '偏离',
    alignmentPartial: '部分对齐',
    alignmentAligned: '充分对齐',
    // Reflection
    reflectionTitle: '❓ 明天思考',
  },
  suggestion: {
    title: '你可能想',
    staleFiles: (n: number) => `${n} 个文件超过 30 天未更新`,
    reviewStale: '查看',
    dismiss: '忽略',
  },
  inbox: {
    title: '收集箱',
    subtitle: '先保存零散材料，准备好时再审核。',
    capturePageTitle: '新增收集',
    capturePageSubtitle: '粘贴、拖拽、保存。',
    reviewPageTitle: '审核队列',
    reviewPageSubtitle: '',
    shelvedPageTitle: '已搁置',
    shelvedPageSubtitle: '暂时不用处理，但仍保留在收集箱里的内容。',
    donePageTitle: '已完成',
    donePageSubtitle: '最近整理记录和撤销记录。',
    viewCapture: '新增收集',
    viewQueue: '待处理',
    viewShelved: '已搁置',
    viewHistory: '已完成',
    intentSourceTitle: '只保存',
    intentSourceDesc: '保留原始材料，安全暂存。',
    intentSourceAction: '只保存',
    intentNoteTitle: '整理笔记',
    intentNoteDesc: '把混乱输入变成可读的知识笔记。',
    intentNoteAction: '总结并结构化',
    intentJudgmentTitle: '提取判断',
    intentJudgmentDesc: '找出决策、偏好、规则或可复用方法。',
    intentJudgmentAction: '发现规则',
    intentReflectTitle: '稍后反思',
    intentReflectDesc: '把它作为兴趣、盲区或成长变化的信号。',
    intentReflectAction: '送入 Echo',
    composerTitle: '加入收集箱',
    composerInputLabel: '向收集箱添加链接、笔记、文件或来源',
    composerPlaceholder: '粘贴链接、写下笔记，或把文件拖到这里...',
    captureTrustLine: '本地保存',
    captureInputKinds: '链接 / 文件 / 笔记 / 拖拽',
    captureNoAiHint: '稍后审核',
    captureAutoDetectHint: '自动识别：链接 · PDF · 图片 · 文件 · 笔记',
    captureDropHint: '粘贴、输入，或拖入文件。',
    currentDraftHint: (words: number) => `当前草稿 · ${words} 字`,
    captureSessionCount: (n: number) => `本次 ${n} 条`,
    composerDetected: '已识别',
    captureAffordanceLink: '链接',
    captureAffordanceLinkDesc: 'YouTube、B站、小红书',
    captureAffordanceNote: '笔记',
    captureAffordanceNoteDesc: '想法、摘录、草稿',
    captureAffordanceFile: '文件',
    captureAffordanceFileDesc: 'PDF、Markdown、文档',
    captureAffordanceDrop: '拖拽',
    captureAffordanceDropDesc: '文件或网页链接',
    attachButton: '附加',
    stageNoteAction: '暂存为笔记',
    stageNoteShortcut: '⌘/Ctrl Enter',
    captureButton: '保存到收集箱',
    captureButtonCount: (n: number) => `保存 ${n} 条到收集箱`,
    organizeToMindAction: '整理到 Mind',
    organizeToMindRunning: '整理中...',
    organizeToMindEmpty: '收集箱里暂无可整理内容。',
    pendingText: (words: number) => `${words} 字`,
    pendingNote: '笔记',
    pendingUrl: '链接',
    pendingFile: '文件',
    stagedCapturesTitle: '待保存内容',
    stagedCaptureCount: (n: number) => `${n} 条待保存`,
    stagedCaptureStatus: '等待',
    clearComposer: '清空',
    signalText: '文本',
    signalUrl: '链接',
    signalFile: '文件',
    densityTitle: '意图',
    savingText: '保存中...',
    savingItems: (n: number) => `保存 ${n} 条中...`,
    textSaved: '文本已保存到收集箱',
    lastSavedTitle: (n: number) => `已保存 ${n} 条到收集箱`,
    lastSavedDesc: '已本地暂存，准备好时再审核。',
    lastSavedPartialTitle: (saved: number, failed: number) => `已保存 ${saved} 条，${failed} 条需要重试`,
    lastSavedPartialDesc: '未完成的项目已留在输入区，可以重试或移除。',
    dismissLastSaved: '关闭保存确认',
    removeCaptureItem: (label: string) => `移除${label}`,
    backToWiki: '返回 Wiki',
    queueTitle: '审核队列',
    queuePreviewDesc: '准备好时再处理。',
    reviewPendingAction: (n: number) => n > 0 ? `审核 ${n} 条待处理` : '查看审核队列',
    organizationAgentTitle: '收集箱整理助手',
    organizationAgentPreviewDesc: '进入审核后选择材料，整理助手会先给整理建议，写入前由你确认。',
    organizationAgentDesc: '选择下方材料，整理助手会先给整理建议，写入前由你确认。',
    organizationAgentReady: (n: number) => `已选择 ${n} 条，可以开始整理。`,
    organizationCommandTitle: '整理到 Mind',
    organizationAssistantInitial: '整',
    organizationAssistantBadge: '内置助手',
    organizationAssistantPreviewDesc: '打开审核后再整理。',
    organizationAssistantWorkbenchDesc: '选择材料后运行整理。',
    organizationAssistantReadsLabel: '读取',
    organizationAssistantReadsSelected: '已选材料',
    organizationAssistantWritesLabel: '写入',
    organizationAssistantWritesMind: '确认后的 Mind 更新',
    organizationAssistantEdit: '编辑',
    selectedCount: (n: number) => `已选 ${n} 条`,
    selectAll: '全选',
    clearSelection: '清空选择',
    selectItem: (name: string) => `选择 ${name}`,
    organizeSelectedAction: (n: number) => n > 0 ? `整理已选 ${n} 条` : '整理已选',
    shelveSelectedAction: (n: number) => n > 0 ? `搁置已选 ${n} 条` : '搁置已选',
    queueEmptyTitle: '暂无待处理内容',
    queueEmptyDesc: '在「新增」里保存笔记、链接或文件。',
    shelvedTitle: '已搁置内容',
    shelvedDesc: '这些内容仍保留在收集箱里，但不会挤占待处理队列。',
    shelvedEmptyTitle: '暂无已搁置内容',
    shelvedEmptyDesc: '暂时不用处理、但值得保留的内容，可以先搁置。',
    doneSectionTitle: '整理记录',
    doneEmptyTitle: '暂无完成记录',
    doneEmptyDesc: '完成的整理到 Mind 记录会出现在这里。',
    understandingTitle: '内容预览',
    understandingEmptyTitle: '选择一条内容',
    understandingEmptyDesc: '选择一行后，在这里查看详情和内容预览。',
    itemDetailsTitle: '条目详情',
    itemDetailsDesc: '这里仅展示所选材料；整理动作在队列上方进行。',
    contentPreviewTitle: '内容预览',
    contentPreviewEmpty: '这条内容没有可预览文本。',
    contentPreviewUnavailable: '此文件类型暂不支持预览，可以打开原始内容查看。',
    contentPreviewFailed: '预览加载失败，原始内容仍保留在收集箱。',
    sourcePreviewTitle: '来源预览',
    sourcePreviewIdleDesc: '保存前预览当前输入。',
    sourcePreviewActiveDesc: '保存前预览当前输入。',
    sourcePreviewEmptyTitle: '随手粘贴任何来源',
    sourcePreviewEmptyDesc: '保存前会在这里预览。',
    sourcePreviewType: '类型',
    sourcePreviewSaveAs: '保存为',
    sourcePreviewStatus: '状态',
    sourcePreviewIntent: '意图',
    sourcePreviewReviewPending: '等待审核',
    sourcePreviewSourcePreserved: '保留原始来源',
    sourcePreviewOriginalFile: '原始文件',
    sourcePreviewWebLink: '网页链接',
    sourcePreviewFileType: '文件',
    sourcePreviewTextCapture: '文本内容',
    sourcePreviewTextType: '文本笔记',
    sourcePreviewAlsoStaged: (n: number) => `另有 ${n} 条会一起保存`,
    suggestedType: '类型',
    suggestedTarget: '位置',
    suggestedReason: '备注',
    relatedSignals: '相关信号',
    actionOpen: '打开',
    actionShelve: '搁置',
    actionRestore: '恢复处理',
    actionRemove: '移除',
    typeArticle: '文章 / 外部资料',
    typeMeeting: '会议或访谈记录',
    typeDecision: '决策信号',
    typeData: '结构化数据',
    typeDocument: '文档资料',
    typeRawNote: '原始笔记',
    targetResearch: 'Research / References',
    targetMeetings: 'Meetings / Interviews',
    targetDecisions: 'Decisions / Past You',
    targetData: 'Data / Tables',
    targetInboxReview: '收集箱审核',
    reasonArticle: '外部资料。保留引用，合并到最近主题。',
    reasonMeeting: '讨论记录。提取决策、行动项和上下文。',
    reasonDecision: '可能是可复用判断，审核后沉淀为规则。',
    reasonData: '结构化内容。保留表格形态并链接到合适 Space。',
    reasonDocument: '长文档。先总结，再归位到最近 Space。',
    reasonRawNote: '待确认。',
    count: (n: number) => `${n}`,
    emptyTitle: '快速收集，稍后整理',
    emptyDesc: '拖拽文件到此处，或点击上传按钮，即刻保存到收集箱。',
    uploadButton: '上传文件',
    organizeButton: 'AI 整理',
    organizing: '运行中...',
    viewAll: '查看全部',
    more: (n: number) => `还有 ${n} 个`,
    viewAllFiles: (n: number) => `查看收集箱中全部 ${n} 个文件`,
    viewAllHistory: (n: number) => `查看全部 ${n} 条记录 →`,
    agingHint: '7天+',
    agingCountLabel: '陈旧',
    savedToast: (n: number) => `${n} 个文件已保存到收集箱`,
    savedToDir: (n: number, dir: string) => `${n} 个文件已保存到 ${dir}`,
    savedWithSkipped: (saved: number, skipped: number) =>
      saved > 0
        ? `已保存 ${saved} 个，跳过 ${skipped} 个（格式不支持）`
        : `${skipped} 个文件被跳过（格式不支持）`,
    tooLarge: (n: number) =>
      `${n} 个文件过大（上限 10 MB）`,
    savedWithOversized: (saved: number, oversized: number) =>
      `已保存 ${saved} 个，${oversized} 个过大被跳过`,
    dropOverlay: '拖放到收集箱快速保存',
    dropOverlayFormats: 'PDF · Word · MD · TXT · CSV · JSON · 图片',
    noMindRoot: '请先配置知识库路径',
    loadFailed: '加载收集箱失败。',
    retry: '重试',
    saveFailed: '保存文件失败，请检查磁盘空间和权限。',
    capturePartialFailed: '部分内容保存失败，请检查文件权限和格式。',
    organizeFailed: '无法读取文件进行整理，请检查文件权限。',
    organizeNoAi: '请先配置 AI API 密钥再运行收集箱整理助手。没有 AI 时仍可正常保存内容。',
    organizeBusy: '收集箱整理助手已经在运行。',
    organizeReadFailed: (failed: number, skipped: number) =>
      `收集箱整理助手已开始处理可读取文件。${failed} 个读取失败，${skipped} 个格式不支持已跳过。`,
    organizeNoReadableFiles: (skipped: number) =>
      `没有可供 AI 整理的文件。${skipped} 个格式不支持已跳过。`,
    modelFollowSystem: '跟随系统',
    modelNoProvider: '未配置模型',
    sidebarPanelTitle: '收集箱',
    sidebarPanelDesc: '先保存，稍后审核。',
    sidebarProcessTitle: '处理',
    sidebarLoadingDesc: '队列加载中...',
    sidebarQueueDesc: (n: number) => `${n} 条待处理。`,
    sidebarShelvedDesc: (n: number) => `${n} 条已搁置。`,
    sidebarHistoryDesc: (n: number) => `${n} 次完成记录。`,
    sidebarNextTitle: '待处理',
    removeFile: '从收集箱移除',
    openFile: '打开',
    copyName: '复制文件名',
    fileRemoved: '文件已从收集箱移除',
    fileRemoveFailed: '移除文件失败',
    fileShelved: '已搁置',
    fileRestored: '已恢复到待处理',
    fileCount: (n: number) => `${n} 个文件`,
    viewEmptyGuide: '拖入的文件将先进入收集箱，等待 AI 整理到知识库中。',
    viewOrganizeTip: '运行收集箱整理助手，将这些文件分类到知识库的合适位置。',
    clipUrlPlaceholder: '粘贴网址，一键剪藏网页...',
    clipButton: '剪藏',
    clipping: '剪藏中...',
    clipSuccess: (title: string) => `已剪藏「${title}」到收集箱`,
    clipFailed: '网页剪藏失败',
    clipInvalidUrl: '请输入有效网址（http:// 或 https://）',
    dropUrlOverlay: '松开以剪藏网页',
    dropFilesOrLinks: '拖拽文件或链接，或',
  },
  pulse: {
    title: '你的 Agent',
    manage: '管理',
    connectTitle: '连接你的 AI 工具',
    connectDesc: '让 Cursor、Claude Code 等 AI 读到你的笔记。',
    connectAction: '连接 Agent',
    active: '已连接',
    detected: '已检测',
    notFound: '未发现',
    running: '在线',
    offline: '离线',
    summary: (agents: number, skills: number) => `${agents} 个 Agent · ${skills} 个技能`,
    skillCount: (enabled: number, total: number) => `${enabled}/${total} 个技能`,
    showMore: (n: number) => `还有 ${n} 个`,
    showLess: '收起',
    otherDetected: '已检测到',
  },
  fileTree: {
    newFileTitle: '在此目录新建文件',
    rename: '重命名',
    delete: '删除',
    create: '创建',
    enterFileName: '请输入文件名',
    failed: '操作失败',
    confirmDelete: (name: string) => `确定删除「${name}」？可在回收站恢复（30 天内）。`,
    rules: '规则',
    about: '概述',
    viewAll: '查看全部',
    editRules: '编辑规则',
    viewRules: '查看规则',
    renameSpace: '重命名空间',
    deleteSpace: '删除空间',
    confirmDeleteSpace: (name: string) => `删除空间「${name}」及其所有文件？可在回收站恢复（30 天内）。`,
    convertToSpace: '转为空间',
    deleteFolder: '删除文件夹',
    confirmDeleteFolder: (name: string) => `删除文件夹「${name}」及其所有内容？可在回收站恢复（30 天内）。`,
    newFile: '新建文件',
    importFile: '导入文件',
    importToSpace: '导入文件到此空间',
    convertToSpaceAiRequired: '请先配置 AI API 密钥再将文件夹转为空间。MindOS 不会在没有 AI 生成时创建占位 Space 文件。',
    copyPath: '复制路径',
    pathCopied: '路径已复制',
    pinToFavorites: '固定到收藏',
    removeFromFavorites: '取消收藏',
    export: '导出...',
  },
  pinnedFiles: {
    title: '收藏文件',
    addedToast: '已添加到收藏',
    removedToast: '已取消收藏',
    empty: '还没有收藏文件',
    emptyHint: '点击任何文件上的星标图标即可收藏',
  },
  trash: {
    title: '回收站',
    subtitle: '删除的文件将保留 30 天。',
    empty: '回收站为空',
    emptySubtext: '删除的文件将在此处保留 30 天。',
    emptyTrash: '清空回收站',
    emptyTrashConfirm: '永久删除回收站中的所有项目？此操作不可撤销。',
    restore: '恢复',
    deletePermanently: '彻底删除',
    deletePermanentlyConfirm: (name: string) => `确定彻底删除「${name}」？此操作不可撤销。`,
    from: '来自',
    deletedAgo: (time: string) => `${time}删除`,
    expiresIn: (days: number) => `${days} 天后过期`,
    restored: '已恢复',
    deleted: '已彻底删除',
    movedToTrash: '已删除',
    undo: '撤销',
    undoFailed: '撤销失败',
    restoreFailed: '无法恢复文件，请检查磁盘空间后重试。',
    deleteFailed: '无法彻底删除，请重试。',
    emptyFailed: '无法清空回收站，请重试。',
    emptied: (count: number) => `已清空 ${count} 个项目`,
    restoreConflict: '原位置已有同名文件。',
    overwrite: '覆盖',
    saveAsCopy: '保存副本',
    itemCount: (n: number) => `${n} 个项目`,
    undoDelete: '撤销',
    viewInTrash: '查看回收站',
    fileDeleted: (name: string) => `「${name}」已移至回收站`,
    cancel: '取消',
    justNow: '刚刚',
    minutesAgo: (m: number) => `${m} 分钟前`,
    hoursAgo: (h: number) => `${h} 小时前`,
    daysAgo: (d: number) => `${d} 天前`,
  },
  export: {
    title: '导出',
    exportFile: '导出文件',
    exportSpace: '导出空间',
    chooseFormat: '选择格式',
    formatMd: 'Markdown (.md)',
    formatMdDesc: '原始格式，可编辑',
    formatHtml: 'HTML (.html)',
    formatHtmlDesc: '静态网页，可分享',
    formatZipMd: 'Markdown ZIP',
    formatZipMdDesc: '所有文件，原始格式',
    formatZipHtml: 'HTML ZIP',
    formatZipHtmlDesc: '所有文件，网页格式',
    preview: '预览',
    exporting: '导出中...',
    exportButton: '导出',
    cancel: '取消',
    close: '完成',
    done: '导出完成',
    downloadAgain: '再次下载',
    fileCount: (n: number) => `${n} 个文件`,
    downloaded: '已下载',
    error: '导出失败，请检查磁盘空间后重试。',
    retry: '重试',
  },
  fileImport: {
    title: '导入文件',
    subtitle: '将外部文件存入知识库或让 AI 帮你整理',
    dropzoneText: '拖拽文件到这里，或',
    dropzoneButton: '点击选择',
    dropzoneCompact: '拖拽更多文件，或',
    dropzoneCompactButton: '点击添加',
    dropzoneMobile: '点击选择文件',
    fileCount: (n: number) => `${n} 个文件`,
    clearAll: '清空全部',
    unsupported: '不支持的文件类型',
    tooLarge: (max: string) => `文件过大（最大 ${max}）`,
    archiveTitle: '存入知识库',
    archiveDesc: '原样归档到指定空间',
    digestTitle: 'AI 帮我整理',
    digestDesc: '提取要点，沉淀到笔记',
    archiveConfigTitle: '存入知识库',
    back: '← 返回',
    targetSpace: '目标空间',
    rootDir: '根目录',
    conflictLabel: '同名文件已存在时',
    conflictRename: '自动重命名（添加序号后缀）',
    conflictSkip: '跳过不导入',
    conflictOverwrite: '覆盖已有文件',
    overwriteWarn: '将永久替换已有文件内容',
    cancel: '取消',
    importButton: (n: number) => `存入 ${n} 个文件`,
    importing: '正在存入...',
    preparing: '准备中...',
    successToast: (n: number, space: string) => `已存入 ${n} 个文件到 ${space || '知识库'}`,
    updatedIndex: (n: number) => `更新了 ${n} 个索引文件`,
    partialToast: (ok: number, total: number) => `存入 ${ok}/${total} 个文件`,
    skipReason: '同名文件已存在',
    failToast: '导入失败',
    retry: '重试',
    undo: '撤销',
    discardTitle: '放弃导入？',
    discardMessage: (n: number) => `放弃已选的 ${n} 个文件？`,
    discardConfirm: '放弃',
    discardCancel: '取消',
    dropOverlay: '松开鼠标，导入文件到知识库',
    dropOverlayFormats: '支持 .md .txt .pdf .doc .docx .csv .json .yaml .xml .html',
    onboardingHint: '已有笔记？导入文件到知识库 →',
    digestPromptSingle: (name: string, targetSpace?: string) => {
      const loc = targetSpace ? `"${targetSpace}" 空间下` : '知识库中合适的位置';
      return `用户上传了「${name}」。你必须：\n1. 从上方「USER-UPLOADED FILES」区域读取文件内容\n2. 提取和重新整理关键信息为结构清晰的 Markdown 笔记\n3. 将整理后的内容保存到${loc}——可以创建新文件，也可以更新已有文件\n\n不要只做文字回复。你必须实际写入知识库。`;
    },
    digestPromptMulti: (n: number, targetSpace?: string) => {
      const loc = targetSpace ? `"${targetSpace}" 空间下` : '知识库中合适的位置';
      return `用户上传了 ${n} 个文件。你必须：\n1. 从上方「USER-UPLOADED FILES」区域读取它们的内容\n2. 提取和重新整理关键信息为结构清晰的 Markdown 笔记\n3. 将整理后的内容保存到${loc}——可以创建新文件，也可以更新已有文件\n\n不要只做文字回复。你必须实际写入知识库。`;
    },
    arrowTo: '→',
    remove: '移除',
    aiRecommended: '推荐',
    aiRecommendedHint: '根据文件名自动匹配',
    conflictsFound: (n: number) => `${n} 个文件已存在`,
    organizeTitle: 'AI 整理中',
    organizeProcessing: 'AI 正在分析和整理你的文件...',
    organizeConnecting: '正在连接 AI...',
    organizeAnalyzing: 'AI 正在分析你的文件...',
    organizeReading: (detail?: string) => detail ? `正在阅读 ${detail}...` : '正在阅读文件...',
    organizeThinking: 'AI 正在深度思考...',
    organizeWriting: (detail?: string) => detail ? `正在写入 ${detail}...` : '正在写入文件...',
    organizeElapsed: (seconds: number) => {
      const m = Math.floor(seconds / 60);
      const s = seconds % 60;
      return `${m}:${s.toString().padStart(2, '0')}`;
    },
    organizeCancel: '取消',
    organizeMinimize: '继续浏览',
    organizeExpand: '查看',
    organizeCreating: (path: string) => `正在创建 ${path}`,
    organizeUpdating: (path: string) => `正在更新 ${path}`,
    organizeReviewTitle: '整理完成',
    organizeErrorTitle: '整理失败',
    organizeReviewDesc: (n: number) => `AI 整理了 ${n} 处变更`,
    organizeCreated: '已创建',
    organizeUpdated: '已更新',
    organizeFailed: '失败',
    organizeNoChanges: 'AI 分析了你的文件，但没有做任何更改。',
    organizeToolCallsInfo: (n: number) => `AI 执行了 ${n} 个操作 — 请检查知识库查看更新`,
    organizeError: '整理失败',
    organizeRetry: '重试',
    organizeDone: '完成',
    organizeUndoAll: '撤销全部',
    organizeUndoOne: '撤销',
    organizeUndone: '已撤销',
    organizeViewFile: '查看文件',
    organizeUndoSuccess: (n: number) => `已撤销 ${n} 个文件`,
    organizeDetailTitle: 'AI 整理详情',
    organizeSourceFiles: '源文件',
    organizeSummaryLabel: 'AI 总结',
    organizeChangesLabel: (n: number) => `变更列表 (${n})`,
    organizeNoSummary: 'AI 正在处理中...',
    organizeMinimizeModal: '最小化',
  },
  importHistory: {
    title: '导入历史',
    clearAll: '清空历史',
    clearConfirm: '清空所有历史记录？此操作不可撤销。',
    emptyTitle: '暂无导入记录',
    emptyDesc: 'AI 整理的结果会出现在这里',
    back: '← 返回',
    sourceLabel: '来源',
    changesCount: (ok: number, total: number) => `${ok}/${total} 处变更`,
    changesSummary: (n: number) => `→ ${n} 处变更`,
    nFiles: (n: number) => `${n} 个文件`,
    statusUndone: '已撤销',
    statusCreated: '已创建',
    statusUpdated: '已更新',
    recordCount: (n: number) => `${n} 条记录`,
    today: '今天',
    yesterday: '昨天',
    older: '更早',
    processedArchive: '已处理的文件归档在收集箱路径 Inbox/.processed/ 中',
  },
  dirView: {
    gridView: '网格视图',
    listView: '列表视图',
    emptyFolder: '此目录为空。',
    fileCount: (n: number) => `${n} 个文件`,
    newFile: '新建文件',
    uninitTitle: '空间尚未初始化',
    uninitDesc: 'README.md 和 INSTRUCTION.md 仍是默认模板。配置 AI API 密钥后可自动生成个性化内容，或手动编辑。',
    uninitEditReadme: '编辑 README',
    uninitEditInstruction: '编辑 Instruction',
    uninitSettings: '设置',
    overviewNoFiles: '暂无文件可分析。',
    overviewCta: '生成概览',
    overviewCtaHint: (n: number) => `扫描 ${n} 个文件，生成空间概要`,
    overviewCtaNoKey: '请先在设置中配置 AI 密钥',
    overviewOrEdit: '或手动编辑 README.md',
    overviewGenerating: '正在生成概览…',
    overviewScanningFiles: (n: number) => `正在扫描 ${n} 个文件`,
    overviewRegenerate: '用 AI 重新生成概览',
    overviewRegenerateLabel: '刷新',
    overviewRegenerateConfirm: '将扫描变更文件并刷新概述，会消耗一定 AI 额度。',
    overviewRegenerateCancel: '取消',
    overviewRegenerateStart: '立即刷新',
    overviewUnchanged: '概述已是最新，没有文件变更。',
    overviewLastCompiled: (time: string) => `上次刷新：${time}`,
    overviewIncremental: (n: number) => `已从 ${n} 个变更文件增量更新`,
    overviewError: '无法生成概览',
    overviewRetry: '重试',
  },
  view: {
    saveDirectory: '目录',
    saveFileName: '文件名',
    delete: '删除',
    deleteConfirm: (name: string) => `确定删除「${name}」？文件将移至回收站。`,
    cancel: '取消',
    rename: '重命名',
    copyPath: '复制路径',
    more: '更多',
    dismiss: '关闭',
    tocTitle: '本页目录',
    tocCollapse: '收起',
    tocExpand: '展开',
    emptyNote: '此笔记为空。按 E 开始编辑。',
    switchToDoc: '文档视图',
    switchToGraph: '知识图谱',
  },
  findInPage: {
    placeholder: '在文档中查找…',
    matchCount: (current: number, total: number) => `${current} / ${total}`,
    noResults: '无结果',
  },
};
