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

+13
View File
@@ -107,6 +107,19 @@ ALIASES: dict[str, str] = {
}
# Slugs a person does not write title-cased: "Asia Ntsc" read as machine text.
LABELS: dict[str, str] = {
"uk": "UK",
"asia-ntsc": "Asia (NTSC)",
"asia-pal": "Asia (PAL)",
}
def label(slug: str) -> str:
"""A region slug in words: north-america as North America."""
return LABELS.get(slug) or " ".join(word.title() for word in slug.split("-"))
def unknown_region_message(raw: str, aliases: dict[str, str], regions: frozenset[str]) -> str:
"""What to type instead: the closest spellings, then every short form.