Skip to content

Commit

Permalink
feature: FTBQuestsの翻訳でchapter_groupsも翻訳するように
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-RyuZU committed Jul 29, 2024
1 parent 033a887 commit a4030b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
FTBQUESTS_DIR1 = Path('./kubejs/assets/kubejs/lang')
FTBQUESTS_DIR2 = Path('./kubejs/assets/ftbquests/lang')
FTBQUESTS_DIR3 = Path('./config/ftbquests/quests/chapters')
FTBQUESTS_DIR4 = Path('./config/ftbquests/quests/chapter_groups.snbt')

MAX_ATTEMPTS = 5

USER = 'Y-RyuZU'
REPO = 'MinecraftModsLocalizer'
VERSION = 'v2.0.5'
VERSION = 'v2.0.6'
6 changes: 5 additions & 1 deletion src/quests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import re
import shutil

from init import FTBQUESTS_DIR1, FTBQUESTS_DIR2, FTBQUESTS_DIR3, BETTERQUESTING_DIR
from init import FTBQUESTS_DIR1, FTBQUESTS_DIR2, FTBQUESTS_DIR3, FTBQUESTS_DIR4, BETTERQUESTING_DIR
from provider import provide_log_directory
from prepare import extract_map_from_lang, extract_map_from_json, prepare_translation

Expand Down Expand Up @@ -106,6 +106,10 @@ def translate_ftbquests():
logging.info(f"en_us.json not found in {FTBQUESTS_DIR1}, translating snbt files in directory...")
nbt_files = list(FTBQUESTS_DIR3.glob('*.snbt'))

backup_file = backup_directory / FTBQUESTS_DIR4.name
shutil.copy(FTBQUESTS_DIR4, backup_file)
translate_ftbquests_from_snbt(FTBQUESTS_DIR4)

for file in nbt_files:
backup_file = backup_directory / file.name
shutil.copy(file, backup_file)
Expand Down

0 comments on commit a4030b1

Please sign in to comment.