github-chinese

# [GitHub 中文化插件][project-url] > 让 GitHub 界面全面中文化 | 源自 [52cik/github-hans](https://github.com/52cik/github-hans) **简体中文** · [繁體中文](/github-chinese/README_zh-TW.html) [![GitHub issues][issues-image]][issues-url] [![GitHub stars][stars-image]][stars-url] [![GitHub forks][forks-image]][forks-url] [![license GPL-3.0][license-image]][license-url] [![GreasyFork installs][greasyFork-image]][greasyFork-url] Featured|HelloGitHub

[!warning] 本项目从未发布至 GitCode,如您发现请截图并保留证据

目录

🌟 功能特性

🌐 兼容环境

浏览器类型 支持的脚本管理器
Chrome / Chromium 内核 [Tampermonkey][Tampermonkey], [Violentmonkey][Violentmonkey]
Safari(全平台) [Macaque][Macaque], [Stay][Stay]
Firefox / Gecko 内核 [Tampermonkey][Tampermonkey], [Violentmonkey][Violentmonkey]
Via(Android) 内置管理器

💻 安装指南

  1. 安装用户脚本管理器:
    • 推荐:[Tampermonkey][Tampermonkey]
  2. 开启浏览器 “扩展程序” 管理中的 “开发者模式”1
  3. 选择安装源:
    • [GitHub 源【开发版】][main.user.js]
    • [GitCode 镜像【开发版】][main(gitcode).user.js]【国内】
    • [GreasyFork 源【稳定版】][main(greasyfork).user.js]
  4. 刷新页面后,插件即可生效

[!NOTE] 版本说明

🔧 本地调试

  1. 安装 [Tampermonkey][Tampermonkey],并启用 “允许访问文件网址”。
  2. 下载词库文件到本地(如:D:\github-chinese\locals.js
  3. 在脚本管理器中修改引用路径:
    // 原始路径
    // @require https://raw.githubusercontent.com/...
       
    // 修改为
    // @require file:///D:/github-chinese/locals.js
    
  4. 刷新页面生效

[!TIP] 💡 温馨提示: 您可以将词库文件拖拽至浏览器地址栏,复制路径直接使用。

[![][back-to-top]](#readme-top)

🔄 更新日志

最新版本

v1.9.3 (2024-08-18)
  1. 新增功能:通过设置中文环境,自动本地化时间元素,仅保留on开头的时间正则,并停用时间元素监视
  2. 优化突变翻译处理:
    • 引入characterDataPage规则,对特定页面启用筛选字符数据的变更
    • 引入ignoreMutationSelectorPage规则,忽略特定突变元素
  3. 合并reIgnoreClass,reIgnoreItemprop,ignoreId,ignoreTagignoreSelectorPage规则,处理全局及特定页面,忽略特定元素
  4. 引入全局缓存模式,减少重复构建包括不限于基于page变化的忽略规则、正则规则数组等
  5. 调整:更新讯飞听见翻译引擎v2.0
  6. 优化:梳理、优化脚本
  7. 调整:调整词库语言代码为zh-CN, 与环境语言设置一致

查看历史版本

#### v1.9.2 (2024-06-14) 1. 适配`www.githubstatus.com` 1. 适配`skills.github.com` #### v1.9.1 (2024-05-23) 1. 更新`切换正则功能按钮` #### v1.9.0 (2023-12-09) 1. 重新定义版本号规则, 如`1.9.0-2023-12-09`。 - `1.9.0`: 主版本号(由项目所有者更新) - `2023-12-09`:`词库`发布版本号(由 GitHub Action 自动更新) 1. 加强: [GitHub 源【开发版】][main.user.js]每周一凌晨自动更新`词库`发布版本号 1. 加强: [GreasyFork 源【稳定版】][main(greasyfork).user.js]每周五凌晨自动更新`词库`发布版本号, 词库内容同上一次[GitHub 源【开发版】][main.user.js] 1. 加强:在 `README.md` 中自动更新贡献者头像 1. 更新: 忽略规则, 词条等 #### v1.8.5 (2023-08-31) 1. 优化: `transDesc 函数`代码 1. 修复: 重复添加`translate-me`翻译按钮 1. 加强:`watchUpdate 函数`新增节点文本更新的情况 1. 调整: `transBySelector和transDesc函数`延迟执行时间 1. 更新: 忽略规则, 词条等 #### v1.8.4 (2023-08-08) 1. 修复: `Itemprop`过滤规则, 依然使用正则方式 1. 修复: `tooltipped`样式提示, 依然使用正则方式 #### v1.8.3 (2023-08-07) 1. 梳理、优化脚本 1. 更新: 忽略规则, 大量词条等 #### v1.8.2 (2023-05-15) 1. `greasyfork 托管`源切换到`按页面精细化词条模式` 1. 调整词库格式 1. 功能加强: 优化`元素筛选器`翻译逻辑 1. 更新: 忽略规则, 大量词条等 #### v1.8.1 (2023-01-22) 1. 修复: #8 与 dark reader 扩展发生冲突,导致时间显示出现问题 1. `GitHub`源开始切换到`按页面精细化词条模式(开发版)`, 词库未完全迁移适配 1. 停止`greasyfork`源词库文件的同步更新 #### v1.8.0 (2023-01-18) 1. 删除: `TURBO-FRAME`框架处理代码. Github 已调整新动态加载模式, 直接检测`url`的变化就能获取对应的`page`信息 1. 新增: 支持时间元素的`Shadow DOM`翻译, 并监听变化 1. 新增: 启用并更新`时间元素翻译`专项正则词条 1. 新增: 仅当`page`有效才翻译页面 1. 修复: 原`简介翻译`引擎`GitHub中文社区`失效, 改为`讯飞`引擎(测试) 1. 修复: 追加公共正则重复迭代的问题 1. 修复: 正则标记变量`RegExp`与构造函数`new RegExp`冲突 1. 更新: 忽略规则, 词条等 预告, 下次将细化`page`匹配规则, 导致词库文件结构大调整, 词库文件会适当变大, 页面正则更精细效率会提升 #### v1.7.9 (2022-07-17) GitHub 的 ajax 载入方式逐步从 [defunkt/jquery-pjax](https://github.com/defunkt/jquery-pjax) 切换到 [hotwired/turbo](turbo.hotwired.dev), 导致已有的动态监测方式逐步失效 目前, 通过以下修复: 1. 新增 `BODY` 元素新增监视 1. 解析 `TURBO-FRAME` 框架, 获取对应的 `page` 1. 修复 github 新动态加载模式, 导致`翻译描述`返回值无法插入 1. 修复 github 新动态加载模式, 导致`chrome`浏览器自带翻译功能卡死页面 其他更新: 1. 修复`rePagePath`,`rePagePathRepo`,`rePagePathOrg`匹配规则,限制路径匹配层次,排除干扰 1. 直接使用网页URL`document.URL`变化触发`标题翻译`和`JS 筛选器`翻译 1. 修复`关闭正则`无法生效, 需要刷新页面才生效 1. 日常更新词库和忽略规则 1. 更新`JS 筛选器`规则 #### v1.7.8 (2022-06-29) 1. 紧急修复: GitHub 变更了`document.body`和`title`更新机制, 导致原有的`监测更新`规则部分失效, 目前使用`document.documentElement`监视整个页面 DOM 的变更 1. 跳过``标签 1. `标题翻译`和`JS 筛选器`翻译, 依据 URL变化更新 #### v1.7.7 (2022-06-26) 1. 新增`时间元素翻译`功能 1. 重写`页面标题翻译`函数 1. 梳理`遍历节点`函数逻辑 1. 优化`transPage`函数,默认翻译公共部分 1. 调整`getPage`函数, 使`ClassName匹配规则`优先 1. 优化`translate`函数, 跳过`不存在英文字母和符号,.`, 保留首尾空白部分等 1. 部分函数重命名,使用`es6`新语法 1. 日常更新词库和忽略规则,修复一个`JS 选择器规则` #### v1.7.6 (2022-05-12) 1. 日常更新词库和忽略规则 1. 添加手动开启/禁用正则翻译,添加切换菜单 1. 优化翻译文本函数:避免已翻译词汇二次匹配,提高效率;局部翻译优先于全局 </details>
[![][back-to-top]](#readme-top)
## 📌 待办事项 1. 添加 GitHub 专用名词解释 1. 整理 [Git](https://git-scm.com/) & [GitHub](https://github.com/) 学习资料 1. 完善文档翻译,需大家 PR 共同翻译 ## 🤝 参与贡献 欢迎通过以下方式参与贡献: 1. 完善词库翻译(编辑 `locals.js`) 1. 提交议题报告,参与话题讨论 1. 改进代码逻辑 ### 翻译参考资源: 1. [Pro Git 第二版 简体中文](https://git-scm.com/book/zh/v2) 1. [Pro Git: 翻译约定](https://github.com/progit/progit2-zh/blob/master/TRANSLATION_NOTES.asc) 1. [Git 官方软件包的简体中文翻译](https://github.com/git/git/blob/master/po/zh_CN.po) 1. [GitHub 词汇表官方译本](https://docs.github.com/cn/get-started/quickstart/github-glossary) > [查看详细贡献指南](https://github.com/maboloshi/github-chinese/discussions/57) ## 🖼️ 效果预览 ## 🙏 特别鸣谢 ### 核心团队 - [maboloshi](https://github.com/maboloshi) - 项目作者 - [wyc-26](https://github.com/wyc-26),[陈生杂物房](https://github.com/TC999) - 项目协作者 - [52cik](https://github.com/52cik) - 项目原作者 ### 贡献者墙 一如既往,感谢我们出色的贡献者❤️! 沙漠之子 楼教主 陈生杂物房 其智乃反不能及 wyc-26 大叶子 cat-kun 人民的勤务员 菾凴 𠭞 益生君 小莫 前端小武 wang4yu6peng13 pangshitong dayday create new ██████╗  ██╔══██╗ ██████╔╝ ██╔══██╗ ██████╔╝ ╚═════╝    ██╗    ██╗   ██║    ██║   ██║    ██║   ██║    ██║   ╚█████╔╝    ╚═════╝  ███████╗ ██╔════╝  ██║████═╗  ██║    ██ ║ ╚██████╔╝   ╚══════╝ KS-OTO InfinityLoop Imgbot neveler > 贡献者列表,由 [GitHub Action][update-contributors-images] 自动生成
[![][back-to-top]](#readme-top)
## 📈 项目统计 Star History Chart ![Alt](https://repobeats.axiom.co/api/embed/ae4c378f0e6ec317654ec5c4e8b01218c734cd53.svg "Repobeats analytics image")
[![][back-to-top]](#readme-top)
## 🎁 欢迎打赏 [赞赏列表](https://github.com/maboloshi/maboloshi/issues/1) | 微信赞赏 | 支付宝赞赏 | | :--------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------: | | WeChat QRcode
☕喝点咖啡继续干☕ | AliPay QRcode
🌶️来包辣条吧~🍪 | [back-to-top]: https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square [project-url]: https://github.com/maboloshi/github-chinese "GitHub 中文化插件" [issues-url]: https://github.com/maboloshi/github-chinese/issues "议题" [issues-image]: https://img.shields.io/github/issues/maboloshi/github-chinese?style=flat-square&logo=github&label=Issue [stars-url]: https://github.com/maboloshi/github-chinese/stargazers "星标" [stars-image]: https://img.shields.io/github/stars/maboloshi/github-chinese?style=flat-square&logo=github&label=Star [forks-url]: https://github.com/maboloshi/github-chinese/network "复刻" [forks-image]: https://img.shields.io/github/forks/maboloshi/github-chinese?style=flat-square&logo=github&label=Fork [license-url]: https://opensource.org/licenses/GPL-3.0 "许可证" [license-image]: https://img.shields.io/github/license/maboloshi/github-chinese?style=flat-square&logo=github&label=License [greasyFork-url]: https://greasyfork.org/scripts/435208 "GreasyFork 源 - GitHub 中文化插件" [greasyFork-image]: https://img.shields.io/badge/dynamic/json?style=flat-square&label=GreasyFork&query=total_installs&suffix=%20installs&url=https://greasyfork.org/scripts/435208.json [Tampermonkey]: http://tampermonkey.net/ "篡改猴" [Violentmonkey]: https://violentmonkey.github.io/ "暴力猴" [Macaque]: https://macaque.app/ "猕猴" [Stay]: https://apps.apple.com/cn/app/stay-for-safari-%E6%B5%8F%E8%A7%88%E5%99%A8%E4%BC%B4%E4%BE%A3/id1591620171 "Stay" [main.user.js]: https://github.com/maboloshi/github-chinese/raw/gh-pages/main.user.js "GitHub 中文化插件 - GitHub 源" [main(gitcode).user.js]: https://raw.gitcode.com/gh_mirrors/gi/github-chinese/raw/gh-pages/main(gitcode).user.js "GitHub 中文化插件 - GitCode 镜像" [main(greasyfork).user.js]: https://greasyfork.org/scripts/435208-github-%E4%B8%AD%E6%96%87%E5%8C%96%E6%8F%92%E4%BB%B6/code/GitHub%20%E4%B8%AD%E6%96%87%E5%8C%96%E6%8F%92%E4%BB%B6.user.js "GitHub 中文化插件 - GreasyFork 源" [update-contributors-images]: https://github.com/maboloshi/github-chinese/blob/gh-pages/.github/workflows/update_contributors_images.yml
  1. Chrome 切换到 Manifest V3后,使用问题