Greasy Fork

?

GitHub 中文化插件

中文化 GitHub 界面的部分菜單及內(nèi)容。原作者為樓教主(http://www.52cik.com/)。

作者
maboloshi
日安裝量
20
總安裝量
113,292
評分
181 5 0
版本
1.9.2-2025-07-20
創(chuàng)建于
2021-11-08
更新于
2025-07-24
大小
20.3 KB
許可證
GPL-3.0
適用于
# [GitHub 中文化插件][github-project-link] > 讓 GitHub 界面全面中文化 | 源自 [52cik/github-hans](https://github.com/52cik/github-hans) **簡體中文** · [繁體中文](./README_zh-TW.md) · [反饋問題][github-issues-link] [![GitHub stars][github-stars-shield]][github-stars-link] [![GitHub forks][github-forks-shield]][github-forks-link] [![GitHub issues][github-issues-shield]][github-issues-link] [![license GPL-3.0][github-license-shield]][github-license-link] [![GreasyFork installs][greasyFork-shield]][greasyFork-link] Featured|HelloGitHub

[!warning] 本項目從未發(fā)布至 GitCode,如您發(fā)現(xiàn)請截圖并保留證據(jù)

目錄樹 #### TOC - [?? 功能特性](#-功能特性) - [?? 兼容環(huán)境](#-兼容環(huán)境) - [?? 安裝指南](#-安裝指南) - [?? 本地調(diào)試](#-本地調(diào)試) - [?? 更新日志](#-更新日志) - [?? 待辦事項](#-待辦事項) - [?? 參與貢獻](#-參與貢獻) - [??? 效果預(yù)覽](#-效果預(yù)覽) - [?? 特別鳴謝](#-特別鳴謝) - [?? 項目統(tǒng)計](#-項目統(tǒng)計) - [?? 歡迎打賞](#-歡迎打賞)

?? 功能特性

  • [x] 全面中文化 GitHub 界面元素(菜單欄、標(biāo)題、按鈕等)
  • [x] 智能正則匹配功能
  • [x] 支持項目描述的人機翻譯
  • [x] 自動本地化時間元素
  • [x] 持續(xù)更新詞庫

?? 兼容環(huán)境

瀏覽器類型 支持的腳本管理器
Chrome / Chromium 內(nèi)核 Tampermonkey, Violentmonkey
Safari(全平臺) Tampermonkey, Macaque, Stay
Firefox / Gecko 內(nèi)核 Tampermonkey, Violentmonkey
Via(Android) 內(nèi)置管理器

?? 安裝指南

  1. 安裝用戶腳本管理器:
  2. Chrome / Chromium 內(nèi)核瀏覽器,請務(wù)必開啟 “擴展程序” 管理中的 “開發(fā)者模式”[^1]
  3. 選擇安裝源:
  4. 刷新頁面后,插件即可生效
  5. 必要時,重啟瀏覽器

[^1]: Chrome 切換到 Manifest V3后,使用問題

[!NOTE] 版本說明

  • ?? 開發(fā)版:實時更新,每周五自動更新詞庫
  • ??? 穩(wěn)定版:每周一同步開發(fā)版詞庫,更穩(wěn)定

?? 本地調(diào)試

  1. 安裝 Tampermonkey,并啟用 “允許訪問文件網(wǎng)址”。
  2. 下載詞庫文件到本地(如:D:\github-chinese\locals.js
  3. 在腳本管理器中修改引用路徑: ```js // 原始路徑 // @require https://raw.githubusercontent.com/...

// 修改為 // @require file:///D:/github-chinese/locals.js

1. 刷新頁面生效

> [!TIP]
> ?? **溫馨提示:** 您可以將詞庫文件拖拽至瀏覽器地址欄,復(fù)制路徑直接使用。

<div align="right">

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

</div>


## ?? 更新日志

### 最新版本

#### v1.9.3 (2024-08-18)

1. 新增功能:通過設(shè)置中文環(huán)境,自動本地化時間元素,僅保留`on`開頭的時間正則,并停用時間元素監(jiān)視
1. 優(yōu)化突變翻譯處理:
   - 引入`characterDataPage`規(guī)則,對特定頁面啟用`篩選字符數(shù)據(jù)`的變更
   - 引入`ignoreMutationSelectorPage`規(guī)則,忽略特定突變元素
1. 合并`reIgnoreClass,reIgnoreItemprop,ignoreId,ignoreTag`為`ignoreSelectorPage`規(guī)則,處理全局及特定頁面,忽略特定元素
1. 引入全局緩存模式,減少重復(fù)構(gòu)建包括不限于基于`page`變化的忽略規(guī)則、正則規(guī)則數(shù)組等
1. 調(diào)整:更新訊飛聽見翻譯引擎v2.0
1. 優(yōu)化:梳理、優(yōu)化腳本
1. 調(diào)整:調(diào)整詞庫語言代碼為`zh-CN`, 與環(huán)境語言設(shè)置一致

<details><summary><kbd>查看更多歷史版本</kbd></summary>

#### 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. 重新定義版本號規(guī)則, 如`1.9.0-2023-12-09`。
   - `1.9.0`: 主版本號(由項目所有者更新)
   - `2023-12-09`:`詞庫`發(fā)布版本號(由 GitHub Action 自動更新)
1. 加強: [GitHub 源【開發(fā)版】][main.user.js]每周一凌晨自動更新`詞庫`發(fā)布版本號
1. 加強: [GreasyFork 源【穩(wěn)定版】][main(greasyfork).user.js]每周五凌晨自動更新`詞庫`發(fā)布版本號, 詞庫內(nèi)容同上一次[GitHub 源【開發(fā)版】][main.user.js]
1. 加強:在 `README.md` 中自動更新貢獻者頭像
1. 更新: 忽略規(guī)則, 詞條等

#### v1.8.5 (2023-08-31)

1. 優(yōu)化: `transDesc 函數(shù)`代碼
1. 修復(fù): 重復(fù)添加`translate-me`翻譯按鈕
1. 加強:`watchUpdate 函數(shù)`新增節(jié)點文本更新的情況
1. 調(diào)整: `transBySelector和transDesc函數(shù)`延遲執(zhí)行時間
1. 更新: 忽略規(guī)則, 詞條等

#### v1.8.4 (2023-08-08)

1. 修復(fù): `Itemprop`過濾規(guī)則, 依然使用正則方式
1. 修復(fù): `tooltipped`樣式提示, 依然使用正則方式

#### v1.8.3 (2023-08-07)

1. 梳理、優(yōu)化腳本
1. 更新: 忽略規(guī)則, 大量詞條等

#### v1.8.2 (2023-05-15)

1. `greasyfork 托管`源切換到`按頁面精細化詞條模式`
1. 調(diào)整詞庫格式
1. 功能加強: 優(yōu)化`元素篩選器`翻譯邏輯
1. 更新: 忽略規(guī)則, 大量詞條等

#### v1.8.1 (2023-01-22)

1. 修復(fù): #8 與 dark reader 擴展發(fā)生沖突,導(dǎo)致時間顯示出現(xiàn)問題
1. `GitHub`源開始切換到`按頁面精細化詞條模式(開發(fā)版)`, 詞庫未完全遷移適配
1. 停止`greasyfork`源詞庫文件的同步更新

#### v1.8.0 (2023-01-18)

1. 刪除: `TURBO-FRAME`框架處理代碼. Github 已調(diào)整新動態(tài)加載模式, 直接檢測`url`的變化就能獲取對應(yīng)的`page`信息
1. 新增: 支持時間元素的`Shadow DOM`翻譯, 并監(jiān)聽變化
1. 新增: 啟用并更新`時間元素翻譯`專項正則詞條
1. 新增: 僅當(dāng)`page`有效才翻譯頁面
1. 修復(fù): 原`簡介翻譯`引擎`GitHub中文社區(qū)`失效, 改為`訊飛`引擎(測試)
1. 修復(fù): 追加公共正則重復(fù)迭代的問題
1. 修復(fù): 正則標(biāo)記變量`RegExp`與構(gòu)造函數(shù)`new RegExp`沖突
1. 更新: 忽略規(guī)則, 詞條等

預(yù)告, 下次將細化`page`匹配規(guī)則, 導(dǎo)致詞庫文件結(jié)構(gòu)大調(diào)整, 詞庫文件會適當(dāng)變大, 頁面正則更精細效率會提升

#### v1.7.9 (2022-07-17)

GitHub 的 ajax 載入方式逐步從 [defunkt/jquery-pjax](https://github.com/defunkt/jquery-pjax) 切換到 [hotwired/turbo](turbo.hotwired.dev), 導(dǎo)致已有的動態(tài)監(jiān)測方式逐步失效

目前, 通過以下修復(fù):

1. 新增 `BODY` 元素新增監(jiān)視
1. 解析 `TURBO-FRAME` 框架, 獲取對應(yīng)的 `page`
1. 修復(fù) github 新動態(tài)加載模式, 導(dǎo)致`翻譯描述`返回值無法插入
1. 修復(fù) github 新動態(tài)加載模式, 導(dǎo)致`chrome`瀏覽器自帶翻譯功能卡死頁面

其他更新:

1. 修復(fù)`rePagePath`,`rePagePathRepo`,`rePagePathOrg`匹配規(guī)則,限制路徑匹配層次,排除干擾
1. 直接使用網(wǎng)頁URL`document.URL`變化觸發(fā)`標(biāo)題翻譯`和`JS 篩選器`翻譯
1. 修復(fù)`關(guān)閉正則`無法生效, 需要刷新頁面才生效
1. 日常更新詞庫和忽略規(guī)則
1. 更新`JS 篩選器`規(guī)則

#### v1.7.8 (2022-06-29)

1. 緊急修復(fù): GitHub 變更了`document.body`和`title`更新機制, 導(dǎo)致原有的`監(jiān)測更新`規(guī)則部分失效, 目前使用`document.documentElement`監(jiān)視整個頁面 DOM 的變更
1. 跳過`<HEAD>`標(biāo)簽
1. `標(biāo)題翻譯`和`JS 篩選器`翻譯, 依據(jù) URL變化更新

#### v1.7.7 (2022-06-26)

1. 新增`時間元素翻譯`功能
1. 重寫`頁面標(biāo)題翻譯`函數(shù)
1. 梳理`遍歷節(jié)點`函數(shù)邏輯
1. 優(yōu)化`transPage`函數(shù),默認翻譯公共部分
1. 調(diào)整`getPage`函數(shù), 使`ClassName匹配規(guī)則`優(yōu)先
1. 優(yōu)化`translate`函數(shù), 跳過`不存在英文字母和符號,.`, 保留首尾空白部分等
1. 部分函數(shù)重命名,使用`es6`新語法
1. 日常更新詞庫和忽略規(guī)則,修復(fù)一個`JS 選擇器規(guī)則`

#### v1.7.6 (2022-05-12)

1. 日常更新詞庫和忽略規(guī)則
1. 添加手動開啟/禁用正則翻譯,添加切換菜單
1. 優(yōu)化翻譯文本函數(shù):避免已翻譯詞匯二次匹配,提高效率;局部翻譯優(yōu)先于全局

</details>

<div align="right">

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

</div>


## ?? 待辦事項

1. 添加 GitHub 專用名詞解釋
1. 整理 [Git](https://git-scm.com/) & [GitHub](https://github.com/) 學(xué)習(xí)資料
1. 完善文檔翻譯,需大家 PR 共同翻譯

## ?? 參與貢獻

歡迎通過以下方式參與貢獻:

1. 完善詞庫翻譯(編輯 `locals.js`)
1. 提交議題報告,參與話題討論
1. 改進代碼邏輯

[![][pr-welcome-shield]][pr-welcome-link]

### 翻譯參考資源:

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)

## ??? 效果預(yù)覽

  <picture>
    <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/maboloshi/github-chinese/gh-pages/preview/img1.png"/>
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/maboloshi/github-chinese/gh-pages/preview/img3.png"/>
    <img src="https://raw.githubusercontent.com/maboloshi/github-chinese/gh-pages/preview/img1.png" width="75%" />
  </picture>
  <picture>
    <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/maboloshi/github-chinese/gh-pages/preview/img2.png"/>
    <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/maboloshi/github-chinese/gh-pages/preview/img4.png"/>
    <img src="https://raw.githubusercontent.com/maboloshi/github-chinese/gh-pages/preview/img2.png" width="75%" />
  </picture>

## ?? 特別鳴謝

### 核心團隊

- [maboloshi](https://github.com/maboloshi) - 項目作者
- [wyc-26](https://github.com/wyc-26),[陳生雜物房](https://github.com/TC999) - 項目協(xié)作者
- [52cik](https://github.com/52cik) - 項目原作者

### 貢獻者墻

一如既往,感謝我們出色的貢獻者??!

<!--AUTO_GENERATED_PLEASE_DONT_DELETE_IT-->
<a  title="沙漠之子">
  <img src="https://avatars.githubusercontent.com/u/7850715?v=4" width="42;" alt="沙漠之子"/>
</a>
<a  title="樓教主">
  <img src="https://avatars.githubusercontent.com/u/5033310?v=4" width="42;" alt="樓教主"/>
</a>
<a  title="陳生雜物房">
  <img src="https://avatars.githubusercontent.com/u/88823709?v=4" width="42;" alt="陳生雜物房"/>
</a>
<a  title="其智乃反不能及">
  <img src="https://avatars.githubusercontent.com/u/100760086?v=4" width="42;" alt="其智乃反不能及"/>
</a>
<a  title="wyc-26">
  <img src="https://avatars.githubusercontent.com/u/154735436?v=4" width="42;" alt="wyc-26"/>
</a>
<a  title="大葉子">
  <img src="https://avatars.githubusercontent.com/u/56282729?v=4" width="42;" alt="大葉子"/>
</a>
<a  title="Tangyuan">
  <img src="https://avatars.githubusercontent.com/u/195516213?v=4" width="42;" alt="Tangyuan"/>
</a>
<a  title="cat-kun">
  <img src="https://avatars.githubusercontent.com/u/8529528?v=4" width="42;" alt="cat-kun"/>
</a>
<a  title="人民的勤務(wù)員">
  <img src="https://avatars.githubusercontent.com/u/96548841?v=4" width="42;" alt="人民的勤務(wù)員"/>
</a>
<a  title="菾凴">
  <img src="https://avatars.githubusercontent.com/u/71136405?v=4" width="42;" alt="菾凴"/>
</a>
<a  title="Pecasha">
  <img src="https://avatars.githubusercontent.com/u/9607128?v=4" width="42;" alt="Pecasha"/>
</a>
<a  title="??">
  <img src="https://avatars.githubusercontent.com/u/169890386?v=4" width="42;" alt="??"/>
</a>
<a  title="益生君">
  <img src="https://avatars.githubusercontent.com/u/134821571?v=4" width="42;" alt="益生君"/>
</a>
<a  title="小莫">
  <img src="https://avatars.githubusercontent.com/u/28587093?v=4" width="42;" alt="小莫"/>
</a>
<a  title="前端小武">
  <img src="https://avatars.githubusercontent.com/u/3872051?v=4" width="42;" alt="前端小武"/>
</a>
<a  title="wang4yu6peng13">
  <img src="https://avatars.githubusercontent.com/u/10207042?v=4" width="42;" alt="wang4yu6peng13"/>
</a>
<a  title="pangshitong">
  <img src="https://avatars.githubusercontent.com/u/41714457?v=4" width="42;" alt="pangshitong"/>
</a>
<a  title="dayday">
  <img src="https://avatars.githubusercontent.com/u/3986303?v=4" width="42;" alt="dayday"/>
</a>
<a  title="create new ██████╗  ██╔══██╗ ██████╔╝ ██╔══██╗ ██████╔╝ ╚═════╝    ██╗    ██╗   ██║    ██║   ██║    ██║   ██║    ██║   ╚█████╔╝    ╚═════╝  ███████╗ ██╔════╝  ██║████═╗  ██║    ██ ║ ╚██████╔╝   ╚══════╝">
  <img src="https://avatars.githubusercontent.com/u/12287943?v=4" width="42;" alt="create new ██████╗  ██╔══██╗ ██████╔╝ ██╔══██╗ ██████╔╝ ╚═════╝    ██╗    ██╗   ██║    ██║   ██║    ██║   ██║    ██║   ╚█████╔╝    ╚═════╝  ███████╗ ██╔════╝  ██║████═╗  ██║    ██ ║ ╚██████╔╝   ╚══════╝"/>
</a>
<a  title="NyA!K0">
  <img src="https://avatars.githubusercontent.com/u/177237971?v=4" width="42;" alt="NyA!K0"/>
</a>
<a  title="KS-OTO">
  <img src="https://avatars.githubusercontent.com/u/6616413?v=4" width="42;" alt="KS-OTO"/>
</a>
<a  title="InfinityLoop">
  <img src="https://avatars.githubusercontent.com/u/20528423?v=4" width="42;" alt="InfinityLoop"/>
</a>
<a  title="Imgbot">
  <img src="https://avatars.githubusercontent.com/u/31427850?v=4" width="42;" alt="Imgbot"/>
</a>
<a  title="neveler">
  <img src="https://avatars.githubusercontent.com/u/55753029?v=4" width="42;" alt="neveler"/>
</a>
<!--AUTO_GENERATED_PLEASE_DONT_DELETE_IT-END-->

> 貢獻者列表,由 [GitHub Action][update-contributors-images] 自動生成

<div align="right">

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

</div>


## ?? 項目統(tǒng)計

<a >
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=maboloshi/github-chinese&type=Timeline&theme=dark" />
    <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=maboloshi/github-chinese&type=Timeline" />
    <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=maboloshi/github-chinese&type=Timeline" width="75%" />
  </picture>
</a>

![Alt](https://repobeats.axiom.co/api/embed/ae4c378f0e6ec317654ec5c4e8b01218c734cd53.svg "Repobeats analytics image")

<div align="right">

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

</div>

## ?? 歡迎打賞
[贊賞列表](https://github.com/maboloshi/maboloshi/issues/1)
|                                        微信贊賞                                        |                                       支付寶贊賞                                       |
| :--------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------: |
| <img src="https://cdn.jsdelivr.net/gh/maboloshi/maboloshi/img/wechat.png?raw=true" alt="WeChat QRcode" width=200> <br><small>?喝點咖啡繼續(xù)干?</small> | <img src="https://cdn.jsdelivr.net/gh/maboloshi/maboloshi/img/alipay-1.jpg?raw=true" alt="AliPay QRcode" width=200> <br><small>???來包辣條吧~??</small> |


<!-- LINK GROUP -->