Skip to content

Commit

Permalink
fix zh_client.str
Browse files Browse the repository at this point in the history
  • Loading branch information
bssthu committed Oct 9, 2016
1 parent c8e364c commit b16f802
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions AddOns/EsoZH/EsoZH.txt
Original file line number Diff line number Diff line change
@@ -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


Expand Down
9 changes: 8 additions & 1 deletion scripts/convert_txt_to_str.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b16f802

Please sign in to comment.