Skip to content

Commit c96f414

Browse files
committed
l10n: port echo for translation + add french
1 parent 60bf6cb commit c96f414

3 files changed

Lines changed: 34 additions & 7 deletions

File tree

src/uu/echo/locales/en-US.ftl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ echo-after-help = Echo the STRING(s) to standard output.
1616
- \v vertical tab
1717
- \0NNN byte with octal value NNN (1 to 3 digits)
1818
- \xHH byte with hexadecimal value HH (1 to 2 digits)
19+
20+
echo-help-no-newline = do not output the trailing newline
21+
echo-help-enable-escapes = enable interpretation of backslash escapes
22+
echo-help-disable-escapes = disable interpretation of backslash escapes (default)
23+
24+
echo-error-non-utf8 = Non-UTF-8 arguments provided, but this platform does not support them

src/uu/echo/locales/fr-FR.ftl

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

src/uu/echo/src/echo.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,20 @@ pub fn uu_app() -> Command {
145145
.arg(
146146
Arg::new(options::NO_NEWLINE)
147147
.short('n')
148-
.help("do not output the trailing newline")
148+
.help(get_message("echo-help-no-newline"))
149149
.action(ArgAction::SetTrue),
150150
)
151151
.arg(
152152
Arg::new(options::ENABLE_BACKSLASH_ESCAPE)
153153
.short('e')
154-
.help("enable interpretation of backslash escapes")
154+
.help(get_message("echo-help-enable-escapes"))
155155
.action(ArgAction::SetTrue)
156156
.overrides_with(options::DISABLE_BACKSLASH_ESCAPE),
157157
)
158158
.arg(
159159
Arg::new(options::DISABLE_BACKSLASH_ESCAPE)
160160
.short('E')
161-
.help("disable interpretation of backslash escapes (default)")
161+
.help(get_message("echo-help-disable-escapes"))
162162
.action(ArgAction::SetTrue)
163163
.overrides_with(options::ENABLE_BACKSLASH_ESCAPE),
164164
)
@@ -177,10 +177,7 @@ fn execute(
177177
) -> UResult<()> {
178178
for (i, input) in arguments_after_options.into_iter().enumerate() {
179179
let Some(bytes) = bytes_from_os_string(input.as_os_str()) else {
180-
return Err(USimpleError::new(
181-
1,
182-
"Non-UTF-8 arguments provided, but this platform does not support them",
183-
));
180+
return Err(USimpleError::new(1, get_message("echo-error-non-utf8")));
184181
};
185182

186183
if i > 0 {

0 commit comments

Comments
 (0)