@@ -20,40 +20,89 @@ VS Code 必须带 `--enable-proposed-api maboloshi.github-chinese` 参数启动
2020<details >
2121<summary >带参数启动 VS Code 的方式</summary >
2222
23- - 打开[ 运行对话框] ( https://learn.microsoft.com/windows/advanced-settings/modern-run ) ,录入:
23+ - 打开[ 运行对话框] ( https://learn.microsoft.com/windows/advanced-settings/modern-run ) ,输入:
24+
2425 ``` cmd
2526 "%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe" --enable-proposed-api maboloshi.github-chinese
2627 ```
28+
2729- 或修改[ “开始”菜单] ( https://www.microsoft.com/zh-cn/windows/tips/start-menu ) 的 VS Code 快捷方式,在 ` 目标 ` 字段末尾追加 [ COMMAND_LINE_ARGUMENTS] ( https://learn.microsoft.com/openspecs/windows_protocols/ms-shllink/17b69472-0f34-4bcf-b290-eccdb8de224b ) :
30+
2831 ``` cmd
2932 --enable-proposed-api maboloshi.github-chinese
3033 ```
34+
3135 然后从“开始”菜单启动
3236
3337</details >
3438
39+ ## 安装方式
40+
41+ ### 方案一:从 GitHub Actions 下载(推荐)
42+
43+ > 该方案需要登录 GitHub 账号,若你没有账号,请使用 [ 方案二] ( #方案二从源码构建 )
44+
45+ 1 . 打开本仓库的 [ Actions] ( https://github.com/maboloshi/github-chinese/actions/workflows/build-vscode-extension.yml ) 页面
46+
47+ 2 . 选择最近一次成功运行的 workflow
48+
49+ 3 . 滚动到页面底部,在 ** Artifacts** 区域下载 ` github-chinese-extension.vsix `
50+
51+ 4 . 在 VS Code 中按 ` Ctrl+Shift+P ` 打开命令面板
52+
53+ 5 . 输入 ` Extensions: Install from VSIX... ` 并选择刚才下载的 ` .vsix ` 文件
54+
55+ 6 . 安装完成后,在 VS Code 集成浏览器中刷新 GitHub 页面即可生效
56+
57+ ### 方案二:从源码构建
58+
59+ #### 环境要求
60+
61+ - [ Git] ( https://git-scm.cn/install ) (可选,用于克隆仓库,若不打算安装 Git ,请自行将仓库下载至本地)
62+
63+ - [ NodeJS] ( https://nodejs.org )
64+
65+ #### 构建步骤
66+
67+ 在 PowerShell 中执行以下代码:
68+
69+ ``` shell
70+ git clone https://github.com/maboloshi/github-chinese.git # 克隆仓库
71+
72+ # 若你的网络环境无法访问 GitHub 克隆仓库,请自行寻找加速器等解决
73+
74+ cd github-chinese/vscode-extension # 进入插件目录
75+
76+ npm install # 安装依赖
77+
78+ # 若你的网络环境缓慢,请使用这行命令:
79+
80+ # npm install --registry=https://registry.npmmirror.com
81+
82+ npx @vscode/vsce package # 打包插件
83+ ```
84+
85+ 构建完成后,按方案一的第 4-5 步安装生成的 ` .vsix ` 文件。
86+
3587> [ !NOTE]
36- > 本扩展尚未上架 [ VS Code 市场] ( https://code.visualstudio.com/docs/configure/extensions/extension-marketplace#_find-and-install-an-extension ) ,需通过[ 源码构建] ( #从本仓库源码构建 ) 或下载 VSIX 安装。
88+ > 本扩展尚未上架 [ VS Code 市场] ( https://code.visualstudio.com/docs/configure/extensions/extension-marketplace#_find-and-install-an-extension ) ,需通过 [ 源码构建] ( #方案二从源码构建 ) 或从 [ Actions ] ( https://github.com/maboloshi/github-chinese/actions/workflows/build-vscode-extension ) 下载 VSIX 安装。
3789
3890## 命令
3991
4092- ` GitHub 中文化: 检查注入状态 ` — 查看 browser API 可用性、注入标签数与词库加载状态
4193- ` GitHub 中文化: 刷新集成浏览器注入 ` — 重新拉取词库/主脚本并重新注入所有已打开的集成浏览器标签
4294
43- ## 从本仓库源码构建
95+ ## 常见问题
96+
97+ ### 为什么打开 GitHub 页面没有汉化?
4498
45- 1 . [ 克隆仓库] ( https://docs.github.com/zh/repositories/creating-and-managing-repositories/cloning-a-repository )
46- 1 . [ 在 VS Code 中打开该文件夹] ( https://code.visualstudio.com/docs/editor/workspaces#_folder-projects )
47- 1 . [ 打开终端] ( https://code.visualstudio.com/docs/terminal/getting-started#_run-your-first-command-in-the-terminal ) ,执行:
48- ``` powershell
49- cd vscode-extension
50- npm install
51- npx @vscode/vsce package
52- ```
53- 1 . [ 从 VSIX 安装] ( https://code.visualstudio.com/docs/configure/extensions/extension-marketplace#_install-from-a-vsix )
99+ 请检查以下几点:
54100
55- > [ !TIP]
56- > 推荐从[ 发行版] ( https://github.com/maboloshi/github-chinese/releases ) 直接下载 ` .vsix ` (如有)。
101+ 1 . ** 确认已安装依赖扩展** :Integrated Browser Extensions 必须已安装并启用
102+ 2 . ** 确认启动参数正确** :VS Code 必须带 ` --enable-proposed-api boylett.integrated-browser-extensions ` 参数启动
103+ 3 . ** 确认扩展已启用** :在扩展面板中确认 ` GitHub 中文化 ` 扩展已启用
104+ 4 . ** 刷新页面** :在 VS Code 的集成浏览器中按 ` Ctrl+R ` 或 ` F5 ` 刷新页面
105+ 5 . ** 重启 VS Code** :尝试完全退出并重新启动 VS Code
57106
58107## 调试
59108
0 commit comments