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

[PATCH v2 11/14] i18n: receive-pack: mark messages for translation

From
Vasco Almeida <vascomalmeida@sapo.pt>
Date
Sep 12, 2016, 11:29 UTC
Message-ID
<1473679802-31381-11-git-send-email-vascomalmeida@sapo.pt>
In-Reply-To
<1473679802-31381-1-git-send-email-vascomalmeida@sapo.pt>

Mark messages refuse_unconfigured_deny_msg and refuse_unconfigured_deny_delete_current_msg for translation.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 builtin/receive-pack.c | 58 ++++++++++++++++++++++----------------------------
 1 file changed, 25 insertions(+), 33 deletions(-)
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index f1ce05c..896b16f 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -781,47 +781,39 @@ static int is_ref_checked_out(const char *ref)
 	return !strcmp(head_name, ref);
 }
 
-static char *refuse_unconfigured_deny_msg[] = {
-	"By default, updating the current branch in a non-bare repository",
-	"is denied, because it will make the index and work tree inconsistent",
-	"with what you pushed, and will require 'git reset --hard' to match",
-	"the work tree to HEAD.",
-	"",
-	"You can set 'receive.denyCurrentBranch' configuration variable to",
-	"'ignore' or 'warn' in the remote repository to allow pushing into",
-	"its current branch; however, this is not recommended unless you",
-	"arranged to update its work tree to match what you pushed in some",
-	"other way.",
-	"",
-	"To squelch this message and still keep the default behaviour, set",
-	"'receive.denyCurrentBranch' configuration variable to 'refuse'."
-};
+static char *refuse_unconfigured_deny_msg =
+	N_("By default, updating the current branch in a non-bare repository\n"
+	   "is denied, because it will make the index and work tree inconsistent\n"
+	   "with what you pushed, and will require 'git reset --hard' to match\n"
+	   "the work tree to HEAD.\n"
+	   "\n"
+	   "You can set 'receive.denyCurrentBranch' configuration variable to\n"
+	   "'ignore' or 'warn' in the remote repository to allow pushing into\n"
+	   "its current branch; however, this is not recommended unless you\n"
+	   "arranged to update its work tree to match what you pushed in some\n"
+	   "other way.\n"
+	   "\n"
+	   "To squelch this message and still keep the default behaviour, set\n"
+	   "'receive.denyCurrentBranch' configuration variable to 'refuse'.");
 
 static void refuse_unconfigured_deny(void)
 {
-	int i;
-	for (i = 0; i < ARRAY_SIZE(refuse_unconfigured_deny_msg); i++)
-		rp_error("%s", refuse_unconfigured_deny_msg[i]);
+	rp_error("%s", _(refuse_unconfigured_deny_msg));
 }
 
-static char *refuse_unconfigured_deny_delete_current_msg[] = {
-	"By default, deleting the current branch is denied, because the next",
-	"'git clone' won't result in any file checked out, causing confusion.",
-	"",
-	"You can set 'receive.denyDeleteCurrent' configuration variable to",
-	"'warn' or 'ignore' in the remote repository to allow deleting the",
-	"current branch, with or without a warning message.",
-	"",
-	"To squelch this message, you can set it to 'refuse'."
-};
+static char *refuse_unconfigured_deny_delete_current_msg =
+	N_("By default, deleting the current branch is denied, because the next\n"
+	   "'git clone' won't result in any file checked out, causing confusion.\n"
+	   "\n"
+	   "You can set 'receive.denyDeleteCurrent' configuration variable to\n"
+	   "'warn' or 'ignore' in the remote repository to allow deleting the\n"
+	   "current branch, with or without a warning message.\n"
+	   "\n"
+	   "To squelch this message, you can set it to 'refuse'.");
 
 static void refuse_unconfigured_deny_delete_current(void)
 {
-	int i;
-	for (i = 0;
-	     i < ARRAY_SIZE(refuse_unconfigured_deny_delete_current_msg);
-	     i++)
-		rp_error("%s", refuse_unconfigured_deny_delete_current_msg[i]);
+	rp_error("%s", _(refuse_unconfigured_deny_delete_current_msg));
 }
 
 static int command_singleton_iterator(void *cb_data, unsigned char sha1[20]);
-- 
2.7.4
Previous: Junio C HamanoNext: Vasco Almeida
Message 24 of 26 in “i18n: apply: mark plural string for translation”
  1. 01/14 i18n: apply: mark plural string for translationVasco Almeida, Sep 12, 2016
  2. 06/14 i18n: config: mark error message for translationVasco Almeida, Sep 12, 2016
  3. 10/14 notes: lowercase first word of error messagesVasco Almeida, Sep 12, 2016
  4. 02/14 i18n: apply: mark error messages for translationVasco Almeida, Sep 12, 2016
  5. 04/14 i18n: blame: mark error messages for translationVasco Almeida, Sep 12, 2016
  6. 03/14 i18n: apply: mark info messages for translationVasco Almeida, Sep 12, 2016
  7. 05/14 i18n: branch: mark option description for translationVasco Almeida, Sep 12, 2016
  8. 07/14 i18n: merge-recursive: mark error messages for translationVasco Almeida, Sep 12, 2016
  9. Jean-Noël AvilaSep 12, 2016
  10. Junio C HamanoSep 12, 2016
  11. Junio C HamanoSep 12, 2016
  12. Vasco AlmeidaSep 13, 2016
  13. 08/14 i18n: merge-recursive: mark verbose message for translationVasco Almeida, Sep 12, 2016
  14. 09/14 i18n: notes: mark error messages for translationVasco Almeida, Sep 12, 2016
  15. Jean-Noël AvilaSep 12, 2016
  16. Vasco AlmeidaSep 13, 2016
  17. Jean-Noël AVILASep 13, 2016
  18. Junio C HamanoSep 13, 2016
  19. 12/14 i18n: show-branch: mark error messages for translationVasco Almeida, Sep 12, 2016
  20. Jean-Noël AvilaSep 12, 2016
  21. Junio C HamanoSep 12, 2016
  22. Jean-Noël AVILASep 12, 2016
  23. Junio C HamanoSep 12, 2016
  24. 11/14 i18n: receive-pack: mark messages for translationVasco Almeida, Sep 12, 2016
  25. 13/14 i18n: update-index: mark warnings for translationVasco Almeida, Sep 12, 2016
  26. 14/14 i18n: show-branch: mark plural strings for translationVasco Almeida, Sep 12, 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.