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

l10n: port pwd for translation + add french

This commit is contained in:
Sylvestre Ledru 2025-06-08 20:08:18 +02:00
parent 4128efad0f
commit e4698255f2
4 changed files with 27 additions and 9 deletions

View file

@ -1,2 +1,10 @@
pwd-about = Display the full filename of the current working directory.
pwd-usage = pwd [OPTION]... [FILE]...
pwd-usage = pwd [OPTION]...
# Help messages
pwd-help-logical = use PWD from environment, even if it contains symlinks
pwd-help-physical = avoid all symlinks
# Error messages
pwd-error-failed-to-get-current-directory = failed to get current directory
pwd-error-failed-to-print-current-directory = failed to print current directory

View file

@ -0,0 +1,10 @@
pwd-about = Afficher le nom de fichier complet du répertoire de travail actuel.
pwd-usage = pwd [OPTION]...
# Messages d'aide
pwd-help-logical = utiliser PWD de l'environnement, même s'il contient des liens symboliques
pwd-help-physical = éviter tous les liens symboliques
# Messages d'erreur
pwd-error-failed-to-get-current-directory = échec de l'obtention du répertoire actuel
pwd-error-failed-to-print-current-directory = échec de l'affichage du répertoire actuel

View file

@ -119,7 +119,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
} else {
physical_path()
}
.map_err_context(|| "failed to get current directory".to_owned())?;
.map_err_context(|| get_message("pwd-error-failed-to-get-current-directory"))?;
// \\?\ is a prefix Windows gives to paths under certain circumstances,
// including when canonicalizing them.
@ -132,8 +132,8 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
.map(Into::into)
.unwrap_or(cwd);
println_verbatim(cwd).map_err_context(|| "failed to print current directory".to_owned())?;
println_verbatim(cwd)
.map_err_context(|| get_message("pwd-error-failed-to-print-current-directory"))?;
Ok(())
}
@ -147,7 +147,7 @@ pub fn uu_app() -> Command {
Arg::new(OPT_LOGICAL)
.short('L')
.long(OPT_LOGICAL)
.help("use PWD from environment, even if it contains symlinks")
.help(get_message("pwd-help-logical"))
.action(ArgAction::SetTrue),
)
.arg(
@ -155,7 +155,7 @@ pub fn uu_app() -> Command {
.short('P')
.long(OPT_PHYSICAL)
.overrides_with(OPT_LOGICAL)
.help("avoid all symlinks")
.help(get_message("pwd-help-physical"))
.action(ArgAction::SetTrue),
)
}

View file

@ -38,7 +38,7 @@ fn test_deleted_dir() {
let output = Command::new("sh")
.arg("-c")
.arg(format!(
"cd '{}'; mkdir foo; cd foo; rmdir ../foo; exec '{}' {}",
"cd '{}'; mkdir foo; cd foo; rmdir ../foo; LANG=C exec '{}' {}",
at.root_dir_resolved(),
ts.bin_path.to_str().unwrap(),
ts.util_name,
@ -48,8 +48,8 @@ fn test_deleted_dir() {
assert!(!output.status.success());
assert!(output.stdout.is_empty());
assert_eq!(
output.stderr,
b"pwd: failed to get current directory: No such file or directory\n"
String::from_utf8_lossy(&output.stderr),
"pwd: failed to get current directory: No such file or directory\n"
);
}