diff --git a/src/uu/uname/locales/en-US.ftl b/src/uu/uname/locales/en-US.ftl index 78faa1c35..b98551842 100644 --- a/src/uu/uname/locales/en-US.ftl +++ b/src/uu/uname/locales/en-US.ftl @@ -1,3 +1,20 @@ uname-about = Print certain system information. With no OPTION, same as -s. uname-usage = uname [OPTION]... + +# Error messages +uname-error-cannot-get-system-name = cannot get system name + +# Default values +uname-unknown = unknown + +# Help text for command-line arguments +uname-help-all = Behave as though all of the options -mnrsvo were specified. +uname-help-kernel-name = print the kernel name. +uname-help-nodename = print the nodename (the nodename may be a name that the system is known by to a communications network). +uname-help-kernel-release = print the operating system release. +uname-help-kernel-version = print the operating system version. +uname-help-machine = print the machine hardware name. +uname-help-os = print the operating system name. +uname-help-processor = print the processor type (non-portable) +uname-help-hardware-platform = print the hardware platform (non-portable) diff --git a/src/uu/uname/locales/fr-FR.ftl b/src/uu/uname/locales/fr-FR.ftl new file mode 100644 index 000000000..fc48f3f8b --- /dev/null +++ b/src/uu/uname/locales/fr-FR.ftl @@ -0,0 +1,20 @@ +uname-about = Affiche certaines informations système. + Sans OPTION, identique à -s. +uname-usage = uname [OPTION]... + +# Messages d'erreur +uname-error-cannot-get-system-name = impossible d'obtenir le nom du système + +# Valeurs par défaut +uname-unknown = inconnu + +# Texte d'aide pour les arguments de ligne de commande +uname-help-all = Se comporte comme si toutes les options -mnrsvo étaient spécifiées. +uname-help-kernel-name = affiche le nom du noyau. +uname-help-nodename = affiche le nom du nœud (le nom du nœud peut être un nom par lequel le système est connu d'un réseau de communications). +uname-help-kernel-release = affiche la version du système d'exploitation. +uname-help-kernel-version = affiche la version du système d'exploitation. +uname-help-machine = affiche le nom du matériel de la machine. +uname-help-os = affiche le nom du système d'exploitation. +uname-help-processor = affiche le type de processeur (non portable) +uname-help-hardware-platform = affiche la plateforme matérielle (non portable) diff --git a/src/uu/uname/src/uname.rs b/src/uu/uname/src/uname.rs index cc3a4f471..d89f0d93f 100644 --- a/src/uu/uname/src/uname.rs +++ b/src/uu/uname/src/uname.rs @@ -59,8 +59,9 @@ impl UNameOutput { } pub fn new(opts: &Options) -> UResult { - let uname = - PlatformInfo::new().map_err(|_e| USimpleError::new(1, "cannot get system name"))?; + let uname = PlatformInfo::new().map_err(|_e| { + USimpleError::new(1, get_message("uname-error-cannot-get-system-name")) + })?; let none = !(opts.all || opts.kernel_name || opts.nodename @@ -90,11 +91,11 @@ impl UNameOutput { // This option is unsupported on modern Linux systems // See: https://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00063.html - let processor = opts.processor.then(|| "unknown".to_string()); + let processor = opts.processor.then(|| get_message("uname-unknown")); // This option is unsupported on modern Linux systems // See: https://lists.gnu.org/archive/html/bug-coreutils/2005-09/msg00063.html - let hardware_platform = opts.hardware_platform.then(|| "unknown".to_string()); + let hardware_platform = opts.hardware_platform.then(|| get_message("uname-unknown")); Ok(Self { kernel_name, @@ -151,7 +152,7 @@ pub fn uu_app() -> Command { Arg::new(options::ALL) .short('a') .long(options::ALL) - .help("Behave as though all of the options -mnrsvo were specified.") + .help(get_message("uname-help-all")) .action(ArgAction::SetTrue), ) .arg( @@ -159,17 +160,14 @@ pub fn uu_app() -> Command { .short('s') .long(options::KERNEL_NAME) .alias("sysname") // Obsolescent option in GNU uname - .help("print the kernel name.") + .help(get_message("uname-help-kernel-name")) .action(ArgAction::SetTrue), ) .arg( Arg::new(options::NODENAME) .short('n') .long(options::NODENAME) - .help( - "print the nodename (the nodename may be a name that the system \ - is known by to a communications network).", - ) + .help(get_message("uname-help-nodename")) .action(ArgAction::SetTrue), ) .arg( @@ -177,35 +175,35 @@ pub fn uu_app() -> Command { .short('r') .long(options::KERNEL_RELEASE) .alias("release") // Obsolescent option in GNU uname - .help("print the operating system release.") + .help(get_message("uname-help-kernel-release")) .action(ArgAction::SetTrue), ) .arg( Arg::new(options::KERNEL_VERSION) .short('v') .long(options::KERNEL_VERSION) - .help("print the operating system version.") + .help(get_message("uname-help-kernel-version")) .action(ArgAction::SetTrue), ) .arg( Arg::new(options::MACHINE) .short('m') .long(options::MACHINE) - .help("print the machine hardware name.") + .help(get_message("uname-help-machine")) .action(ArgAction::SetTrue), ) .arg( Arg::new(options::OS) .short('o') .long(options::OS) - .help("print the operating system name.") + .help(get_message("uname-help-os")) .action(ArgAction::SetTrue), ) .arg( Arg::new(options::PROCESSOR) .short('p') .long(options::PROCESSOR) - .help("print the processor type (non-portable)") + .help(get_message("uname-help-processor")) .action(ArgAction::SetTrue) .hide(true), ) @@ -213,7 +211,7 @@ pub fn uu_app() -> Command { Arg::new(options::HARDWARE_PLATFORM) .short('i') .long(options::HARDWARE_PLATFORM) - .help("print the hardware platform (non-portable)") + .help(get_message("uname-help-hardware-platform")) .action(ArgAction::SetTrue) .hide(true), )