mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-18 05:01:13 +00:00
Cleanup: Remove unused-strings hack for _TINY string variants.
This commit is contained in:
parent
5575c0ba5a
commit
369e8a6fe9
12
.github/unused-strings.py
vendored
12
.github/unused-strings.py
vendored
@ -39,7 +39,6 @@ def read_language_file(filename, strings_found, errors):
|
|||||||
skip = SkipType.NONE
|
skip = SkipType.NONE
|
||||||
length = 0
|
length = 0
|
||||||
common_prefix = ""
|
common_prefix = ""
|
||||||
last_tiny_string = ""
|
|
||||||
|
|
||||||
with open(filename) as fp:
|
with open(filename) as fp:
|
||||||
for line in fp.readlines():
|
for line in fp.readlines():
|
||||||
@ -114,17 +113,6 @@ def read_language_file(filename, strings_found, errors):
|
|||||||
name = line.split(":")[0].strip()
|
name = line.split(":")[0].strip()
|
||||||
strings_defined.append(name)
|
strings_defined.append(name)
|
||||||
|
|
||||||
# If a string ends on _TINY or _SMALL, it can be the {TINY} variant.
|
|
||||||
# Check for this by some fuzzy matching.
|
|
||||||
if name.endswith(("_SMALL", "_TINY")):
|
|
||||||
last_tiny_string = name
|
|
||||||
elif last_tiny_string:
|
|
||||||
matching_name = "_".join(last_tiny_string.split("_")[:-1])
|
|
||||||
if name == matching_name:
|
|
||||||
strings_found.add(last_tiny_string)
|
|
||||||
else:
|
|
||||||
last_tiny_string = ""
|
|
||||||
|
|
||||||
if skip == SkipType.EXTERNAL:
|
if skip == SkipType.EXTERNAL:
|
||||||
strings_found.add(name)
|
strings_found.add(name)
|
||||||
skip = SkipType.LENGTH
|
skip = SkipType.LENGTH
|
||||||
|
Loading…
Reference in New Issue
Block a user