mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
l10n: init the locale engine for each program (next: put it behing a feature)
This commit is contained in:
parent
94c1fad206
commit
1a80fc59a3
1 changed files with 5 additions and 0 deletions
|
@ -14,6 +14,7 @@ use std::io::{self, Write};
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::process;
|
use std::process;
|
||||||
use uucore::display::Quotable;
|
use uucore::display::Quotable;
|
||||||
|
use uucore::locale;
|
||||||
|
|
||||||
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||||
|
|
||||||
|
@ -111,6 +112,9 @@ fn main() {
|
||||||
|
|
||||||
match utils.get(util) {
|
match utils.get(util) {
|
||||||
Some(&(uumain, _)) => {
|
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)));
|
process::exit(uumain(vec![util_os].into_iter().chain(args)));
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
|
@ -123,6 +127,7 @@ fn main() {
|
||||||
|
|
||||||
match utils.get(util) {
|
match utils.get(util) {
|
||||||
Some(&(uumain, _)) => {
|
Some(&(uumain, _)) => {
|
||||||
|
|
||||||
let code = uumain(
|
let code = uumain(
|
||||||
vec![util_os, OsString::from("--help")]
|
vec![util_os, OsString::from("--help")]
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue