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

[PATCH 11/22] ident.c: mark strings for translation

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Feb 27, 2016, 06:42 UTC
Message-ID
<1456555333-5853-12-git-send-email-pclouds@gmail.com>
In-Reply-To
<1456555333-5853-1-git-send-email-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 ident.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/ident.c b/ident.c
index 6e12582..367a5dc 100644
--- a/ident.c
+++ b/ident.c
@@ -75,13 +75,13 @@ static int add_mailname_host(struct strbuf *buf)
 	mailname = fopen("/etc/mailname", "r");
 	if (!mailname) {
 		if (errno != ENOENT)
-			warning("cannot open /etc/mailname: %s",
+			warning(_("cannot open /etc/mailname: %s"),
 				strerror(errno));
 		return -1;
 	}
 	if (strbuf_getline(&mailnamebuf, mailname) == EOF) {
 		if (ferror(mailname))
-			warning("cannot read /etc/mailname: %s",
+			warning(_("cannot read /etc/mailname: %s"),
 				strerror(errno));
 		strbuf_release(&mailnamebuf);
 		fclose(mailname);
@@ -125,7 +125,7 @@ static void add_domainname(struct strbuf *out, int *is_bogus)
 	char buf[1024];
 
 	if (gethostname(buf, sizeof(buf))) {
-		warning("cannot get host name: %s", strerror(errno));
+		warning(_("cannot get host name: %s"), strerror(errno));
 		strbuf_addstr(out, "(none)");
 		*is_bogus = 1;
 		return;
@@ -355,18 +355,18 @@ const char *fmt_ident(const char *name, const char *email,
 			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 (strict && ident_use_config_only
 			    && !(ident_config_given & IDENT_NAME_GIVEN))
-				die("user.useConfigOnly set but no name given");
+				die(_("user.useConfigOnly set but no name given"));
 		}
 		if (!*name) {
 			struct passwd *pw;
 			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;
@@ -377,11 +377,11 @@ const char *fmt_ident(const char *name, const char *email,
 		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);
 		}
 		if (strict && ident_use_config_only
 		    && !(ident_config_given & IDENT_MAIL_GIVEN))
-			die("user.useConfigOnly set but no mail given");
+			die(_("user.useConfigOnly set but no mail given"));
 	}
 
 	strbuf_reset(&ident);
@@ -396,7 +396,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.8.0.rc0.205.g7ec8cf1
Previous: Junio C HamanoNext: Junio C Hamano
Message 22 of 46 in “Mark more strings for translation”
  1. 00/22 Mark more strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  2. 01/22 credential-cache--daemon: enable localized messagesNguyễn Thái Ngọc Duy, Feb 27, 2016
  3. 02/22 builtin/blame.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  4. Junio C HamanoFeb 28, 2016
  5. Duy NguyenFeb 29, 2016
  6. Junio C HamanoFeb 29, 2016
  7. 03/22 builtin/checkout.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  8. Junio C HamanoFeb 28, 2016
  9. 04/22 builtin/clone.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  10. Junio C HamanoFeb 28, 2016
  11. 05/22 builtin/config.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  12. Junio C HamanoFeb 29, 2016
  13. 06/22 builtin/config.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  14. 07/22 builtin/update-index.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  15. Junio C HamanoFeb 29, 2016
  16. 08/22 convert.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  17. Junio C HamanoFeb 29, 2016
  18. 09/22 credential-cache--daemon.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  19. Junio C HamanoFeb 29, 2016
  20. 10/22 http.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  21. Junio C HamanoFeb 29, 2016
  22. 11/22 ident.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  23. Junio C HamanoFeb 29, 2016
  24. Jeff KingMar 1, 2016
  25. 12/22 notes.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  26. Junio C HamanoFeb 29, 2016
  27. 13/22 ref-filter.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  28. Junio C HamanoFeb 29, 2016
  29. 14/22 refs/files-backend.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  30. Junio C HamanoFeb 29, 2016
  31. Duy NguyenMar 1, 2016
  32. 15/22 remote-curl.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  33. Junio C HamanoFeb 29, 2016
  34. 16/22 run-command.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  35. Junio C HamanoFeb 29, 2016
  36. Stefan BellerMar 1, 2016
  37. 17/22 sha1_file.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  38. 18/22 submodule.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  39. 19/22 trailer.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  40. Junio C HamanoFeb 29, 2016
  41. 20/22 transport-helper.c: mark strings for translatingNguyễn Thái Ngọc Duy, Feb 27, 2016
  42. 21/22 transport.c: mark strings for translatingNguyễn Thái Ngọc Duy, Feb 27, 2016
  43. 22/22 wrapper.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  44. Junio C HamanoFeb 27, 2016
  45. Junio C HamanoFeb 27, 2016
  46. Duy NguyenFeb 28, 2016

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.