Repository navigation
Releases: ziyuw-Plank/gboard-gloss
Release list
v0.5.1
v0.5.1
- Top candidate is now translated with on-device neural machine translation (ML Kit); other candidates use the offline dictionary first and fall back to NMT only when the dictionary has no confident result.
- Offline fallback grammar: negation with subject agreement, auxiliaries, completed aspect and yes/no questions; ungrammatical stitched output is now hidden instead of shown.
- More robust NMT: missing language models download automatically on Wi-Fi, slow first translations finish in the background and are cached, the keyboard retries, and Settings shows the status of the last call from Gboard.
- README and pipeline diagram updated.
After upgrading: force-stop Gboard, open GboardGloss once.
- 首选候选改用端侧神经网络翻译(ML Kit);其余候选优先离线词典,词典没把握时再用神经网络翻译。
- 离线兜底语法:否定与主谓一致、助动词、完成体、是非疑问句;不合语法的拼接结果改为不显示。
- 神经网络翻译更稳:缺少的模型在 Wi-Fi 下自动下载,首次较慢的翻译在后台完成并缓存,键盘端自动重试,设置页显示 Gboard 最近一次调用状态。
- 更新 README 与流程图。
升级后:强行停止 Gboard,并打开一次 GboardGloss。
GboardGloss v0.5.0
GboardGloss 0.5.0
中文
- 混合翻译:单词用离线词典,短语用端侧神经网络机器翻译(Google ML Kit NMT),译文有完整语法和自然语序
- 翻译在模块自身进程内完成,Gboard 通过轻量 IPC 异步获取,不阻塞绘制
- 省电:停止输入约 150 ms 后才翻译,只翻前几个候选;内存 + 磁盘缓存
- 设置页:下载语言模型(可选仅 Wi‑Fi)、模型状态、试译输入框;下载后完全离线,输入不出设备
- 词典兜底译文加入基础语法修正
- Android 11+ 包可见性适配(可选勾选「系统框架」作用域)
- 首次使用:打开设置页下载模型,并在「试一试」输入框里用 Gboard 打几个字
English
- Hybrid translation: offline dictionary for words, on-device neural machine translation (Google ML Kit NMT) for phrases, with proper grammar and word order
- Translation runs in the module's own process; Gboard fetches it asynchronously over lightweight IPC, never blocking drawing
- Battery: translates only after ~150 ms of no typing, leading candidates only; memory + disk cache
- Settings: model download (optional Wi‑Fi only), model status, try-it box; fully offline after download, nothing you type leaves the device
- Basic grammar fixes for the dictionary fallback
- Android 11+ package-visibility handling (optional "System Framework" scope)
- First run: open Settings, download models, then type a few characters with Gboard in the "try it" box
GboardGloss v0.4.0
GboardGloss 0.4.0
中文
- 离线短语引擎:按词频分词,并按英语语序组合短语译文;处理否定、代词、语气词、量词和疑问句
- 词义选择更准:优先常用读音与常用义项,过滤异体、方言、俚语、姓氏等误导义项
- 英→中查词与日文汉字词查词更准;支持繁体
- 内置词表扩充:日常聊天用语、常见词的现代义、计算机/AI 与理工术语
- 不确定时宁可留空;查词更快,内存占用更低
- 新增离线评测工具与结果记录(
tools/eval)
English
- Offline phrase engine: frequency-weighted segmentation, composed into English word order; handles negation, pronouns, particles, measure words and questions
- Better sense choice: common reading and common sense first; variant, dialect, slang and surname senses filtered out
- More accurate en→zh and Japanese kanji lookups; Traditional Chinese supported
- Larger builtin glossary: everyday chat expressions, modern senses of common words, computing/AI and science terms
- Shows nothing when unsure; faster lookups and lower memory use
- New offline evaluation harness and results log (
tools/eval)
After upgrading, force-stop Gboard. / 升级后请强停 Gboard。
GboardGloss 0.3.2
Changes
- Package id
io.github.ziyuw_plank.gboardglossfor Modules-Repo (underscore required) - Concept diagrams in
docs/ - Listed on Xposed Module Repository (LSPosed & Vector): https://github.com/Xposed-Modules-Repo/io.github.ziyuw_plank.gboardgloss
Upgrade
Uninstall older packages (com.zyw.gloss / io.github.ziyuwplank.gboardgloss), install this APK, re-enable in LSPosed/Vector, force-stop Gboard.
Action needed
Open https://github.com/Xposed-Modules-Repo/io.github.ziyuw_plank.gboardgloss in a browser and set the repository Description to GboardGloss (API cannot set it). Without that, the module may not appear on modules.lsposed.org.
GboardGloss 0.3.1
Changes
- Package id renamed to
io.github.ziyuwplank.gboardglossfor LSPosed / Vector module repository listing - Concept diagrams added to README (
docs/*.svg) - INTERNET permission for optional online fill-in
Upgrade
Uninstall the legacy package com.zyw.gloss before installing this build, then force-stop Gboard and re-enable the module in LSPosed / Vector.
Notes
Vector and LSPosed share https://modules.lsposed.org — no separate Vector store submission.
GboardGloss 0.3.0
中文
- 译词质量:仅展示可信的整词/词表命中;不再用劣质切分拼出译文
- 内置领域词表,设置页可导入自定义 TSV;精确匹配优先于通用词典
- 视觉:候选下方次要标签、约 60% 透明度、跟随深浅色,减少拥挤与刺眼对比色
- 长度:按完整词元截断
- 可选在线补全(默认关):离线未命中时异步请求并缓存,不阻塞绘制
- 安装后请强行停止 Gboard 再试
English
- Gloss quality: trusted whole-entry / glossary hits only; no poor segmentation stitches
- Built-in domain glossary + Settings TSV import; exact matches beat general dictionaries
- Visuals: soft secondary label (~60% alpha), light/dark aware; less crowding
- Length: truncate on token boundaries only
- Optional online fill-in (off by default): async + cached on offline miss; never blocks drawing
- Force-stop Gboard after installing
APK: GboardGloss-0.3.0.apk
GboardGloss 0.2.2
Fix: wrong translations on multi-char candidates
Root cause: CJK longest-prefix fallback could shrink all the way to a single character, so candidates like 我不理解 showed the gloss for 我 (“I; me; my”). Also 离 was stuck on the archaic CEDICT sense “mythical beast”.
Changes
- Prefer exact whole-candidate match
- Longest-prefix only if length ≥ 2 (never single-char for multi-char candidates)
- 不/没 composition, leading-pronoun strip, bipartite segment when both sides hit
- Cleaner English: first sense only, strip leading “to”
- Rebuilt zh↔en dictionary with sense quality ranking (离 → leave)
Install
- Install
GboardGloss-0.2.2.apk - LSPosed: enable module, scope Gboard
- Force-stop Gboard and type again
Expected: 我不理解 → not comprehend, 离 → leave, 这是 → this · be
GboardGloss v0.2.1
GboardGloss v0.2.1
中文
修复:注入成功但候选词没有译文
根因: Android aapt2 会把 assets 里的 *.tsv.gz 解压并去掉 .gz 后缀。模块一直在找 dicts/zh_en.tsv.gz,词典实际从未打开,所以所有翻译都是空的。
改动:
- 词典同时支持
.tsv.gz与.tsv - 中文等无整词时用最长前缀回退(例如「这是」→「这」→ this)
- SoftKeyView 绑定标签时才查词典并缓存;绘制只画缓存字符串
- 是否在候选条上的判断结果写入 View tag,不再每帧爬父节点
- 译词用高对比度琥珀色(深色)/ 蓝色(浅色),避免和候选字同色看不见
省电: 不 hook TextView.onDraw;不在每帧做字符串处理或词典查找;复用 Paint;仅在候选词文字变化时 invalidate 对应 SoftKeyView。
安装后请在 LSPosed 确认作用域,强行停止 Gboard,再打开输入框测试。日志筛选 [gloss],应能看到 dict zh_en size=... 与 bind '这' → this。
English
Fix: injection banner worked but no gloss on candidates
Root cause: aapt2 decompresses assets/*.tsv.gz and strips the .gz suffix, so dictionary files never opened.
Also: CJK longest-prefix fallback; bind-time cache + tagged candidate check; high-contrast amber/blue gloss; battery-friendly draw path (no per-frame dict/parent walk, no global TextView.onDraw hook).
Force-stop Gboard after install. Look for [gloss] logs.
GboardGloss v0.2
中文
v0.2 相比 v0.1
- 词典改为从模块 APK 内读取(修复 Android 11+ 包可见性导致读不到词典)
- 改为在候选词 SoftKeyView 上叠加绘制译词
- 新增注入成功提示(toast + 底部胶囊条)
- 多语言:自动识别源语言,目标支持英/中/日/德/法/西/俄,经英语中转
- Material You 控制中心、调试模式
[gloss] 日志。
安装:安装 APK → LSPosed 启用并勾选 Gboard → 强停 Gboard → 打开 GboardGloss 选目标语言 → 打字测试。
English
Changes since v0.1
- Dictionaries loaded from the module APK (fixes Android 11+ package visibility issue)
- Gloss drawn as an overlay on candidate SoftKeyViews
- Injection toast + fading bottom banner
- Multi-language: auto source detection; targets en/zh/ja/de/fr/es/ru via English pivot
- Material You control center, debug mode
[gloss] logs.
Install: install APK → enable in LSPosed, scope Gboard → force-stop Gboard → open GboardGloss, pick a target language → type.