From 3243e6764f40ec8cf80ed357a892186edc687a43 Mon Sep 17 00:00:00 2001 From: Softer Date: Tue, 30 Jun 2026 11:57:37 +0300 Subject: [PATCH] Use sentence case for summary labels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit str.title() title-cased every label word, which is wrong outside English: it turned the Ukrainian "Ім'я хоста" into "Ім'Я Хоста" and broke acronyms ("NTP" -> "Ntp"). The source strings and their translations are already written with the correct casing. Capitalize only the first letter of each label instead. --- archinstall/lib/utils/format.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/archinstall/lib/utils/format.py b/archinstall/lib/utils/format.py index 2ac8c37749..4d74c5c5de 100644 --- a/archinstall/lib/utils/format.py +++ b/archinstall/lib/utils/format.py @@ -9,6 +9,14 @@ from _typeshed import DataclassInstance +def _sentence_case(text: str) -> str: + # Only capitalize the first letter of the label. The source strings and + # their translations are already written with the correct casing for each + # language, so title-casing every word is wrong outside English (it turned + # "Ім'я хоста" into "Ім'Я Хоста" and "(NTP)" into "(Ntp)"). + return text[:1].upper() + text[1:] + + def as_key_value_pair( entries: dict[str, str | list[str] | bool], ignore_empty: bool = True, @@ -33,7 +41,7 @@ def as_key_value_pair( if isinstance(value, list): value = '\n '.join(str(val) for val in value) - table.add_row(label.title(), f': {value}') + table.add_row(_sentence_case(label), f': {value}') return table.stringify()