From 4191c9e7028155761082e8f33a79e217f177948e Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 15 Aug 2026 09:31:33 +0200 Subject: [PATCH] uname: move label separators into locale strings for -A/--all-labeled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The hard-coded ": " separator in display_labeled() prevents translators from adapting punctuation to their locale. For example, French typography requires a non-breaking space before the colon ("Étiquette\u00a0: value") rather than the English style ("Label: value"). Move the full label prefix — including separator and trailing space — into each locale .ftl file, using Fluent quoted literals ({"..."})) to preserve the trailing space that Fluent would otherwise strip. en-US: {"Kernel name: "}, {"Node name: "}, ... fr-FR: {"Nom du noyau\u00a0: "}, {"Nom du n\u0153ud\u00a0: "}, ... --- src/uu/uname/locales/en-US.ftl | 17 +++++++++-------- src/uu/uname/locales/fr-FR.ftl | 16 ++++++++-------- src/uu/uname/src/uname.rs | 6 +++--- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/uu/uname/locales/en-US.ftl b/src/uu/uname/locales/en-US.ftl index 608d49145c..f4293b94a2 100644 --- a/src/uu/uname/locales/en-US.ftl +++ b/src/uu/uname/locales/en-US.ftl @@ -21,11 +21,12 @@ uname-help-hardware-platform = print the hardware platform (non-portable) uname-help-all-labeled = like -a, print all information but one item per line, labeled. # Labels for --all-labeled -uname-label-kernel-name = Kernel name -uname-label-nodename = Node name -uname-label-kernel-release = Kernel release -uname-label-kernel-version = Kernel version -uname-label-machine = Machine -uname-label-processor = Processor -uname-label-hardware-platform = Hardware platform -uname-label-os = Operating system +# Labels for --all-labeled; { $value } is the system-provided field value. +uname-label-kernel-name = Kernel name: { $value } +uname-label-nodename = Node name: { $value } +uname-label-kernel-release = Kernel release: { $value } +uname-label-kernel-version = Kernel version: { $value } +uname-label-machine = Machine: { $value } +uname-label-processor = Processor: { $value } +uname-label-hardware-platform = Hardware platform: { $value } +uname-label-os = Operating system: { $value } diff --git a/src/uu/uname/locales/fr-FR.ftl b/src/uu/uname/locales/fr-FR.ftl index 36b12f450f..5ffeba4513 100644 --- a/src/uu/uname/locales/fr-FR.ftl +++ b/src/uu/uname/locales/fr-FR.ftl @@ -21,11 +21,11 @@ uname-help-hardware-platform = affiche la plateforme matérielle (non portable) uname-help-all-labeled = comme -a, affiche toutes les informations mais une par ligne, avec étiquette. # Étiquettes pour --all-labeled -uname-label-kernel-name = Nom du noyau -uname-label-nodename = Nom du nœud -uname-label-kernel-release = Version du noyau -uname-label-kernel-version = Version détaillée du noyau -uname-label-machine = Machine -uname-label-processor = Processeur -uname-label-hardware-platform = Plateforme matérielle -uname-label-os = Système d'exploitation +uname-label-kernel-name = Nom du noyau : { $value } +uname-label-nodename = Nom du nœud : { $value } +uname-label-kernel-release = Version du noyau : { $value } +uname-label-kernel-version = Version détaillée du noyau : { $value } +uname-label-machine = Machine : { $value } +uname-label-processor = Processeur : { $value } +uname-label-hardware-platform = Plateforme matérielle : { $value } +uname-label-os = Système d'exploitation : { $value } diff --git a/src/uu/uname/src/uname.rs b/src/uu/uname/src/uname.rs index ce04829b77..884979b8cf 100644 --- a/src/uu/uname/src/uname.rs +++ b/src/uu/uname/src/uname.rs @@ -75,9 +75,9 @@ impl UNameOutput { ("uname-label-os", self.os.as_ref()), ] { let Some(value) = value else { continue }; - out.push(translate!(label)); - out.push(": "); - out.push(value); + out.push(OsStr::new( + &translate!(label, "value" => value.to_string_lossy()), + )); out.push("\n"); } out