[Proposal]: Offline Document & E-book Translation via Local Ollama

未关闭
#901 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
csharp
领域
desktop

调研方向

Start by reading the existing Tesseract and Whisper engine patterns, then inspect Settings → Engines and Settings → Presets, especially the Translate preset and profile placement described here. The proposal also calls for document-format-specific translation and Ollama management, but names no files or tests. Done means implementing the offline-only translation flow and the listed privacy, preset, and formatting requirements.

由索引模型根据 Issue 内容生成。

描述

translation
Summary

People frequently ask about translating documents, books, and text files. In keeping with Filee's core privacy promise ("Filee converts files on your own computer and never uploads them"), this proposal covers an offline document translation feature powered exclusively by local AI (Ollama running locally on http://127.0.0.1:11434 or local models).

Zero document text ever leaves the computer.


As per need for PR #836

1. Which Engine (Strictly Local Offline Only)
  • Local Loopback Only: Filee connects exclusively to the local Ollama instance at http://127.0.0.1:11434. There are no fallbacks to external web services, undocumented endpoints, or cloud APIs.
  • Privacy Enforcement (Cloud Models Blocked): Ollama also serves models whose tags end in -cloud (e.g. gpt-oss:120b-cloud), which forward requests to ollama.com. To protect sensitive documents, Filee explicitly detects and excludes cloud-forwarded tags (*-cloud) from automatic selection and refuses them with a clear security notice if selected manually.
  • Settings → Engines Card:
    • Follows the Tesseract and Whisper pattern as Translator (Offline AI).
    • Non-blocking async status check using a shared HttpClient with a fast 250 ms timeout, keeping the UI completely responsive when Ollama is not running.
    • Includes a built-in "Manage Ollama" dialog to let users inspect downloaded local models, switch the active model with one click, start/stop the local Ollama background server, and pull offline models with live progress, eliminating the need to use terminal commands manually.

2. Donut Placement & Preset Model (#806 / #832 Alignment)
  • Single Source of Truth in Preset Editor: Target languages (English, Spanish, Hindi, French, German, Chinese, Japanese, etc.) are configured directly in Settings → Presets under the Translate preset.
  • Donut Slice: A single clean Translate preset on the donut (no nested fan-out rings or extra clutter). Dropping files onto Translate converts directly to the target language configured in the Preset Editor.
  • #806 Compliance (New Installs Only):
    • Settings schema remains unchanged (stays at 58 as in main).
    • No migration modifying existing user profiles or donuts (ApplyToLibrary does not inject new slices into existing user setups).
    • Fresh installs place translate on the back face (BackPresetIds) of Document, Text, and E-books profiles.

3. Layout and Formatting Preservation (PDF & DOCX)
  • DOCX / HWPX / EPUB: Parses the document AST/XML structure into headings, paragraphs, runs, and tables. Text formatting (bold, italic, font sizing, line spacing, margins, lists, images, hyperlinks) is preserved; only text runs are translated in place.
  • PDF: Retains the high-fidelity translation pipeline that translates structured text blocks in place, preserving coordinates, font metrics, margins, and page dimensions without clipping or text corruption.
  • Plain Text / Markdown / Subtitles: Code fences, line breaks, tables, and subtitle timing cues (00:01:20,000 --> 00:01:23,000) are maintained cleanly.

Feedback and thoughts on this design are welcome!

主要语言
C#
星标
3.6k
派生
192
平均合并
7 小时 12 分钟
30 天内合并 PR
353

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

KnifeLemon/Filee 的其他 Issue

查看 KnifeLemon/Filee 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。