mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
l10n: port unlink to translation + add french
This commit is contained in:
parent
8db1b6ed75
commit
880e7e2e36
3 changed files with 13 additions and 3 deletions
|
@ -1,3 +1,4 @@
|
|||
unlink-about = Unlink the file at FILE.
|
||||
unlink-usage = unlink FILE
|
||||
unlink OPTION
|
||||
unlink-error-cannot-unlink = cannot unlink { $path }
|
||||
|
|
4
src/uu/unlink/locales/fr-FR.ftl
Normal file
4
src/uu/unlink/locales/fr-FR.ftl
Normal file
|
@ -0,0 +1,4 @@
|
|||
unlink-about = Supprimer le lien vers le fichier FICHIER.
|
||||
unlink-usage = unlink FICHIER
|
||||
unlink OPTION
|
||||
unlink-error-cannot-unlink = impossible de supprimer le lien { $path }
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
// For the full copyright and license information, please view the LICENSE
|
||||
// file that was distributed with this source code.
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::ffi::OsString;
|
||||
use std::fs::remove_file;
|
||||
use std::path::Path;
|
||||
|
@ -14,7 +14,7 @@ use uucore::display::Quotable;
|
|||
use uucore::error::{FromIo, UResult};
|
||||
use uucore::format_usage;
|
||||
|
||||
use uucore::locale::get_message;
|
||||
use uucore::locale::{get_message, get_message_with_args};
|
||||
static OPT_PATH: &str = "FILE";
|
||||
|
||||
#[uucore::main]
|
||||
|
@ -23,7 +23,12 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
|
||||
let path: &Path = matches.get_one::<OsString>(OPT_PATH).unwrap().as_ref();
|
||||
|
||||
remove_file(path).map_err_context(|| format!("cannot unlink {}", path.quote()))
|
||||
remove_file(path).map_err_context(|| {
|
||||
get_message_with_args(
|
||||
"unlink-error-cannot-unlink",
|
||||
HashMap::from([("path".to_string(), path.quote().to_string())]),
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
pub fn uu_app() -> Command {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue