Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion src/uu/touch/locales/en-US.ftl
Original file line number Diff line number Diff line change
@@ -1,2 +1,29 @@
touch-about = Update the access and modification times of each FILE to the current time.
touch-usage = touch [OPTION]... [USER]
touch-usage = touch [OPTION]... [FILE]...

# Help messages
touch-help-help = Print help information.
touch-help-access = change only the access time
touch-help-timestamp = use [[CC]YY]MMDDhhmm[.ss] instead of the current time
touch-help-date = parse argument and use it instead of current time
touch-help-modification = change only the modification time
touch-help-no-create = do not create any files
touch-help-no-deref = affect each symbolic link instead of any referenced file (only for systems that can change the timestamps of a symlink)
touch-help-reference = use this file's times instead of the current time
touch-help-time = change only the specified time: "access", "atime", or "use" are equivalent to -a; "modify" or "mtime" are equivalent to -m

# Error messages
touch-error-missing-file-operand = missing file operand
Try '{ $help_command } --help' for more information.
touch-error-setting-times-of = setting times of { $filename }
touch-error-setting-times-no-such-file = setting times of { $filename }: No such file or directory
touch-error-cannot-touch = cannot touch { $filename }
touch-error-no-such-file-or-directory = No such file or directory
touch-error-failed-to-get-attributes = failed to get attributes of { $path }
touch-error-setting-times-of-path = setting times of { $path }
touch-error-invalid-date-ts-format = invalid date ts format { $date }
touch-error-invalid-date-format = invalid date format { $date }
touch-error-unable-to-parse-date = Unable to parse date: { $date }
touch-error-windows-stdout-path-failed = GetFinalPathNameByHandleW failed with code { $code }
touch-error-invalid-filetime = Source has invalid access or modification time: { $time }
touch-error-reference-file-inaccessible = failed to get attributes of { $path }: { $error }
30 changes: 30 additions & 0 deletions src/uu/touch/locales/fr-FR.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

touch-about = Mettre à jour les temps d'accès et de modification de chaque FICHIER avec l'heure actuelle.
touch-usage = touch [OPTION]... [FICHIER]...

# Messages d'aide
touch-help-help = Afficher les informations d'aide.
touch-help-access = changer seulement le temps d'accès
touch-help-timestamp = utiliser [[CC]AA]MMJJhhmm[.ss] au lieu de l'heure actuelle
touch-help-date = analyser l'argument et l'utiliser au lieu de l'heure actuelle
touch-help-modification = changer seulement le temps de modification
touch-help-no-create = ne créer aucun fichier
touch-help-no-deref = affecter chaque lien symbolique au lieu de tout fichier référencé (seulement pour les systèmes qui peuvent changer les horodatages d'un lien symbolique)
touch-help-reference = utiliser les temps de ce fichier au lieu de l'heure actuelle
touch-help-time = changer seulement le temps spécifié : "access", "atime", ou "use" sont équivalents à -a ; "modify" ou "mtime" sont équivalents à -m

# Messages d'erreur
touch-error-missing-file-operand = opérande de fichier manquant
Essayez '{ $help_command } --help' pour plus d'informations.
touch-error-setting-times-of = définition des temps de { $filename }
touch-error-setting-times-no-such-file = définition des temps de { $filename } : Aucun fichier ou répertoire de ce type
touch-error-cannot-touch = impossible de toucher { $filename }
touch-error-no-such-file-or-directory = Aucun fichier ou répertoire de ce type
touch-error-failed-to-get-attributes = échec d'obtention des attributs de { $path }
touch-error-setting-times-of-path = définition des temps de { $path }
touch-error-invalid-date-ts-format = format de date ts invalide { $date }
touch-error-invalid-date-format = format de date invalide { $date }
touch-error-unable-to-parse-date = Impossible d'analyser la date : { $date }
touch-error-windows-stdout-path-failed = GetFinalPathNameByHandleW a échoué avec le code { $code }
touch-error-invalid-filetime = La source a un temps d'accès ou de modification invalide : { $time }
touch-error-reference-file-inaccessible = échec d'obtention des attributs de { $path } : { $error }
10 changes: 6 additions & 4 deletions src/uu/touch/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,28 @@

// spell-checker:ignore (misc) uioerror
use filetime::FileTime;
use std::collections::HashMap;
use std::path::PathBuf;
use thiserror::Error;
use uucore::display::Quotable;
use uucore::error::{UError, UIoError};
use uucore::locale::get_message_with_args;

#[derive(Debug, Error)]
pub enum TouchError {
#[error("Unable to parse date: {0}")]
#[error("{}", get_message_with_args("touch-error-unable-to-parse-date", HashMap::from([("date".to_string(), .0.clone())])))]
InvalidDateFormat(String),

/// The source time couldn't be converted to a [chrono::DateTime]
#[error("Source has invalid access or modification time: {0}")]
#[error("{}", get_message_with_args("touch-error-invalid-filetime", HashMap::from([("time".to_string(), .0.to_string())])))]
InvalidFiletime(FileTime),

/// The reference file's attributes could not be found or read
#[error("failed to get attributes of {}: {}", .0.quote(), to_uioerror(.1))]
#[error("{}", get_message_with_args("touch-error-reference-file-inaccessible", HashMap::from([("path".to_string(), .0.quote().to_string()), ("error".to_string(), to_uioerror(.1).to_string())])))]
ReferenceFileInaccessible(PathBuf, std::io::Error),

/// An error getting a path to stdout on Windows
#[error("GetFinalPathNameByHandleW failed with code {0}")]
#[error("{}", get_message_with_args("touch-error-windows-stdout-path-failed", HashMap::from([("code".to_string(), .0.clone())])))]
WindowsStdoutPathError(String),

/// An error encountered on a specific file
Expand Down
Loading
Loading