mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #8087 from sylvestre/l10n-sleep
l10n: port sleep to translation + add french
This commit is contained in:
commit
212789f171
3 changed files with 32 additions and 9 deletions
|
@ -6,3 +6,10 @@ sleep-after-help = Pause for NUMBER seconds. SUFFIX may be 's' for seconds (the
|
||||||
that require NUMBER be an integer, here NUMBER may be an arbitrary floating
|
that require NUMBER be an integer, here NUMBER may be an arbitrary floating
|
||||||
point number. Given two or more arguments, pause for the amount of time
|
point number. Given two or more arguments, pause for the amount of time
|
||||||
specified by the sum of their values.
|
specified by the sum of their values.
|
||||||
|
|
||||||
|
# Error messages
|
||||||
|
sleep-error-missing-operand = missing operand
|
||||||
|
Try '{ $program } --help' for more information.
|
||||||
|
|
||||||
|
# Help messages
|
||||||
|
sleep-help-number = pause for NUMBER seconds
|
||||||
|
|
15
src/uu/sleep/locales/fr-FR.ftl
Normal file
15
src/uu/sleep/locales/fr-FR.ftl
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
sleep-about = Faire une pause de NOMBRE secondes.
|
||||||
|
sleep-usage = sleep NOMBRE[SUFFIXE]...
|
||||||
|
sleep OPTION
|
||||||
|
sleep-after-help = Faire une pause de NOMBRE secondes. SUFFIXE peut être 's' pour les secondes (par défaut),
|
||||||
|
'm' pour les minutes, 'h' pour les heures ou 'd' pour les jours. Contrairement à la plupart des implémentations
|
||||||
|
qui exigent que NOMBRE soit un entier, ici NOMBRE peut être un nombre à virgule flottante arbitraire.
|
||||||
|
Avec deux arguments ou plus, faire une pause pour la durée spécifiée par la somme de leurs valeurs.
|
||||||
|
|
||||||
|
# Messages d'erreur
|
||||||
|
sleep-error-missing-operand = opérande manquant
|
||||||
|
Essayez '{ $program } --help' pour plus d'informations.
|
||||||
|
|
||||||
|
# Messages d'aide
|
||||||
|
sleep-help-number = faire une pause de NOMBRE secondes
|
||||||
|
|
|
@ -3,9 +3,11 @@
|
||||||
// For the full copyright and license information, please view the LICENSE
|
// For the full copyright and license information, please view the LICENSE
|
||||||
// file that was distributed with this source code.
|
// file that was distributed with this source code.
|
||||||
|
|
||||||
|
use clap::{Arg, ArgAction, Command};
|
||||||
|
use std::collections::HashMap;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
use uucore::locale::{get_message, get_message_with_args};
|
||||||
use uucore::{
|
use uucore::{
|
||||||
error::{UResult, USimpleError, UUsageError},
|
error::{UResult, USimpleError, UUsageError},
|
||||||
format_usage,
|
format_usage,
|
||||||
|
@ -13,10 +15,6 @@ use uucore::{
|
||||||
show_error,
|
show_error,
|
||||||
};
|
};
|
||||||
|
|
||||||
use clap::{Arg, ArgAction, Command};
|
|
||||||
|
|
||||||
use uucore::locale::get_message;
|
|
||||||
|
|
||||||
mod options {
|
mod options {
|
||||||
pub const NUMBER: &str = "NUMBER";
|
pub const NUMBER: &str = "NUMBER";
|
||||||
}
|
}
|
||||||
|
@ -30,9 +28,12 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
USimpleError::new(
|
USimpleError::new(
|
||||||
1,
|
1,
|
||||||
format!(
|
get_message_with_args(
|
||||||
"missing operand\nTry '{} --help' for more information.",
|
"sleep-error-missing-operand",
|
||||||
uucore::execution_phrase()
|
HashMap::from([(
|
||||||
|
"program".to_string(),
|
||||||
|
uucore::execution_phrase().to_string(),
|
||||||
|
)]),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
})?
|
})?
|
||||||
|
@ -51,7 +52,7 @@ pub fn uu_app() -> Command {
|
||||||
.infer_long_args(true)
|
.infer_long_args(true)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new(options::NUMBER)
|
Arg::new(options::NUMBER)
|
||||||
.help("pause for NUMBER seconds")
|
.help(get_message("sleep-help-number"))
|
||||||
.value_name(options::NUMBER)
|
.value_name(options::NUMBER)
|
||||||
.action(ArgAction::Append),
|
.action(ArgAction::Append),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue