{"id":50584248,"url":"https://github.com/benjihio/antigravity-chinese-patch","last_synced_at":"2026-06-05T05:00:37.272Z","repository":{"id":362600084,"uuid":"1259527585","full_name":"benjihio/antigravity-chinese-patch","owner":"benjihio","description":"Antigravity 客户端一键汉化与 Serif 字体优化打包工具 | Local Chinese interface patcher and Serif font enhancer for the Antigravity Electron client.","archived":false,"fork":false,"pushed_at":"2026-06-05T03:07:00.000Z","size":73,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-05T04:10:57.784Z","etag":null,"topics":["antigravity","antigravity-chinese","asar","chinese-patch","electron","i18n","localization","macos","serif-font","windows"],"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/benjihio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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":"2026-06-04T15:42:30.000Z","updated_at":"2026-06-05T03:07:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/benjihio/antigravity-chinese-patch","commit_stats":null,"previous_names":["benjihio/antigravity-chinese-patch"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/benjihio/antigravity-chinese-patch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjihio%2Fantigravity-chinese-patch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjihio%2Fantigravity-chinese-patch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjihio%2Fantigravity-chinese-patch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjihio%2Fantigravity-chinese-patch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benjihio","download_url":"https://codeload.github.com/benjihio/antigravity-chinese-patch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benjihio%2Fantigravity-chinese-patch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33930311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["antigravity","antigravity-chinese","asar","chinese-patch","electron","i18n","localization","macos","serif-font","windows"],"created_at":"2026-06-05T05:00:21.188Z","updated_at":"2026-06-05T05:00:37.263Z","avatar_url":"https://github.com/benjihio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Antigravity Chinese Patch\n\n[![CI](https://github.com/benjihio/antigravity-chinese-patch/actions/workflows/ci.yml/badge.svg)](https://github.com/benjihio/antigravity-chinese-patch/actions/workflows/ci.yml)\n[![Release](https://img.shields.io/github/v/release/benjihio/antigravity-chinese-patch?include_prereleases)](https://github.com/benjihio/antigravity-chinese-patch/releases)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nAntigravity 客户端汉化补丁工具。它会给 Antigravity Electron 客户端注入中文界面补丁，并保留全局 Serif 字体风格。\n\n\u003e 非官方项目：本工具不是 Google 或 Antigravity 官方语言包。它会修改本地 `app.asar`，请先确认你愿意承担本地补丁带来的兼容性风险。\n\n## Features\n\n- macOS / Windows 默认路径自动识别。\n- 运行时 DOM 汉化，覆盖文本、按钮、tooltip、placeholder、aria-label 和常见 data tooltip 属性。\n- 全局 `Lora + Noto Serif SC` Serif 字体风格，并尽量排除图标字体避免图标乱码。\n- 跳过代码块、终端、编辑器和输入内容，降低误翻代码的概率。\n- v2 marker 幂等注入，多次运行不会重复追加补丁。\n- 版本化备份 `app.asar` 和 `app.asar.unpacked`。\n- `--dry-run` 只读检查，`--restore` 一键恢复。\n- macOS 修改后自动 Ad-hoc 重签名。\n- GitHub Actions 自动检查并生成 release zip。\n\n## Quick Start\n\n```bash\ngit clone https://github.com/benjihio/antigravity-chinese-patch.git\ncd antigravity-chinese-patch\nnpm install\nnpm run check\nnode localize.js --dry-run\nnode localize.js\n```\n\n如果 Antigravity 不在默认路径，手动指定 `app.asar`：\n\n```bash\nnode localize.js --asar \"/Applications/Antigravity.app/Contents/Resources/app.asar\"\n```\n\nWindows 示例：\n\n```powershell\nnode localize.js --asar \"$env:LOCALAPPDATA\\Programs\\antigravity\\resources\\app.asar\"\n```\n\n运行前建议彻底退出 Antigravity。macOS 可以用 `Cmd + Q`，Windows 可从托盘或任务管理器退出。\n\n## Restore\n\n脚本每次正式补丁前都会创建版本化备份：\n\n```text\nantigravity-chinese-patch-backups/\n  2026-06-04T23-30-00-000Z/\n    app.asar\n    app.asar.unpacked/\n    metadata.json\n```\n\n恢复最近一次备份：\n\n```bash\nnode localize.js --restore\n```\n\n恢复指定安装路径：\n\n```bash\nnode localize.js --restore --asar \"/Applications/Antigravity.app/Contents/Resources/app.asar\"\n```\n\n不要只手动替换 `app.asar`。Electron 应用可能同时依赖 `app.asar.unpacked`。\n\n## Commands\n\n```bash\nnode localize.js                       # 交互式补丁\nnode localize.js --dry-run             # 只读检查，不写入应用\nnode localize.js --restore             # 恢复最近一次版本化备份\nnode localize.js --asar \u003cpath\u003e         # 指定 app.asar\nnode localize.js --no-sign             # macOS 跳过 codesign\nnode localize.js --force               # 强制用本地补丁覆盖已有 v2 补丁\nnpm run dist                           # 生成 GitHub release zip\n```\n\n## Default Paths\n\n- macOS: `/Applications/Antigravity.app/Contents/Resources/app.asar`\n- Windows: `%LOCALAPPDATA%\\Programs\\antigravity\\resources\\app.asar`\n\n## How It Works\n\n1. 定位 `app.asar`。\n2. 创建版本化备份，包含 `app.asar` 和 `app.asar.unpacked`。\n3. 解包 `app.asar`。\n4. 替换 `dist/preload.js` 中已有旧补丁或 v2 补丁，再注入 `hack_preload.js`。\n5. 汉化 `dist/loadingOverlay.js`。\n6. 根据现有 `app.asar.unpacked` 推断 `--unpack-dir`，重新封包并保留 sidecar 布局。\n7. macOS 下执行 Ad-hoc 重签名。\n\n## Missing Translations\n\n如果你发现仍有英文：\n\n1. 截图前先隐藏私人信息。\n2. 复制英文原文，例如 `Undo changes up to this point`。\n3. 打开 [Missing translation issue](https://github.com/benjihio/antigravity-chinese-patch/issues/new?template=missing_translation.yml)。\n\n欢迎直接提交 PR。翻译建议见 [CONTRIBUTING.md](CONTRIBUTING.md)。\n\n## Release Package\n\n本地生成 zip：\n\n```bash\nnpm run dist\n```\n\n输出位置：\n\n```text\ndist/antigravity-chinese-patch-v0.3.0.zip\n```\n\nGitHub 上推送 tag 会自动创建 Release：\n\n```bash\ngit tag v0.3.0\ngit push origin v0.3.0\n```\n\n## Known Limits\n\n- 这是运行时 DOM 文本替换，不等同于官方 i18n。\n- Antigravity 更新后，如果 `dist/preload.js` 或 `dist/loadingOverlay.js` 路径变化，脚本会停止并报错。\n- 某些远程加载或动态生成的文本可能需要继续补词库。\n- Google Fonts 可能受网络环境影响；如果字体加载失败，系统会回退到本地 Serif 字体。\n\n## License\n\nMIT. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjihio%2Fantigravity-chinese-patch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenjihio%2Fantigravity-chinese-patch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjihio%2Fantigravity-chinese-patch/lists"}