Last active
March 1, 2023 13:36
-
-
Save ebith/b37b71d7a64d86a0af04f0f8c964c49a to your computer and use it in GitHub Desktop.
Solastaの日本語化ファイルをUnfinished Businessの翻訳システムで読み込めるようにするスクリプト
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
import os | |
import re | |
os.makedirs('UnofficialTranslations-ja', exist_ok=True) | |
with open('UnofficialTranslations-ja/Translations-ja.txt', encoding='utf-8', mode='w') as w: | |
number = '' | |
with open('I2Languages-resources.assets-71137.txt', encoding='utf-8', mode='r') as r: | |
for line in r: | |
tmp = re.search(r'(\[\d+\])', line) | |
if tmp: | |
number = tmp.group() | |
elif re.search(r'string Term', line): | |
term = line.split('=')[-1].strip().strip('"') | |
w.write(f'{term}=') | |
elif number == '[3]' and re.search(r'string Language', line): | |
language = line.split('=')[-1].strip().strip('"') | |
w.write(f'{language}\n') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Refs