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

[PATCH 4/6] i18n: ident: mark hint for translation

From
Vasco Almeida <vascomalmeida@sapo.pt>
Date
Sep 19, 2016, 13:08 UTC
Message-ID
<1474290501-2743-4-git-send-email-vascomalmeida@sapo.pt>
In-Reply-To
<1474290501-2743-1-git-send-email-vascomalmeida@sapo.pt>
Mark env_hint for translation.
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 ident.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/ident.c b/ident.c
index e20a772..92c3cca 100644
--- a/ident.c
+++ b/ident.c
@@ -331,17 +331,17 @@ int split_ident_line(struct ident_split *split, const char *line, int len)
 }
 
 static const char *env_hint =
-"\n"
-"*** Please tell me who you are.\n"
-"\n"
-"Run\n"
-"\n"
-"  git config --global user.email \"you@example.com\"\n"
-"  git config --global user.name \"Your Name\"\n"
-"\n"
-"to set your account\'s default identity.\n"
-"Omit --global to set the identity only in this repository.\n"
-"\n";
+N_("\n"
+   "*** Please tell me who you are.\n"
+   "\n"
+   "Run\n"
+   "\n"
+   "  git config --global user.email \"you@example.com\"\n"
+   "  git config --global user.name \"Your Name\"\n"
+   "\n"
+   "to set your account\'s default identity.\n"
+   "Omit --global to set the identity only in this repository.\n"
+   "\n");
 
 const char *fmt_ident(const char *name, const char *email,
 		      const char *date_str, int flag)
@@ -356,13 +356,13 @@ const char *fmt_ident(const char *name, const char *email,
 		if (!name) {
 			if (strict && ident_use_config_only
 			    && !(ident_config_given & IDENT_NAME_GIVEN)) {
-				fputs(env_hint, stderr);
+				fputs(_(env_hint), stderr);
 				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);
+				fputs(_(env_hint), stderr);
 				die("unable to auto-detect name (got '%s')", name);
 			}
 		}
@@ -370,7 +370,7 @@ const char *fmt_ident(const char *name, const char *email,
 			struct passwd *pw;
 			if (strict) {
 				if (using_default)
-					fputs(env_hint, stderr);
+					fputs(_(env_hint), stderr);
 				die("empty ident name (for <%s>) not allowed", email);
 			}
 			pw = xgetpwuid_self(NULL);
@@ -381,12 +381,12 @@ const char *fmt_ident(const char *name, const char *email,
 	if (!email) {
 		if (strict && ident_use_config_only
 		    && !(ident_config_given & IDENT_MAIL_GIVEN)) {
-			fputs(env_hint, stderr);
+			fputs(_(env_hint), stderr);
 			die("no email was given and auto-detection is disabled");
 		}
 		email = ident_default_email();
 		if (strict && default_email_is_bogus) {
-			fputs(env_hint, stderr);
+			fputs(_(env_hint), stderr);
 			die("unable to auto-detect email address (got '%s')", email);
 		}
 	}
-- 
2.7.4
Previous: Vasco AlmeidaNext: Vasco Almeida
Message 3 of 11 in “i18n: commit: mark message for translation”
  1. 1/6 i18n: commit: mark message for translationVasco Almeida, Sep 19, 2016
  2. 2/6 i18n: connect: mark die messages for translationVasco Almeida, Sep 19, 2016
  3. 4/6 i18n: ident: mark hint for translationVasco Almeida, Sep 19, 2016
  4. 3/6 i18n: diff: mark die errors for translationVasco Almeida, Sep 19, 2016
  5. 5/6 i18n: notes-merge: mark die messages for translationVasco Almeida, Sep 19, 2016
  6. 6/6 i18n: stash: mark messages for translationVasco Almeida, Sep 19, 2016
  7. Junio C HamanoSep 19, 2016
  8. Jean-Noël AVILASep 19, 2016
  9. Junio C HamanoSep 19, 2016
  10. Jean-Noël AVILASep 20, 2016
  11. Junio C HamanoSep 21, 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.