diff --git a/src/uu/users/locales/en-US.ftl b/src/uu/users/locales/en-US.ftl index d35a99383..ec54112c8 100644 --- a/src/uu/users/locales/en-US.ftl +++ b/src/uu/users/locales/en-US.ftl @@ -1,4 +1,7 @@ users-about = Print the user names of users currently logged in to the current host. users-usage = users [FILE] -users-about-musl-warning = Warning: When built with musl libc, the `users` utility may show '0 users', +users-about-musl-warning = + Warning: When built with musl libc, the `users` utility may show '0 users', due to musl's stub implementation of utmpx functions. +users-long-usage = Output who is currently logged in according to FILE. + If FILE is not specified, use { $default_path }. /var/log/wtmp as FILE is common. diff --git a/src/uu/users/locales/fr-FR.ftl b/src/uu/users/locales/fr-FR.ftl new file mode 100644 index 000000000..e62b48cc4 --- /dev/null +++ b/src/uu/users/locales/fr-FR.ftl @@ -0,0 +1,7 @@ +users-about = Afficher les noms d'utilisateur des utilisateurs actuellement connectés à l'hôte actuel. +users-usage = users [FICHIER] +users-about-musl-warning = + Avertissement : Lorsqu'il est compilé avec musl libc, l'utilitaire `users` peut afficher '0 utilisateurs', + à cause de l'implémentation stub des fonctions utmpx de musl. +users-long-usage = Afficher qui est actuellement connecté selon FICHIER. + Si FICHIER n'est pas spécifié, utiliser { $default_path }. /var/log/wtmp comme FICHIER est courant. diff --git a/src/uu/users/src/users.rs b/src/uu/users/src/users.rs index 19b6c7c6d..67f7e5848 100644 --- a/src/uu/users/src/users.rs +++ b/src/uu/users/src/users.rs @@ -5,6 +5,7 @@ // spell-checker:ignore (paths) wtmp +use std::collections::HashMap; use std::ffi::OsString; use std::path::Path; @@ -18,7 +19,7 @@ use utmp_classic::{UtmpEntry, parse_from_path}; #[cfg(not(target_os = "openbsd"))] use uucore::utmpx::{self, Utmpx}; -use uucore::locale::get_message; +use uucore::locale::{get_message, get_message_with_args}; #[cfg(target_os = "openbsd")] const OPENBSD_UTMP_FILE: &str = "/var/run/utmp"; @@ -30,9 +31,10 @@ fn get_long_usage() -> String { let default_path: &str = utmpx::DEFAULT_FILE; #[cfg(target_os = "openbsd")] let default_path: &str = OPENBSD_UTMP_FILE; - format!( - "Output who is currently logged in according to FILE. -If FILE is not specified, use {default_path}. /var/log/wtmp as FILE is common." + + get_message_with_args( + "users-long-usage", + HashMap::from([("default_path".to_string(), default_path.to_string())]), ) }