快速开始
作为模板使用
1. 创建新项目
点击 GitHub 页面上的 "Use this template" 按钮创建新仓库,或者直接克隆:
bash
git clone https://github.com/yourusername/mc_lolcat_lang.git my-language-pack
cd my-language-pack2. 初始化项目
使用交互式初始化命令:
bash
pnpm install
pnpm run init或者手动配置:
bash
cp template.config.example.json template.config.json3. 配置语言包
编辑 template.config.json 文件,配置你的语言包信息:
json
{
"template": {
"name": "My Language Pack",
"description": "Custom Minecraft Language Pack",
"author": "Your Name"
},
"languages": {
"my_lang": {
"name": "我的语言",
"displayName": "My Language",
"baseLanguage": "zh_cn",
"enabled": true
}
}
}4. 开始翻译
在 data/translations/common/ 目录下创建语言文件:
bash
# 创建通用翻译文件
echo '{}' > data/translations/common/my_lang.json编辑翻译文件,添加你的翻译内容:
json
{
"gui.done": "完成",
"gui.cancel": "取消",
"menu.game": "游戏"
}5. 查看进度
bash
pnpm run cli progress6. 构建资源包
bash
# 构建最新版本
pnpm run pack:latest
# 构建所有版本
pnpm run pack:all本项目示例
本仓库同时也是一个 LolCat 语言包的实现示例:
bash
# 查看当前配置
cat template.config.json
# 查看翻译进度
pnpm run cli progress
# 构建 LolCat 语言包
pnpm run pack:latest