From bfe8a11c011633bba75c923145da9187a9ca2d21 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 8 Jun 2025 11:13:13 +0200 Subject: [PATCH] l10n: port tty to translation + add french --- src/uu/tty/locales/en-US.ftl | 6 ++++++ src/uu/tty/locales/fr-FR.ftl | 8 ++++++++ src/uu/tty/src/tty.rs | 6 ++---- 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 src/uu/tty/locales/fr-FR.ftl diff --git a/src/uu/tty/locales/en-US.ftl b/src/uu/tty/locales/en-US.ftl index 8d480ec4a..681607ef0 100644 --- a/src/uu/tty/locales/en-US.ftl +++ b/src/uu/tty/locales/en-US.ftl @@ -1,2 +1,8 @@ tty-about = Print the file name of the terminal connected to standard input. tty-usage = tty [OPTION]... + +# Help messages +tty-help-silent = print nothing, only return an exit status + +# Output messages +tty-not-a-tty = not a tty diff --git a/src/uu/tty/locales/fr-FR.ftl b/src/uu/tty/locales/fr-FR.ftl new file mode 100644 index 000000000..2895f2ef4 --- /dev/null +++ b/src/uu/tty/locales/fr-FR.ftl @@ -0,0 +1,8 @@ +tty-about = Afficher le nom de fichier du terminal connecté à l'entrée standard. +tty-usage = tty [OPTION]... + +# Messages d'aide +tty-help-silent = n'afficher rien, retourner seulement un code de sortie + +# Messages de sortie +tty-not-a-tty = n'est pas un tty diff --git a/src/uu/tty/src/tty.rs b/src/uu/tty/src/tty.rs index 7cad08ba8..2bc529e7b 100644 --- a/src/uu/tty/src/tty.rs +++ b/src/uu/tty/src/tty.rs @@ -2,8 +2,6 @@ // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -// * -// * Synced with http://lingrok.org/xref/coreutils/src/tty.c // spell-checker:ignore (ToDO) ttyname filedesc @@ -41,7 +39,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { Ok(name) => writeln!(stdout, "{}", name.display()), Err(_) => { set_exit_code(1); - writeln!(stdout, "not a tty") + writeln!(stdout, "{}", get_message("tty-not-a-tty")) } }; @@ -65,7 +63,7 @@ pub fn uu_app() -> Command { .long(options::SILENT) .visible_alias("quiet") .short('s') - .help("print nothing, only return an exit status") + .help(get_message("tty-help-silent")) .action(ArgAction::SetTrue), ) }