Make help error message localizable

This commit is contained in:
Daniel Rainer
2025-06-01 15:42:42 +02:00
parent 98b3ba5e8e
commit 51a57870eb

View File

@@ -1,6 +1,8 @@
//! Helper for executables (not builtins) to print a help message
//! Uses the fish in PATH, not necessarily the matching fish binary
use crate::wgettext;
use std::ffi::{OsStr, OsString};
use std::process::Command;
@@ -16,9 +18,8 @@ pub fn print_help(command: &str) {
.spawn()
.and_then(|mut c| c.wait())
{
// TODO: should be translated
Ok(status) if !status.success() => eprintf!("%s\n", HELP_ERR),
Err(e) => eprintf!("%s: %s\n", HELP_ERR, e),
Ok(status) if !status.success() => eprintf!("%s\n", wgettext!(HELP_ERR)),
Err(e) => eprintf!("%s: %s\n", wgettext!(HELP_ERR), e),
_ => (),
}
}