@@ -703,16 +703,30 @@ Program Output
703
703
704
704
Error Messages
705
705
706
- - Do not end error messages with a full stop.
706
+ - Do not end a single-sentence error message with a full stop.
707
707
708
708
- Do not capitalize the first word, only because it is the first word
709
- in the message ("unable to open %s ", not "Unable to open %s "). But
709
+ in the message ("unable to open '%s' ", not "Unable to open '%s' "). But
710
710
"SHA-3 not supported" is fine, because the reason the first word is
711
711
capitalized is not because it is at the beginning of the sentence,
712
712
but because the word would be spelled in capital letters even when
713
713
it appeared in the middle of the sentence.
714
714
715
- - Say what the error is first ("cannot open %s", not "%s: cannot open")
715
+ - Say what the error is first ("cannot open '%s'", not "%s: cannot open").
716
+
717
+ - Enclose the subject of an error inside a pair of single quotes,
718
+ e.g. `die(_("unable to open '%s'"), path)`.
719
+
720
+ - Unless there is a compelling reason not to, error messages from
721
+ porcelain commands should be marked for translation, e.g.
722
+ `die(_("bad revision %s"), revision)`.
723
+
724
+ - Error messages from the plumbing commands are sometimes meant for
725
+ machine consumption and should not be marked for translation,
726
+ e.g., `die("bad revision %s", revision)`.
727
+
728
+ - BUG("message") are for communicating the specific error to developers,
729
+ thus should not be translated.
716
730
717
731
718
732
Externally Visible Names
0 commit comments