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

[PATCH 13/22] ref-filter.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-14-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>
---
 ref-filter.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/ref-filter.c b/ref-filter.c
index bb79d6b..bc551a7 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -74,14 +74,14 @@ static void remote_ref_atom_parser(struct used_atom *atom, const char *arg)
 static void body_atom_parser(struct used_atom *atom, const char *arg)
 {
 	if (arg)
-		die("%%(body) does not take arguments");
+		die(_("%%(body) does not take arguments"));
 	atom->u.contents.option = C_BODY_DEP;
 }
 
 static void subject_atom_parser(struct used_atom *atom, const char *arg)
 {
 	if (arg)
-		die("%%(subject) does not take arguments");
+		die(_("%%(subject) does not take arguments"));
 	atom->u.contents.option = C_SUB;
 }
 
@@ -241,7 +241,7 @@ int parse_ref_filter_atom(const char *atom, const char *ep)
 	if (*sp == '*' && sp < ep)
 		sp++; /* deref */
 	if (ep <= sp)
-		die("malformed field name: %.*s", (int)(ep-atom), atom);
+		die(_("malformed field name: %.*s"), (int)(ep-atom), atom);
 
 	/* Do we have the atom already used elsewhere? */
 	for (i = 0; i < used_atom_cnt; i++) {
@@ -267,7 +267,7 @@ int parse_ref_filter_atom(const char *atom, const char *ep)
 	}
 
 	if (ARRAY_SIZE(valid_atom) <= i)
-		die("unknown field name: %.*s", (int)(ep-atom), atom);
+		die(_("unknown field name: %.*s"), (int)(ep-atom), atom);
 
 	/* Add it in, including the deref prefix */
 	at = used_atom_cnt;
@@ -421,7 +421,7 @@ int verify_ref_format(const char *format)
 		int at;
 
 		if (!ep)
-			return error("malformed format string %s", sp);
+			return error(_("malformed format string %s"), sp);
 		/* sp points at "%(" and ep points at the closing ")" */
 		at = parse_ref_filter_atom(sp + 2, ep);
 		cp = ep + 1;
@@ -875,12 +875,12 @@ static const char *strip_ref_components(const char *refname, const char *nr_arg)
 	const char *start = refname;
 
 	if (nr < 1 || *end != '\0')
-		die(":strip= requires a positive integer argument");
+		die(_(":strip= requires a positive integer argument"));
 
 	while (remaining) {
 		switch (*start++) {
 		case '\0':
-			die("ref '%s' does not have %ld components to :strip",
+			die(_("ref '%s' does not have %ld components to :strip"),
 			    refname, nr);
 		case '/':
 			remaining--;
@@ -1043,7 +1043,7 @@ static void populate_value(struct ref_array_item *ref)
 			else if (skip_prefix(formatp, "strip=", &arg))
 				refname = strip_ref_components(refname, arg);
 			else
-				die("unknown %.*s format %s",
+				die(_("unknown %.*s format %s"),
 				    (int)(formatp - name), name, formatp);
 		}
 
@@ -1063,10 +1063,10 @@ static void populate_value(struct ref_array_item *ref)
  need_obj:
 	buf = get_obj(ref->objectname, &obj, &size, &eaten);
 	if (!buf)
-		die("missing object %s for %s",
+		die(_("missing object %s for %s"),
 		    sha1_to_hex(ref->objectname), ref->refname);
 	if (!obj)
-		die("parse_object_buffer failed on %s for %s",
+		die(_("parse_object_buffer failed on %s for %s"),
 		    sha1_to_hex(ref->objectname), ref->refname);
 
 	grab_values(ref->value, 0, obj, buf, size);
@@ -1094,10 +1094,10 @@ static void populate_value(struct ref_array_item *ref)
 	 */
 	buf = get_obj(tagged, &obj, &size, &eaten);
 	if (!buf)
-		die("missing object %s for %s",
+		die(_("missing object %s for %s"),
 		    sha1_to_hex(tagged), ref->refname);
 	if (!obj)
-		die("parse_object_buffer failed on %s for %s",
+		die(_("parse_object_buffer failed on %s for %s"),
 		    sha1_to_hex(tagged), ref->refname);
 	grab_values(ref->value, 1, obj, buf, size);
 	if (!eaten)
@@ -1370,12 +1370,12 @@ static int ref_filter_handler(const char *refname, const struct object_id *oid,
 	unsigned int kind;
 
 	if (flag & REF_BAD_NAME) {
-		warning("ignoring ref with broken name %s", refname);
+		warning(_("ignoring ref with broken name %s"), refname);
 		return 0;
 	}
 
 	if (flag & REF_ISBROKEN) {
-		warning("ignoring broken ref %s", refname);
+		warning(_("ignoring broken ref %s"), refname);
 		return 0;
 	}
 
-- 
2.8.0.rc0.205.g7ec8cf1
Previous: Junio C HamanoNext: Junio C Hamano
Message 27 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.