import type { Translations } from './zh';

export const en: Translations = {
  nav: {
    dashboard: 'Home',
    import: 'Import Bookmarks',
    library: 'My Bookmarks',
    tags: 'Tags',
    search: 'Smart Search',
    rescue: 'Organize',
    taxonomy: 'Taxonomy',
    settings: 'Settings',
    mcp: 'MCP',
  },

  dashboard: {
    welcome: 'Welcome to SiftMarks',
    welcomeDesc: 'A local-first AI bookmark manager for saving, organizing, searching, correcting, reviewing, and syncing bookmarks.',
    importBtn: 'Import bookmarks',
    needsRescue: 'Your bookmark library has items to organize.',
    needsRescueDesc: (stats: { bookmarks: number; broken: number }) => {
      let msg = `${stats.bookmarks.toLocaleString()} bookmarks imported. `;
      if (stats.broken > 0) msg += `${stats.broken} broken links detected. `;
      return msg;
    },
    runRescue: 'View organize suggestions',
    stats: {
      bookmarks: 'Bookmarks',
      folders: 'Folders',
      tags: 'Tags',
      duplicates: 'Already skipped',
      broken: 'Broken',
      missingSummaries: 'Missing Summaries',
      missingTags: 'Missing Tags',
    },
    actions: {
      import: 'Save / import bookmarks',
      importDesc: 'Bring browser bookmarks into the local library, then analyze content asynchronously',
      rescue: 'Handle organize suggestions',
      rescueDesc: 'Accept, edit, or dismiss rename, tag, and broken-link suggestions',
      search: 'Smart search',
      searchDesc: 'Search by what the page was for when you cannot remember the title',
      mcp: 'MCP Server',
      mcpDesc: 'Connect your bookmarks to AI tools',
    },
  },

  import: {
    title: 'Import Bookmarks',
    desc: "Upload your browser's exported bookmarks.html file. Supports Chrome, Firefox, Edge, and Brave.",
    dragDrop: 'Drag and drop your bookmarks.html here, or',
    chooseFile: 'Choose File',
    importBtn: 'Import Bookmarks',
    importing: 'Importing...',
    complete: 'Import Complete!',
    imported: 'New bookmarks',
    folders: 'Folders',
    duplicates: 'Already existed',
    missingTitles: 'Missing titles',
    viewLibrary: 'View Library',
    runRescue: 'Review Suggestions',
    detected: 'bookmarks detected',
    oneClick: 'One-click import →',
    manualUpload: 'Or upload a bookmarks.html file manually...',
  },

  library: {
    title: 'Library',
    noBookmarks: 'No bookmarks found.',
    importSome: 'Import some?',
    bookmarksCount: (n: number) => `${n} bookmarks`,
    filters: {
      all: 'All',
      untagged: 'Untagged',
      duplicates: 'Already existed',
      broken: 'Broken',
      missingSummary: 'Missing Summary',
    },
    sidebar: {
      status: 'Status',
      folders: 'Folders',
      allFolders: 'All folders',
      tags: 'Tags',
      allTags: 'All tags',
    },
    untitled: '(untitled)',
    dup: 'already existed',
    broken: 'broken',
    prev: 'Previous',
    next: 'Next',
    page: (current: number, total: number) => `Page ${current} of ${total}`,
  },

  search: {
    title: 'Smart Search',
    placeholder: 'I forgot the title, but I remember what it was for...',
    keyword: 'Keyword',
    memory: 'Semantic / Memory',
    searchBtn: 'Search',
    searching: 'Searching...',
    noResults: 'No matching bookmarks found. Try a broader search or index more bookmarks.',
    examples: ['MCP browser automation', 'local-first apps', 'SQLite vector search', 'AI coding agents'],
  },

  rescue: {
    title: 'Organize Suggestions',
    desc: 'Review AI organize and correction suggestions like a pull request before applying them.',
    runScan: 'Generate Suggestions',
    scanning: 'Scanning...',
    cleanupPR: (n: number) => `Cleanup PR: ${n} proposed changes for your bookmark library.`,
    cleanupPRDesc: 'Review every rename, tag, move, and deletion before applying.',
    acceptAllHigh: 'Accept all high confidence',
    acceptAll: (n: number) => `Accept All (${n})`,
    accepting: 'Accepting...',
    dismissAll: 'Dismiss All',
    acceptAndSync: (n: number) => `Accept All, then sync from Chrome extension (${n})`,
    syncToChrome: 'Check extension sync',
    syncingChrome: 'Checking Chrome sync operations...',
    syncDone: 'Chrome extension sync is ready',
    syncRenamed: (n: number) => `${n} renamed`,
    syncMoved: (n: number) => `${n} moved`,
    syncRemoved: (n: number) => `${n} removed`,
    syncBackup: (path: string) => `Original bookmarks backed up to: ${path}`,
    syncReady: (n: number) => `${n} Chrome bookmark operations are ready.`,
    syncUseExtension: 'Open the SiftMarks Chrome extension and click "Sync Back to Chrome" to apply them through the browser API.',
    syncNoOps: 'No Chrome bookmark operations need to be applied.',
    noPending: 'No pending suggestions. Your bookmarks are clean!',
    clickToScan: 'Click "Generate Suggestions" to find improvements.',
    accept: 'Accept',
    dismiss: 'Dismiss',
    confidence: (n: number) => `${n}% confidence`,
    types: {
      merge_duplicate: 'Already existed',
      delete_broken: 'Broken Links',
      rename: 'Rename',
      tag: 'Tags',
      move: 'Folders',
      normalize_tag: 'Normalize',
    },
    diff: {
      removeTitle: (title: string) => `- ${title || '(empty)'}`,
      addTitle: (title: string) => `+ ${title}`,
      removeBroken: '- Remove broken link',
      keepUrl: (url: string) => `+ Keep: ${url}`,
      addTags: (tags: string) => `+ Tags: ${tags}`,
    },
  },

  detail: {
    back: 'Back',
    untitled: '(untitled)',
    folder: 'Folder',
    tags: 'Tags',
    noTags: 'No tags yet',
    summary: 'AI Summary',
    description: 'Description',
    created: 'Created',
    imported: 'Imported',
    save: 'Save',
    cancel: 'Cancel',
    delete: 'Delete',
    notFound: 'Bookmark not found',
  },

  settings: {
    title: 'Settings',
    aiProvider: 'AI Provider',
    providerType: 'Provider Type',
    mock: 'Mock (no external AI)',
    openai: 'OpenAI Compatible',
    ollama: 'Ollama Compatible',
    baseUrl: 'Base URL',
    apiKey: 'API Key',
    chatModel: 'Chat Model',
    embeddingModel: 'Embedding Model',
    save: 'Save',
    saving: 'Saving...',
    saved: 'Saved!',
    privacy: 'Privacy',
    privacyDesc: 'SiftMarks is local-first by default. No data is sent externally unless you configure an AI provider above.',
    currentProvider: 'Current AI provider',
    localOnly: 'Local-only mode',
    on: 'On',
    off: 'Off',
    dangerZone: 'Danger Zone',
    resetDB: 'Reset database',
    resetDBDesc: 'Delete all bookmarks, tags, and suggestions.',
    reset: 'Reset',
  },

  mcp: {
    title: 'MCP Server',
    desc: 'Connect your bookmarks to Claude, Cursor, Windsurf, and other AI tools through the Model Context Protocol.',
    startServer: 'Start Server',
    startDesc: 'Run this command to start the MCP server:',
    claudeConfig: 'Claude Desktop Configuration',
    claudeConfigDesc: 'Add to',
    cursorConfig: 'Cursor Configuration',
    cursorConfigDesc: 'Add to',
    tools: 'Available Tools',
    toolDescs: {
      search_bookmarks: 'Search by keyword or natural language',
      read_bookmark: 'Get full bookmark details',
      list_tags: 'List all tags with counts',
      list_folders: 'List all folders with counts',
      find_related_bookmarks: 'Find related bookmarks by URL',
      summarize_collection: 'Summarize bookmarks by tag or folder',
      save_bookmark: 'Save a new bookmark from AI',
      run_bookmark_rescue: 'Generate cleanup suggestions',
      get_bookmark_stats: 'Get library statistics',
    },
  },

  taxonomy: {
    title: 'AI Taxonomy',
    desc: 'Let AI design a category scheme tailored to your bookmark library, then propose a move for every bookmark in one click. Nothing touches Chrome directly — every move shows up in Organize Suggestions for you to review.',
    notGeneratedYet: 'No taxonomy yet. Click below and AI will read your full library and propose 8-15 categories that fit your content.',
    libraryEmpty: 'Library is empty. Import some bookmarks first.',
    generate: 'Generate AI taxonomy',
    generating: 'AI is analyzing your library...',
    regenerate: 'Regenerate',
    confirmRegenerate: 'Regenerate the taxonomy? The current one will be replaced.',
    apply: 'Apply to all bookmarks',
    applying: 'AI is classifying...',
    appliedSummary: (created: number, total: number) => `Created move suggestions for ${created} of ${total} bookmarks.`,
    appliedSkipped: (n: number) => `${n} bookmarks were already in the right category — skipped.`,
    appliedErrors: (n: number) => `${n} batch(es) failed and fell back to the default category.`,
    viewSuggestions: 'Review in Organize Suggestions',
    deleteAll: 'Delete this taxonomy',
    confirmDelete: 'Delete the current taxonomy?',
    summary: (n: number, model: string, when: string) => `${n} categories · model ${model} · generated ${when}`,
    fallbackLabel: 'Fallback',
    addCategory: 'Add category',
    categoryName: 'Category name',
    description: 'Description',
    examples: 'Examples',
    save: 'Save changes',
    saving: 'Saving...',
    cancel: 'Cancel',
    edit: 'Edit',
    remove: 'Remove',
    mockProviderError: 'You are in Mock mode (no AI). Configure OpenAI or Ollama in Settings first, then come back.',
    goToSettings: 'Open settings',
  },

  common: {
    loading: 'Loading...',
  },
};
