mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
l10n: add a comment to detail the need of having the capability to disable translations
This commit is contained in:
parent
5ab807a561
commit
16afa021ce
1 changed files with 19 additions and 2 deletions
|
@ -112,8 +112,25 @@ fn main() {
|
||||||
|
|
||||||
match utils.get(util) {
|
match utils.get(util) {
|
||||||
Some(&(uumain, _)) => {
|
Some(&(uumain, _)) => {
|
||||||
if let Err(e) = locale::setup_localization(uucore::util_name()) {
|
// TODO: plug the deactivation of the translation
|
||||||
println!("Could not init the localization system {}", e);
|
// and load the English strings directly at compilation time in the
|
||||||
|
// binary to avoid the load of the flt
|
||||||
|
// Could be something like:
|
||||||
|
// #[cfg(not(feature = "only_english"))]
|
||||||
|
match locale::setup_localization(get_canonical_util_name(util)) {
|
||||||
|
Ok(()) => {}
|
||||||
|
Err(uucore::locale::LocalizationError::ParseResource {
|
||||||
|
error: err_msg,
|
||||||
|
snippet,
|
||||||
|
}) => {
|
||||||
|
// Now you have both `err_msg: ParserError` and `snippet: String`
|
||||||
|
eprintln!("Localization parse error at “{}”: {:?}", snippet, err_msg);
|
||||||
|
process::exit(1);
|
||||||
|
}
|
||||||
|
Err(other) => {
|
||||||
|
eprintln!("Could not init the localization system: {}", other);
|
||||||
|
process::exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
process::exit(uumain(vec![util_os].into_iter().chain(args)));
|
process::exit(uumain(vec![util_os].into_iter().chain(args)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue