Skip to content

Commit

Permalink
Fix description string extraction
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
anothersimulacrum committed Nov 25, 2020
1 parent 26d2ef6 commit 40616d2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lang/extract_json_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ def warning_supressed(filename):
"BOOK",
"COMESTIBLE",
"ENGINE",
"event_statistic",
"GENERIC",
"GUN",
"GUNMOD",
Expand All @@ -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",
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 40616d2

Please sign in to comment.