# build-git-locale.sh **Repository Path**: summonhim/build-git-locale.sh ## Basic Information - **Project Name**: build-git-locale.sh - **Description**: Git for Windows 汉化脚本(编译语言文件) - **Primary Language**: Shell - **License**: MPL-2.0 - **Default Branch**: master - **Homepage**: https://gist.github.com/SummonHIM/13027aae9a97b0e4b798bab91d05763d - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-03-16 - **Last Updated**: 2024-05-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: Git, shell, mingw64 ## README # build-git-locale.sh Git for Windows 汉化脚本(编译语言文件) **本镜像仓库不处理任何 Issue 和 PR。如有问题请前往[原网站](https://gist.github.com/SummonHIM/13027aae9a97b0e4b798bab91d05763d)提交。** ## 使用教程 1. 第一步:打开 Git Bash。右键标题栏。点击`Options`进入设置页。 ![Bash-Options-Text.png](README/Bash.png) 2. 打开`Text`标签页。更改`Locale`为`zh_CN`,字符集更改为`GBK`。 ![Bash-Options-Text.png](README/Bash-Options-Text.png) 3. 打开`Window`标签页。更改`UI language`为`@ Windows language @`(当前 Windows 语言)或`zh_CN`。 ![Bash-Options-Text.png](README/Bash-Options-Window.png) 4. 返回 Git Bash 控制台,复制以下代码至控制台并执行。 ```Shell sh -c "$(curl -fsSL https://gitee.com/summonhim/build-git-locale.sh/raw/master/build-git-locale.sh)" ``` ![Bash-Options-Text.png](README/Bash-build-git-locale.png) ### 对于 v2.44.0.windows.1 及以后版本 由于 Git for Windows 在该版本中删除了 gettext 工具包。所以使用该版本时需手动下载并安装该工具包。 - 在 https://packages.msys2.org/package/gettext 中下载 `gettext-x.xx.x-x-x86_64.pkg.tar.zst` 文件 - 解压 `gettextx.xx.x-x-x86_64.pkg.tar.zst` 中的 `/usr` 文件夹至 `X:\你的\Git\安装\文件夹\usr` 5. 当脚本提示完成时即为汉化成功。你可以安全删除提示中的文件夹(可选)。 ![Bash-Options-Text.png](README/Bash-build-git-locale-Done.png) 6. 若想设置全局 Git 语言为中文,则需要添加一个用户变量。打开`系统属性`中的`环境变量`。在`个人用户变量`中添加名为`LANG`的变量。并将值设为`zh_CN.GB2312`。 ![Bash-Options-Text.png](README/Path.png) ## 结果演示 ![Bash-Options-Text.png](README/WTSample.png) ![Bash-Options-Text.png](README/GuiSample.png)