From 6c15b7a98015833a040fb97a985ecebf0b843753 Mon Sep 17 00:00:00 2001 From: Binrui Dong Date: Wed, 27 Oct 2021 23:14:03 +0800 Subject: [PATCH] Extract monster speed descriptions for translation (#52483) --- lang/extract_json_strings.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lang/extract_json_strings.py b/lang/extract_json_strings.py index df2ce4b847f0e..825b976cf7c9a 100755 --- a/lang/extract_json_strings.py +++ b/lang/extract_json_strings.py @@ -1029,9 +1029,15 @@ def extract_snippets(item): def extract_speed_description(item): outfile = get_outfile("speed_description") values = item.get("values", []) + comment = "speed description of monsters" for value in values: - if 'description' in value: - writestr(outfile, value['description']) + if 'descriptions' in value: + descriptions = value.get("descriptions") + if type(descriptions) is str: + writestr(outfile, descriptions, comment=comment) + elif type(descriptions) is list: + for description in descriptions: + writestr(outfile, description, comment=comment) def extract_vehicle_part_category(item):