This repository has been archived by the owner on Aug 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
231 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
list_dir () { | ||
find ../assets/ -maxdepth 1 -type d -exec echo "$1" \; > "$2" | ||
} | ||
|
||
readme_generate () { | ||
file_name=readme_result.md | ||
list_dir '<li>{}</li>' $file_name | ||
sed -i "s+<li>../assets/</li>++" $file_name | ||
sed -i "s+<li>../assets/minecraft</li>++" $file_name | ||
sed -i "s+../assets/++" $file_name | ||
sed -i "/^$/d" $file_name | ||
} | ||
|
||
modslist_generate () { | ||
file_name=modslist_result.md | ||
list_dir '| {} | :x: | |' $file_name | ||
sed -i "1s+| ../assets/ | :x: | |++" $file_name | ||
sed -i "s+| {} | ../assets/minecraft | :x: | |++" $file_name | ||
sed -i "s+../assets/++" $file_name | ||
sed -i "/^$/d" $file_name | ||
} | ||
|
||
modslist_added_generate () { | ||
file_name=modslist_result.md | ||
x_placeholder=" | :x: | |" | ||
x_x_placeholder=" | :x: |" | ||
question_placeholder=" | :question: |" | ||
check_placeholder=" | :heavy_check_mark: |" | ||
# sed -i "s+MODNAME$x_placeholder+MODNAME$check_placeholder [已回饋]() |+" $file_name | ||
|
||
sed -i "s+screencapper$x_placeholder+screencapper$check_placeholder [已回饋](https://github.com/Deftu/Screencapper/pull/6),但翻譯有變動,需再度 PR |+" $file_name | ||
sed -i "s+sodium$x_placeholder+sodium$x_x_placeholder 由於 Crowdin 並未連上主專案進行同步翻譯 |+" $file_name | ||
sed -i "s+sodium-extra$x_placeholder+sodium-extra$check_placeholder 已提交上 Crowdin |+" $file_name | ||
sed -i "s+automodpack$x_placeholder+automodpack$check_placeholder [已回饋](https://github.com/Skidamek/AutoModpack/pull/64) |+" $file_name | ||
sed -i "s+energymeter$x_placeholder+energymeter$question_placeholder [等待合併](https://github.com/AlmostReliable/energymeter-forge/pull/26) |+" $file_name | ||
sed -i "s+fluxnetworks$x_placeholder+fluxnetworks$check_placeholder [已回饋](https://github.com/SonarSonic/Flux-Networks/pull/482),需要更新。 |+" $file_name | ||
sed -i "s+trashcans$x_placeholder+trashcans$question_placeholder [等待合併](https://github.com/SuperMartijn642/TrashCans/pull/20) |+" $file_name | ||
} | ||
|
||
readme_generate | ||
modslist_generate | ||
modslist_added_generate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
#!/bin/bash | ||
|
||
# shellcheck disable=2271,2260,2086 | ||
|
||
echo ">>> 模組翻譯覆蓋腳本 <<<" | ||
echo ">>> 某些模組的翻譯如果搭配其他翻譯包" | ||
echo ">>> 所使用會將翻譯好的內容變成未翻譯" | ||
echo ">>> 此步驟將會把一些已知的模組翻譯覆蓋掉" | ||
|
||
home () { | ||
cd "$GITHUB_WORKSPACE" || exit | ||
} | ||
|
||
mk_workdir () { | ||
mkdir workdir | ||
cd workdir || exit | ||
} | ||
|
||
rm_workdir () { | ||
rm -r workdir | ||
} | ||
|
||
mega_override () { | ||
mk_workdir | ||
pwd | ||
|
||
echo "小資訊:" | ||
echo "megatools 並不知道原始連結是甚麼" | ||
echo "這邊有一個修正連結的問題 https://github.com/megous/megatools/issues/157#issuecomment-615835778" | ||
|
||
echo "安裝 megatools..." | ||
sudo apt-get update | ||
sudo apt-get install -y megatools | ||
|
||
echo "覆蓋 $1..." | ||
|
||
echo "設置 $2 路徑變數" | ||
PATH_MEGA=$3 | ||
|
||
echo "下載 $1..." | ||
megadl "$4" | ||
|
||
echo "解壓縮 $5" | ||
unzip "$5" | ||
|
||
echo "回到工作目錄..." | ||
cd .. | ||
|
||
echo "移動 $1 的翻譯內容..." | ||
mv workdir/$PATH_MEGA assets | ||
|
||
echo "檢查 $1 覆蓋內容是否存在" | ||
if [ -f "$PATH_MEGA/lang/zh_tw.json" ]; then | ||
echo "翻譯存在!" | ||
else | ||
echo "錯誤!覆蓋 $1 翻譯失敗。" | ||
exit 1 | ||
fi | ||
|
||
echo "完成 $1 覆蓋!清理工作資料夾" | ||
rm_workdir | ||
} | ||
|
||
|
||
mediafire_override () { | ||
mk_workdir | ||
|
||
echo "覆蓋 $1..." | ||
|
||
echo "設置 $1 路徑變數" | ||
PATH_MEDIAFIRE=$2 | ||
|
||
echo "下載 $1" | ||
wget "$(wget -qO - "$3" > /dev/stdout | grep 'id="downloadButton"' | grep -Po '(?<=href=")[^"]*')" | ||
|
||
echo "取出 $1 翻譯檔" | ||
$JAVA_HOME_17_X64/bin/jar xf $4 $PATH_MEDIAFIRE/zh_tw.json | ||
|
||
echo "回到工作目錄..." | ||
cd .. | ||
|
||
echo "創建 $1 語言資料夾..." | ||
mkdir -p $PATH_MEDIAFIRE | ||
|
||
echo "複製 $1 的翻譯內容..." | ||
cp workdir/$PATH_MEDIAFIRE/zh_tw.json $PATH_MEDIAFIRE/ | ||
|
||
echo "檢查 $1 覆蓋內容是否存在" | ||
if [ -f "$PATH_MEDIAFIRE/zh_tw.json" ]; then | ||
echo "翻譯存在!" | ||
else | ||
echo "錯誤!覆蓋 $1 翻譯失敗。" | ||
exit 1 | ||
fi | ||
|
||
echo "完成 $1 覆蓋!清理工作資料夾" | ||
rm_workdir | ||
} | ||
|
||
|
||
mediafire_tinker_override () { | ||
mk_workdir | ||
|
||
echo "覆蓋 $1..." | ||
|
||
echo "設置 $1 路徑變數" | ||
PATH_MEDIAFIRE_TINKER=$2 | ||
PATH_MEDIAFIRE_TINKER_BOOKS=$3 | ||
|
||
echo "下載 $1" | ||
wget "$(wget -qO - "$4" > /dev/stdout | grep 'id="downloadButton"' | grep -Po '(?<=href=")[^"]*')" | ||
|
||
echo "解壓縮 $1 Jar" | ||
$JAVA_HOME_17_X64/bin/jar xf $5 | ||
|
||
echo "回到工作目錄..." | ||
cd .. | ||
|
||
echo "創建 $1 語言資料夾..." | ||
mkdir -p $PATH_MEDIAFIRE_TINKER | ||
|
||
echo "複製 $1 的翻譯內容..." | ||
cp workdir/$PATH_MEDIAFIRE_TINKER/zh_tw.json $PATH_MEDIAFIRE_TINKER/ | ||
|
||
echo "創建 $1 書本資料夾" | ||
mkdir -p $PATH_MEDIAFIRE_TINKER_BOOKS/tinkers_gadgetry | ||
mkdir -p $PATH_MEDIAFIRE_TINKER_BOOKS/puny_smelting | ||
mkdir -p $PATH_MEDIAFIRE_TINKER_BOOKS/mighty_smelting | ||
mkdir -p $PATH_MEDIAFIRE_TINKER_BOOKS/materials_and_you | ||
mkdir -p $PATH_MEDIAFIRE_TINKER_BOOKS/fantastic_foundry | ||
mkdir -p $PATH_MEDIAFIRE_TINKER_BOOKS/encyclopedia | ||
|
||
echo "複製 $1 的書本內容..." | ||
cp -r workdir/$PATH_MEDIAFIRE_TINKER_BOOKS/tinkers_gadgetry/zh_tw $PATH_MEDIAFIRE_TINKER_BOOKS/tinkers_gadgetry | ||
cp -r workdir/$PATH_MEDIAFIRE_TINKER_BOOKS/puny_smelting/zh_tw $PATH_MEDIAFIRE_TINKER_BOOKS/puny_smelting | ||
cp -r workdir/$PATH_MEDIAFIRE_TINKER_BOOKS/mighty_smelting/zh_tw $PATH_MEDIAFIRE_TINKER_BOOKS/mighty_smelting | ||
cp -r workdir/$PATH_MEDIAFIRE_TINKER_BOOKS/materials_and_you/zh_tw $PATH_MEDIAFIRE_TINKER_BOOKS/materials_and_you | ||
cp -r workdir/$PATH_MEDIAFIRE_TINKER_BOOKS/fantastic_foundry/zh_tw $PATH_MEDIAFIRE_TINKER_BOOKS/fantastic_foundry | ||
cp -r workdir/$PATH_MEDIAFIRE_TINKER_BOOKS/encyclopedia/zh_tw $PATH_MEDIAFIRE_TINKER_BOOKS/encyclopedia | ||
|
||
echo "檢查 $1 覆蓋內容是否存在" | ||
if [ -f "$PATH_MEDIAFIRE_TINKER/zh_tw.json" ]; then | ||
echo "翻譯存在!" | ||
else | ||
echo "錯誤!覆蓋 $1 翻譯失敗。" | ||
exit 1 | ||
fi | ||
|
||
echo "完成 $1 覆蓋!清理工作資料夾" | ||
rm_workdir | ||
} | ||
|
||
|
||
# Main | ||
|
||
## 回到工作目錄 | ||
home | ||
|
||
## Mega | ||
|
||
### BloodMagic | ||
mega_override "BloodMagic" "BLOODMAGIC" "assets/bloodmagic" "https://mega.nz/#!KR0CQC5Z!MkEdb3M5q9FHLIgY7WLE18T8EqKFMVUd1guryQWdTQc" "1.18 BloodMagic-zh_tw-v2.zip" | ||
echo "修正 BloodMagic 的全形空格" | ||
sed -i 's/ //1' assets/bloodmagic/patchouli_books/guide/zh_tw/entries/altar/soul_network.json | ||
|
||
## Mediafire | ||
|
||
### ProjectE | ||
mediafire_override "ProjectE" "assets/projecte/lang" "https://www.mediafire.com/file/uhtspihpscmrqsb/ProjectE-1.19.2-PE1.0.1B-tw.jar" "ProjectE-1.19.2-PE1.0.1B-tw.jar" | ||
|
||
### The Twilight Forest | ||
mediafire_override "The Twilight Forest" "assets/twilightforest/lang" "https://www.mediafire.com/file/kl96rxo50e68j93/twilightforest-1.18.2-4.1.1423-universal-tw.jar" "twilightforest-1.18.2-4.1.1423-universal-tw.jar" | ||
|
||
### Productive Bees | ||
mediafire_override "Productive Bees" "assets/productivebees/lang" "https://www.mediafire.com/file/raz0dqfohs5jk29/productivebees-1.19.2-0.10.2.0-tw.jar" "productivebees-1.19.2-0.10.2.0-tw.jar" | ||
|
||
### Tinker (特殊) | ||
|
||
mediafire_tinker_override "Tinkers' Construct" "assets/tconstruct/lang" "assets/tconstruct/book" "https://www.mediafire.com/file/snogv3qqn57o8rf/TConstruct-1.18.2-3.5.2.40-tw.jar" "TConstruct-1.18.2-3.5.2.40-tw.jar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
# Ignore Minecraft Lang Files | ||
|
||
docs/Minecraft-Lang | ||
|
||
# Ignore My Tools | ||
|
||
tools |