From 1a80fc59a376cd98e4a00fc0904335059d306b55 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 31 May 2025 18:02:45 +0200 Subject: [PATCH] l10n: init the locale engine for each program (next: put it behing a feature) --- src/bin/coreutils.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bin/coreutils.rs b/src/bin/coreutils.rs index b29e7ea23..0332d29a0 100644 --- a/src/bin/coreutils.rs +++ b/src/bin/coreutils.rs @@ -14,6 +14,7 @@ use std::io::{self, Write}; use std::path::{Path, PathBuf}; use std::process; use uucore::display::Quotable; +use uucore::locale; const VERSION: &str = env!("CARGO_PKG_VERSION"); @@ -111,6 +112,9 @@ fn main() { match utils.get(util) { Some(&(uumain, _)) => { + if let Err(e) = locale::setup_localization(uucore::util_name()) { + println!("Could not init the localization system {}", e); + } process::exit(uumain(vec![util_os].into_iter().chain(args))); } None => { @@ -123,6 +127,7 @@ fn main() { match utils.get(util) { Some(&(uumain, _)) => { + let code = uumain( vec![util_os, OsString::from("--help")] .into_iter()