diff --git a/AddOns/EsoZH/EsoZH.txt b/AddOns/EsoZH/EsoZH.txt index 2c71c9b..61ed631 100644 --- a/AddOns/EsoZH/EsoZH.txt +++ b/AddOns/EsoZH/EsoZH.txt @@ -1,7 +1,7 @@ ## Title: EsoZH ## Description: Chinese translation -## Version: 0.4.7 -## APIVersion: 100016 100017 +## Version: 0.4.8 +## APIVersion: 100017 ## SavedVariables: EsoZH_Variables diff --git a/scripts/convert_txt_to_str.py b/scripts/convert_txt_to_str.py index 06704a0..cd916be 100644 --- a/scripts/convert_txt_to_str.py +++ b/scripts/convert_txt_to_str.py @@ -35,6 +35,9 @@ def main(): lang = a elif o == '-m': mode = a.lower() + if mode not in ('origin', 'translation', 'both'): + usage() + sys.exit(2) elif o == '-h': usage() return @@ -65,15 +68,19 @@ def main(): ui_mgr_pregame.apply_translate_from_txt_lines(lines) ui_mgr_client.apply_translate_from_txt_lines(lines) + print('mode: %s' % mode) + # save lua pregame_dest = os.path.join(dest_path, '%s_pregame.str' % lang) pregame_lines = ui_mgr_pregame.get_str_lines(mode) + print('save to %s.' % pregame_dest) with open(pregame_dest, 'wt', encoding='utf-8') as fp: fp.writelines(header) fp.writelines(pregame_lines) client_dest = os.path.join(dest_path, '%s_client.str' % lang) - client_lines = ui_mgr_pregame.get_str_lines(mode) + client_lines = ui_mgr_client.get_str_lines(mode) + print('save to %s.' % client_dest) with open(client_dest, 'wt', encoding='utf-8') as fp: fp.writelines(header) fp.writelines(client_lines)