mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
l10n: port pinky for translation + add french
This commit is contained in:
parent
7e4877fb30
commit
941ac4c024
5 changed files with 106 additions and 27 deletions
|
@ -4,3 +4,38 @@ pinky-about-musl-warning = Warning: When built with musl libc, the `pinky` utili
|
||||||
or missing user information due to musl's stub implementation of `utmpx`
|
or missing user information due to musl's stub implementation of `utmpx`
|
||||||
functions. This limitation affects the ability to retrieve accurate details
|
functions. This limitation affects the ability to retrieve accurate details
|
||||||
about logged-in users.
|
about logged-in users.
|
||||||
|
|
||||||
|
# Long usage description
|
||||||
|
pinky-long-usage-description = A lightweight 'finger' program; print user information.
|
||||||
|
The utmp file will be
|
||||||
|
|
||||||
|
# Help messages
|
||||||
|
pinky-help-long-format = produce long format output for the specified USERs
|
||||||
|
pinky-help-omit-home-dir = omit the user's home directory and shell in long format
|
||||||
|
pinky-help-omit-project-file = omit the user's project file in long format
|
||||||
|
pinky-help-omit-plan-file = omit the user's plan file in long format
|
||||||
|
pinky-help-short-format = do short format output, this is the default
|
||||||
|
pinky-help-omit-headings = omit the line of column headings in short format
|
||||||
|
pinky-help-omit-name = omit the user's full name in short format
|
||||||
|
pinky-help-omit-name-host = omit the user's full name and remote host in short format
|
||||||
|
pinky-help-omit-name-host-time = omit the user's full name, remote host and idle time in short format
|
||||||
|
pinky-help-help = Print help information
|
||||||
|
|
||||||
|
# Column headers for short format
|
||||||
|
pinky-column-login = Login
|
||||||
|
pinky-column-name = Name
|
||||||
|
pinky-column-tty = TTY
|
||||||
|
pinky-column-idle = Idle
|
||||||
|
pinky-column-when = When
|
||||||
|
pinky-column-where = Where
|
||||||
|
|
||||||
|
# Labels for long format
|
||||||
|
pinky-login-name-label = Login name:
|
||||||
|
pinky-real-life-label = In real life:
|
||||||
|
pinky-directory-label = Directory:
|
||||||
|
pinky-shell-label = Shell:
|
||||||
|
pinky-project-label = Project:
|
||||||
|
pinky-plan-label = Plan
|
||||||
|
|
||||||
|
# Status messages
|
||||||
|
pinky-unsupported-openbsd = unsupported command on OpenBSD
|
||||||
|
|
41
src/uu/pinky/locales/fr-FR.ftl
Normal file
41
src/uu/pinky/locales/fr-FR.ftl
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
pinky-about = Affiche des informations brèves sur les utilisateurs des systèmes Unix
|
||||||
|
pinky-usage = pinky [OPTION]... [UTILISATEUR]...
|
||||||
|
pinky-about-musl-warning = Avertissement : Lorsque compilé avec musl libc, l'utilitaire `pinky` peut afficher des
|
||||||
|
informations utilisateur incomplètes ou manquantes en raison de l'implémentation
|
||||||
|
factice des fonctions `utmpx` de musl. Cette limitation affecte la capacité
|
||||||
|
à récupérer des détails précis sur les utilisateurs connectés.
|
||||||
|
|
||||||
|
# Description d'utilisation longue
|
||||||
|
pinky-long-usage-description = Un programme 'finger' léger ; affiche les informations utilisateur.
|
||||||
|
Le fichier utmp sera
|
||||||
|
|
||||||
|
# Messages d'aide
|
||||||
|
pinky-help-long-format = produire une sortie au format long pour les UTILISATEURS spécifiés
|
||||||
|
pinky-help-omit-home-dir = omettre le répertoire personnel et le shell de l'utilisateur en format long
|
||||||
|
pinky-help-omit-project-file = omettre le fichier projet de l'utilisateur en format long
|
||||||
|
pinky-help-omit-plan-file = omettre le fichier plan de l'utilisateur en format long
|
||||||
|
pinky-help-short-format = faire une sortie au format court, c'est le défaut
|
||||||
|
pinky-help-omit-headings = omettre la ligne des en-têtes de colonnes en format court
|
||||||
|
pinky-help-omit-name = omettre le nom complet de l'utilisateur en format court
|
||||||
|
pinky-help-omit-name-host = omettre le nom complet et l'hôte distant de l'utilisateur en format court
|
||||||
|
pinky-help-omit-name-host-time = omettre le nom complet, l'hôte distant et le temps d'inactivité de l'utilisateur en format court
|
||||||
|
pinky-help-help = Afficher les informations d'aide
|
||||||
|
|
||||||
|
# En-têtes de colonnes pour le format court
|
||||||
|
pinky-column-login = Connexion
|
||||||
|
pinky-column-name = Nom
|
||||||
|
pinky-column-tty = TTY
|
||||||
|
pinky-column-idle = Inactif
|
||||||
|
pinky-column-when = Quand
|
||||||
|
pinky-column-where = Où
|
||||||
|
|
||||||
|
# Étiquettes pour le format long
|
||||||
|
pinky-login-name-label = Nom de connexion :
|
||||||
|
pinky-real-life-label = Dans la vraie vie :
|
||||||
|
pinky-directory-label = Répertoire :
|
||||||
|
pinky-shell-label = Shell :
|
||||||
|
pinky-project-label = Projet :
|
||||||
|
pinky-plan-label = Plan
|
||||||
|
|
||||||
|
# Messages de statut
|
||||||
|
pinky-unsupported-openbsd = commande non supportée sur OpenBSD
|
|
@ -44,55 +44,55 @@ pub fn uu_app() -> Command {
|
||||||
Arg::new(options::LONG_FORMAT)
|
Arg::new(options::LONG_FORMAT)
|
||||||
.short('l')
|
.short('l')
|
||||||
.requires(options::USER)
|
.requires(options::USER)
|
||||||
.help("produce long format output for the specified USERs")
|
.help(get_message("pinky-help-long-format"))
|
||||||
.action(ArgAction::SetTrue),
|
.action(ArgAction::SetTrue),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::OMIT_HOME_DIR)
|
Arg::new(options::OMIT_HOME_DIR)
|
||||||
.short('b')
|
.short('b')
|
||||||
.help("omit the user's home directory and shell in long format")
|
.help(get_message("pinky-help-omit-home-dir"))
|
||||||
.action(ArgAction::SetTrue),
|
.action(ArgAction::SetTrue),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::OMIT_PROJECT_FILE)
|
Arg::new(options::OMIT_PROJECT_FILE)
|
||||||
.short('h')
|
.short('h')
|
||||||
.help("omit the user's project file in long format")
|
.help(get_message("pinky-help-omit-project-file"))
|
||||||
.action(ArgAction::SetTrue),
|
.action(ArgAction::SetTrue),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::OMIT_PLAN_FILE)
|
Arg::new(options::OMIT_PLAN_FILE)
|
||||||
.short('p')
|
.short('p')
|
||||||
.help("omit the user's plan file in long format")
|
.help(get_message("pinky-help-omit-plan-file"))
|
||||||
.action(ArgAction::SetTrue),
|
.action(ArgAction::SetTrue),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::SHORT_FORMAT)
|
Arg::new(options::SHORT_FORMAT)
|
||||||
.short('s')
|
.short('s')
|
||||||
.help("do short format output, this is the default")
|
.help(get_message("pinky-help-short-format"))
|
||||||
.action(ArgAction::SetTrue),
|
.action(ArgAction::SetTrue),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::OMIT_HEADINGS)
|
Arg::new(options::OMIT_HEADINGS)
|
||||||
.short('f')
|
.short('f')
|
||||||
.help("omit the line of column headings in short format")
|
.help(get_message("pinky-help-omit-headings"))
|
||||||
.action(ArgAction::SetTrue),
|
.action(ArgAction::SetTrue),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::OMIT_NAME)
|
Arg::new(options::OMIT_NAME)
|
||||||
.short('w')
|
.short('w')
|
||||||
.help("omit the user's full name in short format")
|
.help(get_message("pinky-help-omit-name"))
|
||||||
.action(ArgAction::SetTrue),
|
.action(ArgAction::SetTrue),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::OMIT_NAME_HOST)
|
Arg::new(options::OMIT_NAME_HOST)
|
||||||
.short('i')
|
.short('i')
|
||||||
.help("omit the user's full name and remote host in short format")
|
.help(get_message("pinky-help-omit-name-host"))
|
||||||
.action(ArgAction::SetTrue),
|
.action(ArgAction::SetTrue),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::OMIT_NAME_HOST_TIME)
|
Arg::new(options::OMIT_NAME_HOST_TIME)
|
||||||
.short('q')
|
.short('q')
|
||||||
.help("omit the user's full name, remote host and idle time in short format")
|
.help(get_message("pinky-help-omit-name-host-time"))
|
||||||
.action(ArgAction::SetTrue),
|
.action(ArgAction::SetTrue),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
@ -105,7 +105,7 @@ pub fn uu_app() -> Command {
|
||||||
// since that conflicts with omit_project_file.
|
// since that conflicts with omit_project_file.
|
||||||
Arg::new(options::HELP)
|
Arg::new(options::HELP)
|
||||||
.long(options::HELP)
|
.long(options::HELP)
|
||||||
.help("Print help information")
|
.help(get_message("pinky-help-help"))
|
||||||
.action(ArgAction::Help),
|
.action(ArgAction::Help),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,16 +2,14 @@
|
||||||
//
|
//
|
||||||
// For the full copyright and license information, please view the LICENSE
|
// For the full copyright and license information, please view the LICENSE
|
||||||
// file that was distributed with this source code.
|
// file that was distributed with this source code.
|
||||||
|
|
||||||
// Specific implementation for OpenBSD: tool unsupported (utmpx not supported)
|
// Specific implementation for OpenBSD: tool unsupported (utmpx not supported)
|
||||||
|
|
||||||
use crate::uu_app;
|
use crate::uu_app;
|
||||||
|
|
||||||
use uucore::error::UResult;
|
use uucore::error::UResult;
|
||||||
|
use uucore::locale::get_message;
|
||||||
|
|
||||||
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
let _matches = uu_app().try_get_matches_from(args)?;
|
let _matches = uu_app().try_get_matches_from(args)?;
|
||||||
|
println!("{}", get_message("pinky-unsupported-openbsd"));
|
||||||
println!("unsupported command on OpenBSD");
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ use crate::uu_app;
|
||||||
use uucore::entries::{Locate, Passwd};
|
use uucore::entries::{Locate, Passwd};
|
||||||
use uucore::error::{FromIo, UResult};
|
use uucore::error::{FromIo, UResult};
|
||||||
use uucore::libc::S_IWGRP;
|
use uucore::libc::S_IWGRP;
|
||||||
|
use uucore::locale::get_message;
|
||||||
use uucore::utmpx::{self, Utmpx, time};
|
use uucore::utmpx::{self, Utmpx, time};
|
||||||
|
|
||||||
use std::io::BufReader;
|
use std::io::BufReader;
|
||||||
|
@ -24,8 +25,8 @@ use std::path::PathBuf;
|
||||||
|
|
||||||
fn get_long_usage() -> String {
|
fn get_long_usage() -> String {
|
||||||
format!(
|
format!(
|
||||||
"A lightweight 'finger' program; print user information.\n\
|
"{}{}",
|
||||||
The utmp file will be {}.",
|
get_message("pinky-long-usage-description"),
|
||||||
utmpx::DEFAULT_FILE
|
utmpx::DEFAULT_FILE
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -217,17 +218,17 @@ impl Pinky {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn print_heading(&self) {
|
fn print_heading(&self) {
|
||||||
print!("{:<8}", "Login");
|
print!("{:<8}", get_message("pinky-column-login"));
|
||||||
if self.include_fullname {
|
if self.include_fullname {
|
||||||
print!(" {:<19}", "Name");
|
print!(" {:<19}", get_message("pinky-column-name"));
|
||||||
}
|
}
|
||||||
print!(" {:<9}", " TTY");
|
print!(" {:<9}", get_message("pinky-column-tty"));
|
||||||
if self.include_idle {
|
if self.include_idle {
|
||||||
print!(" {:<6}", "Idle");
|
print!(" {:<6}", get_message("pinky-column-idle"));
|
||||||
}
|
}
|
||||||
print!(" {:<16}", "When");
|
print!(" {:<16}", get_message("pinky-column-when"));
|
||||||
if self.include_where {
|
if self.include_where {
|
||||||
print!(" Where");
|
print!(" {}", get_message("pinky-column-where"));
|
||||||
}
|
}
|
||||||
println!();
|
println!();
|
||||||
}
|
}
|
||||||
|
@ -248,21 +249,25 @@ impl Pinky {
|
||||||
|
|
||||||
fn long_pinky(&self) {
|
fn long_pinky(&self) {
|
||||||
for u in &self.names {
|
for u in &self.names {
|
||||||
print!("Login name: {u:<28}In real life: ");
|
print!(
|
||||||
|
"{} {u:<28}{} ",
|
||||||
|
get_message("pinky-login-name-label"),
|
||||||
|
get_message("pinky-real-life-label")
|
||||||
|
);
|
||||||
if let Ok(pw) = Passwd::locate(u.as_str()) {
|
if let Ok(pw) = Passwd::locate(u.as_str()) {
|
||||||
let fullname = gecos_to_fullname(&pw).unwrap_or_default();
|
let fullname = gecos_to_fullname(&pw).unwrap_or_default();
|
||||||
let user_dir = pw.user_dir.unwrap_or_default();
|
let user_dir = pw.user_dir.unwrap_or_default();
|
||||||
let user_shell = pw.user_shell.unwrap_or_default();
|
let user_shell = pw.user_shell.unwrap_or_default();
|
||||||
println!(" {fullname}");
|
println!(" {fullname}");
|
||||||
if self.include_home_and_shell {
|
if self.include_home_and_shell {
|
||||||
print!("Directory: {user_dir:<29}");
|
print!("{} {user_dir:<29}", get_message("pinky-directory-label"));
|
||||||
println!("Shell: {user_shell}");
|
println!("{} {user_shell}", get_message("pinky-shell-label"));
|
||||||
}
|
}
|
||||||
if self.include_project {
|
if self.include_project {
|
||||||
let mut p = PathBuf::from(&user_dir);
|
let mut p = PathBuf::from(&user_dir);
|
||||||
p.push(".project");
|
p.push(".project");
|
||||||
if let Ok(f) = File::open(p) {
|
if let Ok(f) = File::open(p) {
|
||||||
print!("Project: ");
|
print!("{} ", get_message("pinky-project-label"));
|
||||||
read_to_console(f);
|
read_to_console(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -270,7 +275,7 @@ impl Pinky {
|
||||||
let mut p = PathBuf::from(&user_dir);
|
let mut p = PathBuf::from(&user_dir);
|
||||||
p.push(".plan");
|
p.push(".plan");
|
||||||
if let Ok(f) = File::open(p) {
|
if let Ok(f) = File::open(p) {
|
||||||
println!("Plan:");
|
println!("{}:", get_message("pinky-plan-label"));
|
||||||
read_to_console(f);
|
read_to_console(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue