Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix description string extraction #45627

Merged
merged 1 commit into from
Nov 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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