{"id":49547804,"url":"https://github.com/lmanchu/fliplang","last_synced_at":"2026-05-04T17:36:24.059Z","repository":{"id":321881231,"uuid":"1087505765","full_name":"lmanchu/fliplang","owner":"lmanchu","description":"Privacy-first translation Chrome extension: Fast Google Translate + Local AI (Ollama). Hover, select, or translate entire pages.","archived":false,"fork":false,"pushed_at":"2026-05-01T09:47:40.000Z","size":3460,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-01T11:24:57.205Z","etag":null,"topics":["ai","bilingual","chrome-extension","google-translate","ollama","privacy","productivity","translation"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lmanchu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-01T03:41:52.000Z","updated_at":"2026-05-01T09:47:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lmanchu/fliplang","commit_stats":null,"previous_names":["lmanchu/iris-immersive-translate","lmanchu/fliplang"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/lmanchu/fliplang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmanchu%2Ffliplang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmanchu%2Ffliplang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmanchu%2Ffliplang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmanchu%2Ffliplang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmanchu","download_url":"https://codeload.github.com/lmanchu/fliplang/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmanchu%2Ffliplang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32549384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T19:18:06.202Z","status":"ssl_error","status_checked_at":"2026-05-02T19:16:21.335Z","response_time":132,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","bilingual","chrome-extension","google-translate","ollama","privacy","productivity","translation"],"created_at":"2026-05-02T20:36:54.424Z","updated_at":"2026-05-04T17:36:24.052Z","avatar_url":"https://github.com/lmanchu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌐 Fliplang\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Chrome Extension](https://img.shields.io/badge/Chrome-Extension-4285F4?logo=googlechrome\u0026logoColor=white)](https://chromewebstore.google.com)\n[![Made with Ollama](https://img.shields.io/badge/Made%20with-Ollama-black?logo=ai\u0026logoColor=white)](https://ollama.com)\n[![Privacy First](https://img.shields.io/badge/Privacy-First-success)](https://github.com/lmanchu/fliplang)\n\n**Privacy-first translation with dual engines: Fast Google Translate + Local AI**\n\nA powerful Chrome extension that combines the speed of Google Translate with the privacy of local Ollama AI models.\n\n---\n\n## ✨ 特色功能\n\n### 🔒 雙引擎支援\n- ⚡ **Google Translate**：快速、免費、高品質（預設推薦）\n- 🔐 **Ollama 本地模型**：完全隱私、離線可用、可自訂\n- 🎯 **自由切換**：在設定中一鍵切換翻譯引擎\n\n### 🎯 翻譯方式\n- **Hover 翻譯**：將滑鼠移到段落上，按 `Ctrl` 即時翻譯 ⭐ **新功能**\n  - 自動句子分割，逐句顯示雙語對照\n  - 不需要選取文字，直接 hover 即可\n  - 類似沉浸式翻譯的使用體驗\n- **選取翻譯**：選擇文字後按 `Alt+T`（所有平台）\n- **整頁翻譯**：按 `Ctrl+Shift+A`（所有平台）翻譯整個網頁\n- **雙語對照**：原文和譯文並排顯示，保持排版\n\n### 🤖 AI 模型支援\n- 支援所有 Ollama 模型\n- 推薦模型：\n  - `gpt-oss:20b` - GPT 開源模型，翻譯品質優異（預設）\n  - `llama3.3` - Meta 最新模型，多語言支援強\n  - `qwen2.5` - 阿里巴巴模型，中文翻譯出色\n  - `gemma2` - Google 模型，快速且準確\n\n### 🎨 美觀界面\n- 現代化設計（漸層紫色主題）\n- 流暢動畫效果\n- 響應式設計（支援手機、平板）\n- 可自訂樣式\n\n---\n\n## 📋 系統需求\n\n### 必需\n1. **Chrome / Chromium / BrowserOS**\n   - Chrome 88 或更新版本\n   - 支援 Manifest V3\n\n2. **Ollama**\n   - 安裝教學：https://ollama.ai\n   - 至少下載一個模型（例如 `ollama pull llama3.3`）\n\n### 推薦\n- macOS / Linux / Windows\n- 8GB+ RAM（運行本地模型）\n- 網速不限（完全本地運行）\n\n---\n\n## 🚀 安裝步驟\n\n### Step 1: 安裝 Ollama\n\n```bash\n# macOS\nbrew install ollama\n\n# 或從官網下載\n# https://ollama.ai/download\n```\n\n### Step 2: 下載模型\n\n```bash\n# 下載 GPT-OSS 20B（預設推薦）\nollama pull gpt-oss:20b\n\n# 或其他模型\nollama pull llama3.3\nollama pull qwen2.5\nollama pull gemma2\n```\n\n### Step 3: 啟動 Ollama（允許跨域）⚠️ **重要**\n\n為了讓 Chrome Extension 能夠訪問本地 Ollama API，必須設置 CORS：\n\n**macOS (推薦使用 LaunchAgent):**\n```bash\n# 停止現有的 Ollama\nkillall ollama Ollama\n\n# 創建 LaunchAgent\ncat \u003e ~/Library/LaunchAgents/com.ollama.cors.plist \u003c\u003c 'EOF'\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003c!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"\u003e\n\u003cplist version=\"1.0\"\u003e\n\u003cdict\u003e\n    \u003ckey\u003eLabel\u003c/key\u003e\n    \u003cstring\u003ecom.ollama.cors\u003c/string\u003e\n    \u003ckey\u003eProgramArguments\u003c/key\u003e\n    \u003carray\u003e\n        \u003cstring\u003e/Applications/Ollama.app/Contents/Resources/ollama\u003c/string\u003e\n        \u003cstring\u003eserve\u003c/string\u003e\n    \u003c/array\u003e\n    \u003ckey\u003eEnvironmentVariables\u003c/key\u003e\n    \u003cdict\u003e\n        \u003ckey\u003eOLLAMA_ORIGINS\u003c/key\u003e\n        \u003cstring\u003echrome-extension://*,http://localhost:*,https://localhost:*,file://*,*\u003c/string\u003e\n        \u003ckey\u003eOLLAMA_HOST\u003c/key\u003e\n        \u003cstring\u003e127.0.0.1:11434\u003c/string\u003e\n    \u003c/dict\u003e\n    \u003ckey\u003eRunAtLoad\u003c/key\u003e\n    \u003ctrue/\u003e\n    \u003ckey\u003eKeepAlive\u003c/key\u003e\n    \u003ctrue/\u003e\n    \u003ckey\u003eStandardOutPath\u003c/key\u003e\n    \u003cstring\u003e/tmp/ollama-stdout.log\u003c/string\u003e\n    \u003ckey\u003eStandardErrorPath\u003c/key\u003e\n    \u003cstring\u003e/tmp/ollama-stderr.log\u003c/string\u003e\n\u003c/dict\u003e\n\u003c/plist\u003e\nEOF\n\n# 啟動服務\nlaunchctl load ~/Library/LaunchAgents/com.ollama.cors.plist\n```\n\n**Linux:**\n```bash\n# 設置環境變量並啟動\nOLLAMA_ORIGINS=\"chrome-extension://*,http://localhost:*,https://localhost:*,file://*,*\" ollama serve\n```\n\n**Windows:**\n```powershell\n# 在系統環境變數中設定\n$env:OLLAMA_ORIGINS=\"chrome-extension://*,http://localhost:*,https://localhost:*,file://*,*\"\nollama serve\n```\n\n### Step 4: 安裝 Chrome Extension\n\n1. 打開 Chrome，進入 `chrome://extensions/`\n2. 開啟右上角的「開發者模式」\n3. 點擊「載入未封裝項目」\n4. 選擇 `iris-immersive-translate` 資料夾\n5. 完成！Extension 已安裝\n\n### Step 5: 配置設定\n\n1. 點擊 Extension 圖標\n2. 檢查設定：\n   - **Ollama API 端點**: `http://localhost:11434`\n   - **模型**: `gpt-oss:20b`（或你下載的模型）\n   - **目標語言**: 選擇你想翻譯成的語言（預設：繁體中文）\n3. 點擊「測試連線」確認運作正常\n4. 點擊「儲存設定」\n\n---\n\n## 🎯 使用方法\n\n### 方法 1: Hover 翻譯 ⭐ **推薦**\n\n1. 將滑鼠移到任何段落上\n2. 按住 `Ctrl` 鍵（所有平台，包含 macOS）\n3. 段落會自動分割成句子並逐句顯示雙語對照\n4. 每個句子的譯文會顯示在原文下方，帶有紫色標記\n\n**特點：**\n- 🎯 不需要選取文字，直接 hover 即可\n- 📝 自動句子分割（支援中英文標點）\n- 🎨 即時顯示，保持網頁排版\n- 💾 翻譯結果會被緩存，相同內容不會重複翻譯\n- ⚡ **使用 Google Translate 速度極快！**\n\n### 方法 2: 選取翻譯\n\n1. 在任何網頁上選取文字\n2. 按 `Alt+T`（所有平台）\n3. 翻譯結果會以工具提示框顯示在選取文字旁\n\n### 方法 3: 整頁翻譯\n\n1. 在任何網頁上按 `Ctrl+Shift+A`（所有平台）\n2. 等待翻譯完成\n3. 頁面會顯示雙語對照（原文在上 + 譯文在下）\n\n### 取消翻譯\n\n- 再次按 `Ctrl+Shift+A` 取消整頁翻譯\n\n---\n\n## 🔧 進階配置\n\n### 自訂快捷鍵\n\n1. 進入 `chrome://extensions/shortcuts`\n2. 找到「Fliplang」\n3. 自訂你喜歡的快捷鍵\n\n### 更換模型\n\n不同模型有不同特性：\n\n| 模型 | 優點 | 缺點 | 推薦用途 |\n|------|------|------|----------|\n| `gpt-oss:20b` | 品質優異，平衡性能 | 需要較多記憶體 | 通用翻譯（預設） |\n| `llama3.3` | 多語言支援強 | 較大（4.7GB） | 專業翻譯 |\n| `qwen2.5` | 中文翻譯出色 | 英文稍遜 | 中文內容 |\n| `gemma2` | 快速，佔用少 | 品質中等 | 日常瀏覽 |\n\n### 效能優化\n\n```bash\n# 如果翻譯速度慢，可以嘗試量化模型\nollama pull llama3.3:Q4_K_M  # 4-bit 量化，更快\n\n# 或使用更小的模型\nollama pull llama3.3:1b  # 1B 參數版本\n```\n\n---\n\n## 📂 專案結構\n\n```\niris-immersive-translate/\n├── manifest.json          # Extension 配置（Manifest V3）\n├── background.js          # Service Worker（監聽快捷鍵、調用 Ollama）\n├── content.js             # Content Script（翻譯邏輯、UI）\n├── popup.html             # 設定介面\n├── popup.js               # 設定邏輯\n├── styles/\n│   └── translate.css      # 翻譯樣式（雙語對照）\n├── icons/\n│   ├── icon16.png\n│   ├── icon48.png\n│   └── icon128.png\n└── README.md\n```\n\n---\n\n## 🛠️ 開發\n\n### 本地開發\n\n```bash\n# 克隆專案\ncd ~/iris-immersive-translate\n\n# 修改代碼後，在 chrome://extensions/ 點擊「重新載入」\n```\n\n### 調試\n\n- **Background Script**: 在 Extension 詳細頁面點擊「Service Worker」\n- **Content Script**: 在網頁上按 `F12` 打開 DevTools，查看 Console\n- **Popup**: 右鍵點擊 Extension 圖標 → 檢查彈出式視窗\n\n---\n\n## 🤝 貢獻\n\n歡迎貢獻！可以改進的方向：\n\n- [ ] 支援更多翻譯模式（懸浮翻譯、即時翻譯）\n- [ ] 支援 PDF 翻譯\n- [ ] 支援影片字幕翻譯\n- [ ] 增加翻譯歷史記錄\n- [ ] 支援自訂提示詞（Prompt）\n- [ ] 優化批次翻譯性能\n- [ ] 支援其他 LLM API（OpenAI, Gemini 等）\n\n---\n\n## 📝 授權\n\nMIT License\n\n## 🔒 隱私政策\n\n請查看我們的 [Privacy Policy](./PRIVACY-POLICY.md) 了解我們如何處理你的數據。\n\n**簡要說明**：\n- **Google Translate 模式**：文字會發送到 Google 進行翻譯\n- **Ollama 模式**：所有處理都在本地進行，完全隱私\n- **無追蹤**：我們不收集分析數據或個人資訊\n- **開源透明**：所有代碼公開可審計\n\n---\n\n## 💡 靈感來源\n\n本專案受到 [沉浸式翻譯](https://immersivetranslate.com/) 的啟發，致力於提供：\n- ✅ 完全本地化的替代方案\n- ✅ 更強的隱私保護\n- ✅ 完全免費\n- ✅ 可自訂的 AI 模型\n\n---\n\n## 🆘 常見問題\n\n### Q: Ollama 連線失敗？\n**A**: 確認：\n1. Ollama 是否正在運行：`ollama list`\n2. 是否設定跨域：`OLLAMA_ORIGINS=\"*\" ollama serve`\n3. 端點是否正確：`http://localhost:11434`\n\n### Q: 翻譯速度很慢？\n**A**:\n1. 使用量化模型：`ollama pull llama3.3:Q4_K_M`\n2. 使用更小的模型：`gemma2:2b`\n3. 檢查 CPU/GPU 使用率\n\n### Q: 翻譯品質不佳？\n**A**:\n1. 更換更大的模型：`llama3.3:70b`\n2. 調整提示詞（修改 `background.js` 中的 prompt）\n3. 使用專門的翻譯模型\n\n### Q: 支援哪些瀏覽器？\n**A**:\n- ✅ Chrome 88+\n- ✅ BrowserOS\n- ✅ Edge（Chromium 版）\n- ✅ Brave\n- ⚠️ Firefox（需修改為 Manifest V2）\n\n---\n\n## 📧 聯絡\n\n有問題或建議？歡迎聯絡：\n- **GitHub**: [lmanchu/fliplang](https://github.com/lmanchu/fliplang)\n- **Issues**: [提交問題](https://github.com/lmanchu/fliplang/issues)\n- **Privacy Policy**: [隱私政策](./PRIVACY-POLICY.md)\n\n---\n\n**Powered by Iris 🤖 | Built with ❤️ for Privacy**\n\n---\n\n## 🤖 Built by Iris\n\n這個 Chrome Extension 是由 **Iris** 開發的 - 一個基於 Claude Code 的 AI 助理系統（MAGI System 的一部分）。\n\n**開發時間：** 2025-11-01（約 6 小時從概念到完成）\n\n想了解 Iris 系統和開發方法論？查看：\n**[Iris System Repository](https://github.com/lmanchu/iris-system)** 🔗\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmanchu%2Ffliplang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmanchu%2Ffliplang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmanchu%2Ffliplang/lists"}