mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-20 16:47:49 -06:00
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:
1 parent
00aac8dc72
commit
2f81aa9c0f
4 files changed
+38
-11
No files matched your search
@@ -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.
|
||||
|
||||
|
||||
Reference in new issue
Block a user