Skip to content

Commit 1d76a00

Browse files
authored
Merge pull request #8116 from sylvestre/l10n-touch
l10n: port touch for translation + add french
2 parents fd7661c + c806670 commit 1d76a00

4 files changed

Lines changed: 173 additions & 51 deletions

File tree

src/uu/touch/locales/en-US.ftl

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,29 @@
11
touch-about = Update the access and modification times of each FILE to the current time.
2-
touch-usage = touch [OPTION]... [USER]
2+
touch-usage = touch [OPTION]... [FILE]...
3+
4+
# Help messages
5+
touch-help-help = Print help information.
6+
touch-help-access = change only the access time
7+
touch-help-timestamp = use [[CC]YY]MMDDhhmm[.ss] instead of the current time
8+
touch-help-date = parse argument and use it instead of current time
9+
touch-help-modification = change only the modification time
10+
touch-help-no-create = do not create any files
11+
touch-help-no-deref = affect each symbolic link instead of any referenced file (only for systems that can change the timestamps of a symlink)
12+
touch-help-reference = use this file's times instead of the current time
13+
touch-help-time = change only the specified time: "access", "atime", or "use" are equivalent to -a; "modify" or "mtime" are equivalent to -m
14+
15+
# Error messages
16+
touch-error-missing-file-operand = missing file operand
17+
Try '{ $help_command } --help' for more information.
18+
touch-error-setting-times-of = setting times of { $filename }
19+
touch-error-setting-times-no-such-file = setting times of { $filename }: No such file or directory
20+
touch-error-cannot-touch = cannot touch { $filename }
21+
touch-error-no-such-file-or-directory = No such file or directory
22+
touch-error-failed-to-get-attributes = failed to get attributes of { $path }
23+
touch-error-setting-times-of-path = setting times of { $path }
24+
touch-error-invalid-date-ts-format = invalid date ts format { $date }
25+
touch-error-invalid-date-format = invalid date format { $date }
26+
touch-error-unable-to-parse-date = Unable to parse date: { $date }
27+
touch-error-windows-stdout-path-failed = GetFinalPathNameByHandleW failed with code { $code }
28+
touch-error-invalid-filetime = Source has invalid access or modification time: { $time }
29+
touch-error-reference-file-inaccessible = failed to get attributes of { $path }: { $error }

src/uu/touch/locales/fr-FR.ftl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
touch-about = Mettre à jour les temps d'accès et de modification de chaque FICHIER avec l'heure actuelle.
3+
touch-usage = touch [OPTION]... [FICHIER]...
4+
5+
# Messages d'aide
6+
touch-help-help = Afficher les informations d'aide.
7+
touch-help-access = changer seulement le temps d'accès
8+
touch-help-timestamp = utiliser [[CC]AA]MMJJhhmm[.ss] au lieu de l'heure actuelle
9+
touch-help-date = analyser l'argument et l'utiliser au lieu de l'heure actuelle
10+
touch-help-modification = changer seulement le temps de modification
11+
touch-help-no-create = ne créer aucun fichier
12+
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)
13+
touch-help-reference = utiliser les temps de ce fichier au lieu de l'heure actuelle
14+
touch-help-time = changer seulement le temps spécifié : "access", "atime", ou "use" sont équivalents à -a ; "modify" ou "mtime" sont équivalents à -m
15+
16+
# Messages d'erreur
17+
touch-error-missing-file-operand = opérande de fichier manquant
18+
Essayez '{ $help_command } --help' pour plus d'informations.
19+
touch-error-setting-times-of = définition des temps de { $filename }
20+
touch-error-setting-times-no-such-file = définition des temps de { $filename } : Aucun fichier ou répertoire de ce type
21+
touch-error-cannot-touch = impossible de toucher { $filename }
22+
touch-error-no-such-file-or-directory = Aucun fichier ou répertoire de ce type
23+
touch-error-failed-to-get-attributes = échec d'obtention des attributs de { $path }
24+
touch-error-setting-times-of-path = définition des temps de { $path }
25+
touch-error-invalid-date-ts-format = format de date ts invalide { $date }
26+
touch-error-invalid-date-format = format de date invalide { $date }
27+
touch-error-unable-to-parse-date = Impossible d'analyser la date : { $date }
28+
touch-error-windows-stdout-path-failed = GetFinalPathNameByHandleW a échoué avec le code { $code }
29+
touch-error-invalid-filetime = La source a un temps d'accès ou de modification invalide : { $time }
30+
touch-error-reference-file-inaccessible = échec d'obtention des attributs de { $path } : { $error }

src/uu/touch/src/error.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,28 @@
55

66
// spell-checker:ignore (misc) uioerror
77
use filetime::FileTime;
8+
use std::collections::HashMap;
89
use std::path::PathBuf;
910
use thiserror::Error;
1011
use uucore::display::Quotable;
1112
use uucore::error::{UError, UIoError};
13+
use uucore::locale::get_message_with_args;
1214

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

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

2224
/// The reference file's attributes could not be found or read
23-
#[error("failed to get attributes of {}: {}", .0.quote(), to_uioerror(.1))]
25+
#[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())])))]
2426
ReferenceFileInaccessible(PathBuf, std::io::Error),
2527

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

3032
/// An error encountered on a specific file

0 commit comments

Comments
 (0)