]> granicus.if.org Git - neomutt/commitdiff
I18N: handler.c: Do not glue translations together
authorReis Radomil <reisradomil@fake-box.com>
Sun, 22 Apr 2018 04:16:01 +0000 (04:16 +0000)
committerRichard Russon <rich@flatcap.org>
Tue, 24 Apr 2018 20:29:50 +0000 (21:29 +0100)
Do not use this antipattern:

  printf(_("some %s sentence."), b ? _("big") : _("small"));

as the translation of "big"/"small" and depends on the sentence it is
used in. Instead give the translator the complete sentence:

  if (b)
    printf(_("some big sentence."));
  else
    printf(_("some small sentence."));

handler.c

index 78e3c696666d60db553429a01b0da19ab1d1f9fb..f96adf1c82c8afeba89210e89088ffbfeaccae26 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -63,12 +63,13 @@ static void print_part_line(struct State *s, struct Body *b, int n)
   state_mark_attach(s);
   char *charset = mutt_param_get(&b->parameter, "charset");
   if (n != 0)
-    state_printf(s, _("[-- Alternative Type #%d: "), n);
+    state_printf(s, _("[-- Alternative Type #%d: %s/%s%s%s, Encoding: %s, Size: %s --]\n"),
+                 n, TYPE(b), b->subtype, charset ? "; charset=" : "",
+                 charset ? charset : "", ENCODING(b->encoding), length);
   else
-    state_printf(s, _("[-- Type: "));
-  state_printf(s, _("%s/%s%s%s, Encoding: %s, Size: %s --]\n"), TYPE(b),
-               b->subtype, charset ? "; charset=" : "", charset ? charset : "",
-               ENCODING(b->encoding), length);
+    state_printf(s, _("[-- Type: %s/%s%s%s, Encoding: %s, Size: %s --]\n"),
+                 TYPE(b), b->subtype, charset ? "; charset=" : "",
+                 charset ? charset : "", ENCODING(b->encoding), length);
 }
 
 static void convert_to_state(iconv_t cd, char *bufi, size_t *l, struct State *s)