allow translation of "For more information, try '--help'."

This commit is contained in:
Sylvestre Ledru 2025-08-10 13:37:09 +02:00
parent f534bb9ac4
commit 1023ce1dbf
3 changed files with 5 additions and 3 deletions

View file

@ -13,6 +13,7 @@ clap-error-unexpected-argument = { $error_word }: unexpected argument '{ $arg }'
clap-error-similar-argument = { $tip_word }: a similar argument exists: '{ $suggestion }'
clap-error-pass-as-value = { $tip_word }: to pass '{ $arg }' as a value, use '{ $tip_command }'
clap-error-help-suggestion = For more information, try '{ $command } --help'.
common-help-suggestion = For more information, try '--help'.
# Common help text patterns
help-flag-help = Print help information

View file

@ -13,6 +13,7 @@ clap-error-unexpected-argument = { $error_word } : argument inattendu '{ $arg }'
clap-error-similar-argument = { $tip_word } : un argument similaire existe : '{ $suggestion }'
clap-error-pass-as-value = { $tip_word } : pour passer '{ $arg }' comme valeur, utilisez '{ $tip_command }'
clap-error-help-suggestion = Pour plus d'informations, essayez '{ $command } --help'.
common-help-suggestion = Pour plus d'informations, essayez '--help'.
# Modèles de texte d'aide communs
help-flag-help = Afficher les informations d'aide

View file

@ -178,7 +178,7 @@ pub fn handle_clap_error_with_exit_code(err: Error, util_name: &str, exit_code:
let usage_label = translate!("common-usage");
eprintln!("{}: {}", usage_label, formatted_usage);
eprintln!();
eprintln!("For more information, try '--help'.");
eprintln!("{}", translate!("common-help-suggestion"));
std::process::exit(exit_code);
} else {
@ -198,7 +198,7 @@ pub fn handle_clap_error_with_exit_code(err: Error, util_name: &str, exit_code:
eprintln!("{}", main_error_line);
eprintln!();
// Use the execution phrase for the help suggestion to match test expectations
eprintln!("For more information, try '--help'.");
eprintln!("{}", translate!("common-help-suggestion"));
} else {
// Fallback to original rendering if we can't parse
eprint!("{}", err.render());
@ -232,7 +232,7 @@ pub fn handle_clap_error_with_exit_code(err: Error, util_name: &str, exit_code:
// For other errors, just show help suggestion
eprintln!();
eprintln!("For more information, try '--help'.");
eprintln!("{}", translate!("common-help-suggestion"));
std::process::exit(exit_code);
}