Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ Gloss requires **macOS 14 or newer**.
brew install --cask sunchj/tap/gloss
```

Upgrade from the app or with:
Gloss checks the signed release channel after launch, at most once every 24
hours. When an update is available it presents an actionable reminder; official
Homebrew installations can update and restart directly from that prompt. You
can also update manually with:

```bash
brew update
Expand Down Expand Up @@ -87,7 +90,11 @@ gloss-cli browser --target 'Chinese (Simplified)' 'Translate this webpage.'
gloss-cli pdf paper-a.pdf paper-b.pdf \
--output ./translated \
--target 'Chinese (Simplified)' \
--mode mono
--mode bilingual

# Derive reusable reading copies from a bilingual master without translating again
./Scripts/export_pdf_side_by_side.sh translated/paper-a-gloss-dual.pdf
./Scripts/export_pdf_translation_only.sh translated/paper-a-gloss-dual.pdf

# Translate plain text locally
gloss-cli text --provider llama \
Expand All @@ -99,6 +106,12 @@ gloss-cli text --provider llama \
UI. `pdf` reports progress on stderr and writes the final artifact paths as
JSON on stdout, which makes it suitable for scripts.

The bilingual PDF is the reusable master: source and translated pages alternate.
The two export scripts create a permanent left/right spread or a translation-only
PDF without another translation pass. They derive output names beside the input;
pass an explicit output path as the second argument, or `--force` to replace an
existing derivative.

## Privacy and security

- Local-model translation keeps source text and translations on the device.
Expand Down
13 changes: 11 additions & 2 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ Gloss 要求 **macOS 14 或更高版本**。
brew install --cask sunchj/tap/gloss
```

可以在 App 内升级,也可以运行:
Gloss 会在启动后检查签名发布通道,每 24 小时最多一次。发现新版本时会主动提醒;
官方 Homebrew 安装可以直接在提醒中点击“更新并重新启动”。也可以手动运行:

```bash
brew update
Expand Down Expand Up @@ -79,7 +80,11 @@ gloss-cli browser --target 'Chinese (Simplified)' 'Translate this webpage.'
gloss-cli pdf paper-a.pdf paper-b.pdf \
--output ./translated \
--target 'Chinese (Simplified)' \
--mode mono
--mode bilingual

# 无需再次翻译,从双语母版快速派生阅读版本
./Scripts/export_pdf_side_by_side.sh translated/paper-a-gloss-dual.pdf
./Scripts/export_pdf_translation_only.sh translated/paper-a-gloss-dual.pdf

# 使用本地引擎翻译文本
gloss-cli text --provider llama \
Expand All @@ -90,6 +95,10 @@ gloss-cli text --provider llama \
`browser` 可以从参数或 stdin 读取正文,但不会操控浏览器 UI。`pdf` 将进度写入 stderr,
并以 JSON 形式将最终产物路径写入 stdout,适合用于自动化脚本。

双语 PDF 是可复用的母版,其中原文页与译文页交替排列。两个导出脚本无需再次翻译,
即可生成永久左右并排版或仅译文版。默认输出到输入文件所在目录;第二个参数可以指定
输出路径,已有派生文件需要使用 `--force` 才会覆盖。

## 隐私与安全

- 本地模型模式下,原文和译文都留在设备上。
Expand Down
4 changes: 2 additions & 2 deletions Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.1</string>
<string>1.0.2</string>
<key>CFBundleVersion</key>
<string>14</string>
<string>15</string>
<key>GlossSafariExtensionAvailable</key>
<true/>
<key>CFBundleDocumentTypes</key>
Expand Down
8 changes: 8 additions & 0 deletions Scripts/export_pdf_side_by_side.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

SCRIPT_DIRECTORY=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
exec /usr/bin/env swift \
"$SCRIPT_DIRECTORY/pdf_dual_export.swift" \
side-by-side \
"$@"
8 changes: 8 additions & 0 deletions Scripts/export_pdf_translation_only.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
set -eu

SCRIPT_DIRECTORY=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
exec /usr/bin/env swift \
"$SCRIPT_DIRECTORY/pdf_dual_export.swift" \
translation-only \
"$@"
Loading
Loading