ref-filter.c: mark strings for translation

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Feb 27, 2016 at 13:42 UTC 1823c619e9fa9d7826b4cfc58bf05815cf88eaed
1 file changed +14 -14
ref-filter.c
+14 -14
@@ -74,14 +74,14 @@ static void remote_ref_atom_parser(struct used_atom *atom, const char *arg)
74 static void body_atom_parser(struct used_atom *atom, const char *arg)
75 {
76 if (arg)
77 - die("%%(body) does not take arguments");
77 + die(_("%%(body) does not take arguments"));
78 atom->u.contents.option = C_BODY_DEP;
79 }
80
81 static void subject_atom_parser(struct used_atom *atom, const char *arg)
82 {
83 if (arg)
84 - die("%%(subject) does not take arguments");
84 + die(_("%%(subject) does not take arguments"));
85 atom->u.contents.option = C_SUB;
86 }
87
@@ -241,7 +241,7 @@ int parse_ref_filter_atom(const char *atom, const char *ep)
241 if (*sp == '*' && sp < ep)
242 sp++; /* deref */
243 if (ep <= sp)
244 - die("malformed field name: %.*s", (int)(ep-atom), atom);
244 + die(_("malformed field name: %.*s"), (int)(ep-atom), atom);
245
246 /* Do we have the atom already used elsewhere? */
247 for (i = 0; i < used_atom_cnt; i++) {
@@ -267,7 +267,7 @@ int parse_ref_filter_atom(const char *atom, const char *ep)
267 }
268
269 if (ARRAY_SIZE(valid_atom) <= i)
270 - die("unknown field name: %.*s", (int)(ep-atom), atom);
270 + die(_("unknown field name: %.*s"), (int)(ep-atom), atom);
271
272 /* Add it in, including the deref prefix */
273 at = used_atom_cnt;
@@ -421,7 +421,7 @@ int verify_ref_format(const char *format)
421 int at;
422
423 if (!ep)
424 - return error("malformed format string %s", sp);
424 + return error(_("malformed format string %s"), sp);
425 /* sp points at "%(" and ep points at the closing ")" */
426 at = parse_ref_filter_atom(sp + 2, ep);
427 cp = ep + 1;
@@ -875,12 +875,12 @@ static const char *strip_ref_components(const char *refname, const char *nr_arg)
875 const char *start = refname;
876
877 if (nr < 1 || *end != '\0')
878 - die(":strip= requires a positive integer argument");
878 + die(_(":strip= requires a positive integer argument"));
879
880 while (remaining) {
881 switch (*start++) {
882 case '\0':
883 - die("ref '%s' does not have %ld components to :strip",
883 + die(_("ref '%s' does not have %ld components to :strip"),
884 refname, nr);
885 case '/':
886 remaining--;
@@ -1043,7 +1043,7 @@ static void populate_value(struct ref_array_item *ref)
1043 else if (skip_prefix(formatp, "strip=", &arg))
1044 refname = strip_ref_components(refname, arg);
1045 else
1046 - die("unknown %.*s format %s",
1046 + die(_("unknown %.*s format %s"),
1047 (int)(formatp - name), name, formatp);
1048 }
1049
@@ -1063,10 +1063,10 @@ static void populate_value(struct ref_array_item *ref)
1063 need_obj:
1064 buf = get_obj(ref->objectname, &obj, &size, &eaten);
1065 if (!buf)
1066 - die("missing object %s for %s",
1066 + die(_("missing object %s for %s"),
1067 sha1_to_hex(ref->objectname), ref->refname);
1068 if (!obj)
1069 - die("parse_object_buffer failed on %s for %s",
1069 + die(_("parse_object_buffer failed on %s for %s"),
1070 sha1_to_hex(ref->objectname), ref->refname);
1071
1072 grab_values(ref->value, 0, obj, buf, size);
@@ -1094,10 +1094,10 @@ static void populate_value(struct ref_array_item *ref)
1094 */
1095 buf = get_obj(tagged, &obj, &size, &eaten);
1096 if (!buf)
1097 - die("missing object %s for %s",
1097 + die(_("missing object %s for %s"),
1098 sha1_to_hex(tagged), ref->refname);
1099 if (!obj)
1100 - die("parse_object_buffer failed on %s for %s",
1100 + die(_("parse_object_buffer failed on %s for %s"),
1101 sha1_to_hex(tagged), ref->refname);
1102 grab_values(ref->value, 1, obj, buf, size);
1103 if (!eaten)
@@ -1370,12 +1370,12 @@ static int ref_filter_handler(const char *refname, const struct object_id *oid,
1370 unsigned int kind;
1371
1372 if (flag & REF_BAD_NAME) {
1373 - warning("ignoring ref with broken name %s", refname);
1373 + warning(_("ignoring ref with broken name %s"), refname);
1374 return 0;
1375 }
1376
1377 if (flag & REF_ISBROKEN) {
1378 - warning("ignoring broken ref %s", refname);
1378 + warning(_("ignoring broken ref %s"), refname);
1379 return 0;
1380 }
1381