mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #8119 from sylvestre/l10n-pwd
l10n: port pwd for translation + add french
This commit is contained in:
commit
75e690b5aa
4 changed files with 27 additions and 9 deletions
|
@ -1,2 +1,10 @@
|
||||||
pwd-about = Display the full filename of the current working directory.
|
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
|
||||||
|
|
10
src/uu/pwd/locales/fr-FR.ftl
Normal file
10
src/uu/pwd/locales/fr-FR.ftl
Normal 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
|
|
@ -119,7 +119,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
} else {
|
} else {
|
||||||
physical_path()
|
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,
|
// \\?\ is a prefix Windows gives to paths under certain circumstances,
|
||||||
// including when canonicalizing them.
|
// including when canonicalizing them.
|
||||||
|
@ -132,8 +132,8 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
.map(Into::into)
|
.map(Into::into)
|
||||||
.unwrap_or(cwd);
|
.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(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ pub fn uu_app() -> Command {
|
||||||
Arg::new(OPT_LOGICAL)
|
Arg::new(OPT_LOGICAL)
|
||||||
.short('L')
|
.short('L')
|
||||||
.long(OPT_LOGICAL)
|
.long(OPT_LOGICAL)
|
||||||
.help("use PWD from environment, even if it contains symlinks")
|
.help(get_message("pwd-help-logical"))
|
||||||
.action(ArgAction::SetTrue),
|
.action(ArgAction::SetTrue),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
@ -155,7 +155,7 @@ pub fn uu_app() -> Command {
|
||||||
.short('P')
|
.short('P')
|
||||||
.long(OPT_PHYSICAL)
|
.long(OPT_PHYSICAL)
|
||||||
.overrides_with(OPT_LOGICAL)
|
.overrides_with(OPT_LOGICAL)
|
||||||
.help("avoid all symlinks")
|
.help(get_message("pwd-help-physical"))
|
||||||
.action(ArgAction::SetTrue),
|
.action(ArgAction::SetTrue),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ fn test_deleted_dir() {
|
||||||
let output = Command::new("sh")
|
let output = Command::new("sh")
|
||||||
.arg("-c")
|
.arg("-c")
|
||||||
.arg(format!(
|
.arg(format!(
|
||||||
"cd '{}'; mkdir foo; cd foo; rmdir ../foo; exec '{}' {}",
|
"cd '{}'; mkdir foo; cd foo; rmdir ../foo; LANG=C exec '{}' {}",
|
||||||
at.root_dir_resolved(),
|
at.root_dir_resolved(),
|
||||||
ts.bin_path.to_str().unwrap(),
|
ts.bin_path.to_str().unwrap(),
|
||||||
ts.util_name,
|
ts.util_name,
|
||||||
|
@ -48,8 +48,8 @@ fn test_deleted_dir() {
|
||||||
assert!(!output.status.success());
|
assert!(!output.status.success());
|
||||||
assert!(output.stdout.is_empty());
|
assert!(output.stdout.is_empty());
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
output.stderr,
|
String::from_utf8_lossy(&output.stderr),
|
||||||
b"pwd: failed to get current directory: No such file or directory\n"
|
"pwd: failed to get current directory: No such file or directory\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue