fix: write region names in pack READMEs as labels

packreadme title-cased each slug, printing asia-ntsc as Asia Ntsc.
region.label() holds the words the site already used, and both read it.
This commit is contained in:
Abdessamad Derraz committed 2026-11-06 03:50:49 +01:00
1 parent 00aac8dc72
commit 2f81aa9c0f
4 files changed
+38 -11

No files matched your search

+5 -8
View File
@@ -7750,20 +7750,17 @@ def _distinct_spellings(names: list) -> list[str]:
return list(seen.values())
# Region slugs whose words are not the slug title-cased.
_REGION_WORDS = {
"uk": "UK",
"asia-ntsc": "Asia (NTSC)",
"asia-pal": "Asia (PAL)",
"world": "every region",
}
# Region slugs whose words are not the slug title-cased, beyond region.LABELS.
_REGION_WORDS = {"world": "every region"}
def _region_words(value: object, most: int = 0) -> str:
"""A region: value in words. ``most`` caps the regions named, the rest
counted: one Saturn BIOS serves seven."""
raw = value if isinstance(value, list) else [value] if value else []
words = [_REGION_WORDS.get(str(r), str(r).replace("-", " ").title()) for r in raw]
from region import label # noqa: PLC0415
words = [_REGION_WORDS.get(str(r)) or label(str(r)) for r in raw]
if most and len(words) > most:
words = words[:most] + [f"{len(words) - most} more"]
return _said_as_list(words)