From 40616d267e3786d1084d74d12b3e755cbe1b117b Mon Sep 17 00:00:00 2001 From: anothersimulacrum Date: Wed, 25 Nov 2020 08:23:32 -0800 Subject: [PATCH] Fix description string extraction Reusing needs_plural for extracting plural descriptions was a bad idea - it means that all the item descriptions were erroneously marked as needing plural forms. Add a new category for types neeeding plural descriptions, and use this instead. --- lang/extract_json_strings.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lang/extract_json_strings.py b/lang/extract_json_strings.py index 60946a53bcb91..a92b1ceae69ff 100755 --- a/lang/extract_json_strings.py +++ b/lang/extract_json_strings.py @@ -191,7 +191,6 @@ def warning_supressed(filename): "BOOK", "COMESTIBLE", "ENGINE", - "event_statistic", "GENERIC", "GUN", "GUNMOD", @@ -204,6 +203,11 @@ def warning_supressed(filename): "WHEEL", } +# These objects use a plural form in their description +needs_plural_desc = { + "event_statistic" +} + # these objects can be automatically converted, but use format strings use_format_strings = { "technique", @@ -1220,8 +1224,9 @@ def extract(item, infilename): c = "Description for {}".format(name) else: c = None - if object_type in needs_plural: - writestr(outfile, item["description"], comment=c, pl_fmt=True, **kwargs) + if object_type in needs_plural_desc: + writestr(outfile, item["description"], comment=c, pl_fmt=True, + **kwargs) else: writestr(outfile, item["description"], comment=c, **kwargs) wrote = True