git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/4] ident: mark error messages for translation

From
Jeff King <peff@peff.net>
Date
Feb 23, 2017, 08:12 UTC
Message-ID
<20170223081230.4u4xpebfhmr2h4gk@sigill.intra.peff.net>
In-Reply-To
<20170223081157.hwfn3msfux5udmng@sigill.intra.peff.net>

We already translate the big "please tell me who you are" hint, but missed the individual error messages that go with it.

Signed-off-by: Jeff King <peff@peff.net>
---
 ident.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ident.c b/ident.c
index ac4ae02b4..dde82983a 100644
--- a/ident.c
+++ b/ident.c
@@ -357,13 +357,13 @@ const char *fmt_ident(const char *name, const char *email,
 			if (strict && ident_use_config_only
 			    && !(ident_config_given & IDENT_NAME_GIVEN)) {
 				fputs(_(env_hint), stderr);
-				die("no name was given and auto-detection is disabled");
+				die(_("no name was given and auto-detection is disabled"));
 			}
 			name = ident_default_name();
 			using_default = 1;
 			if (strict && default_name_is_bogus) {
 				fputs(_(env_hint), stderr);
-				die("unable to auto-detect name (got '%s')", name);
+				die(_("unable to auto-detect name (got '%s')"), name);
 			}
 		}
 		if (!*name) {
@@ -371,7 +371,7 @@ const char *fmt_ident(const char *name, const char *email,
 			if (strict) {
 				if (using_default)
 					fputs(_(env_hint), stderr);
-				die("empty ident name (for <%s>) not allowed", email);
+				die(_("empty ident name (for <%s>) not allowed"), email);
 			}
 			pw = xgetpwuid_self(NULL);
 			name = pw->pw_name;
@@ -382,12 +382,12 @@ const char *fmt_ident(const char *name, const char *email,
 		if (strict && ident_use_config_only
 		    && !(ident_config_given & IDENT_MAIL_GIVEN)) {
 			fputs(_(env_hint), stderr);
-			die("no email was given and auto-detection is disabled");
+			die(_("no email was given and auto-detection is disabled"));
 		}
 		email = ident_default_email();
 		if (strict && default_email_is_bogus) {
 			fputs(_(env_hint), stderr);
-			die("unable to auto-detect email address (got '%s')", email);
+			die(_("unable to auto-detect email address (got '%s')"), email);
 		}
 	}
 
@@ -403,7 +403,7 @@ const char *fmt_ident(const char *name, const char *email,
 		strbuf_addch(&ident, ' ');
 		if (date_str && date_str[0]) {
 			if (parse_date(date_str, &ident) < 0)
-				die("invalid date format: %s", date_str);
+				die(_("invalid date format: %s"), date_str);
 		}
 		else
 			strbuf_addstr(&ident, ident_default_date());
-- 
2.12.0.rc2.597.g959f68882
Previous: Jeff KingNext: Jeff King
Message 4 of 13 in “possible bug: inconsistent CLI behaviour for empty user.name”
  1. bs.x.ttp@recursor.netFeb 3, 2017
  2. Jeff KingFeb 23, 2017
  3. 2/4 ident: handle NULL email when complaining of empty nameJeff King, Feb 23, 2017
  4. 1/4 ident: mark error messages for translationJeff King, Feb 23, 2017
  5. 3/4 ident: reject all-crud ident nameJeff King, Feb 23, 2017
  6. 4/4 ident: do not ignore empty config name/emailJeff King, Feb 23, 2017
  7. Junio C HamanoFeb 23, 2017
  8. Jeff KingFeb 24, 2017
  9. Junio C HamanoFeb 24, 2017
  10. Jeff KingFeb 24, 2017
  11. Dennis KaarsemakerFeb 27, 2017
  12. Junio C HamanoFeb 27, 2017
  13. Christian CouderFeb 28, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.