1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #8106 from sylvestre/l10n-users

l10n: port users to translation + add french
This commit is contained in:
Daniel Hofstetter 2025-06-09 10:30:22 +02:00 committed by GitHub
commit 522717be79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 5 deletions

View file

@ -1,4 +1,7 @@
users-about = Print the user names of users currently logged in to the current host. users-about = Print the user names of users currently logged in to the current host.
users-usage = users [FILE] 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. 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.

View file

@ -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.

View file

@ -5,6 +5,7 @@
// spell-checker:ignore (paths) wtmp // spell-checker:ignore (paths) wtmp
use std::collections::HashMap;
use std::ffi::OsString; use std::ffi::OsString;
use std::path::Path; use std::path::Path;
@ -18,7 +19,7 @@ use utmp_classic::{UtmpEntry, parse_from_path};
#[cfg(not(target_os = "openbsd"))] #[cfg(not(target_os = "openbsd"))]
use uucore::utmpx::{self, Utmpx}; use uucore::utmpx::{self, Utmpx};
use uucore::locale::get_message; use uucore::locale::{get_message, get_message_with_args};
#[cfg(target_os = "openbsd")] #[cfg(target_os = "openbsd")]
const OPENBSD_UTMP_FILE: &str = "/var/run/utmp"; const OPENBSD_UTMP_FILE: &str = "/var/run/utmp";
@ -30,9 +31,10 @@ fn get_long_usage() -> String {
let default_path: &str = utmpx::DEFAULT_FILE; let default_path: &str = utmpx::DEFAULT_FILE;
#[cfg(target_os = "openbsd")] #[cfg(target_os = "openbsd")]
let default_path: &str = OPENBSD_UTMP_FILE; let default_path: &str = OPENBSD_UTMP_FILE;
format!(
"Output who is currently logged in according to FILE. get_message_with_args(
If FILE is not specified, use {default_path}. /var/log/wtmp as FILE is common." "users-long-usage",
HashMap::from([("default_path".to_string(), default_path.to_string())]),
) )
} }