1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

Merge pull request #8247 from sylvestre/l10n-echo

l10n: port echo for translation + add french
This commit is contained in:
Daniel Hofstetter 2025-06-23 10:20:49 +02:00 committed by GitHub
commit da754ed66d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 34 additions and 7 deletions

View file

@ -16,3 +16,9 @@ echo-after-help = Echo the STRING(s) to standard output.
- \v vertical tab - \v vertical tab
- \0NNN byte with octal value NNN (1 to 3 digits) - \0NNN byte with octal value NNN (1 to 3 digits)
- \xHH byte with hexadecimal value HH (1 to 2 digits) - \xHH byte with hexadecimal value HH (1 to 2 digits)
echo-help-no-newline = do not output the trailing newline
echo-help-enable-escapes = enable interpretation of backslash escapes
echo-help-disable-escapes = disable interpretation of backslash escapes (default)
echo-error-non-utf8 = Non-UTF-8 arguments provided, but this platform does not support them

View file

@ -0,0 +1,24 @@
echo-about = Affiche une ligne de texte
echo-usage = echo [OPTIONS]... [CHAÎNE]...
echo-after-help = Affiche la ou les CHAÎNE(s) sur la sortie standard.
Si -e est activé, les séquences suivantes sont reconnues :
- \ barre oblique inverse
- \a alerte (BEL)
- \b retour arrière
- \c ne produit aucune sortie supplémentaire
- \e échappement
- \f saut de page
- \n nouvelle ligne
- \r retour chariot
- \t tabulation horizontale
- \v tabulation verticale
- \0NNN octet avec valeur octale NNN (1 à 3 chiffres)
- \xHH octet avec valeur hexadécimale HH (1 à 2 chiffres)
echo-help-no-newline = ne pas afficher la nouvelle ligne finale
echo-help-enable-escapes = activer l'interprétation des séquences d'échappement
echo-help-disable-escapes = désactiver l'interprétation des séquences d'échappement (par défaut)
echo-error-non-utf8 = Arguments non-UTF-8 fournis, mais cette plateforme ne les prend pas en charge

View file

@ -145,20 +145,20 @@ pub fn uu_app() -> Command {
.arg( .arg(
Arg::new(options::NO_NEWLINE) Arg::new(options::NO_NEWLINE)
.short('n') .short('n')
.help("do not output the trailing newline") .help(get_message("echo-help-no-newline"))
.action(ArgAction::SetTrue), .action(ArgAction::SetTrue),
) )
.arg( .arg(
Arg::new(options::ENABLE_BACKSLASH_ESCAPE) Arg::new(options::ENABLE_BACKSLASH_ESCAPE)
.short('e') .short('e')
.help("enable interpretation of backslash escapes") .help(get_message("echo-help-enable-escapes"))
.action(ArgAction::SetTrue) .action(ArgAction::SetTrue)
.overrides_with(options::DISABLE_BACKSLASH_ESCAPE), .overrides_with(options::DISABLE_BACKSLASH_ESCAPE),
) )
.arg( .arg(
Arg::new(options::DISABLE_BACKSLASH_ESCAPE) Arg::new(options::DISABLE_BACKSLASH_ESCAPE)
.short('E') .short('E')
.help("disable interpretation of backslash escapes (default)") .help(get_message("echo-help-disable-escapes"))
.action(ArgAction::SetTrue) .action(ArgAction::SetTrue)
.overrides_with(options::ENABLE_BACKSLASH_ESCAPE), .overrides_with(options::ENABLE_BACKSLASH_ESCAPE),
) )
@ -177,10 +177,7 @@ fn execute(
) -> UResult<()> { ) -> UResult<()> {
for (i, input) in arguments_after_options.into_iter().enumerate() { for (i, input) in arguments_after_options.into_iter().enumerate() {
let Some(bytes) = bytes_from_os_string(input.as_os_str()) else { let Some(bytes) = bytes_from_os_string(input.as_os_str()) else {
return Err(USimpleError::new( return Err(USimpleError::new(1, get_message("echo-error-non-utf8")));
1,
"Non-UTF-8 arguments provided, but this platform does not support them",
));
}; };
if i > 0 { if i > 0 {