Denton Liu [off-list ref] writes:
+static inline void control_packet_write(int fd, const char *s, const char *type)
+{
+ packet_trace_str(s, 1);
+ if (write_str_in_full(fd, s) < 0)
+ die_errno(_("unable to write %s packet"), type);
This construct, whether "type" is a localized string _("...") or
English literal "...", would not translate well, would it? The
former causes sentence lego and the latter injects untranslated
adjective that modifies the word "packet" in the final sentence.
As write_str_in_full() MUST count how long the string is at runtime,
without any possibility to offload the work to compiler, when these
strings that are sent with the "magical 4" are all compile-time
constant literal strings, I am not sure if this is something we
should be happy with---we should aim better for a solution that does
not require the runtime to count if possible.
Thanks.