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>
This commit is contained in:
parent
39ad4f39cc
commit
1823c619e9
28
ref-filter.c
28
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)
|
static void body_atom_parser(struct used_atom *atom, const char *arg)
|
||||||
{
|
{
|
||||||
if (arg)
|
if (arg)
|
||||||
die("%%(body) does not take arguments");
|
die(_("%%(body) does not take arguments"));
|
||||||
atom->u.contents.option = C_BODY_DEP;
|
atom->u.contents.option = C_BODY_DEP;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void subject_atom_parser(struct used_atom *atom, const char *arg)
|
static void subject_atom_parser(struct used_atom *atom, const char *arg)
|
||||||
{
|
{
|
||||||
if (arg)
|
if (arg)
|
||||||
die("%%(subject) does not take arguments");
|
die(_("%%(subject) does not take arguments"));
|
||||||
atom->u.contents.option = C_SUB;
|
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)
|
if (*sp == '*' && sp < ep)
|
||||||
sp++; /* deref */
|
sp++; /* deref */
|
||||||
if (ep <= sp)
|
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? */
|
/* Do we have the atom already used elsewhere? */
|
||||||
for (i = 0; i < used_atom_cnt; i++) {
|
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)
|
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 */
|
/* Add it in, including the deref prefix */
|
||||||
at = used_atom_cnt;
|
at = used_atom_cnt;
|
||||||
@ -421,7 +421,7 @@ int verify_ref_format(const char *format)
|
|||||||
int at;
|
int at;
|
||||||
|
|
||||||
if (!ep)
|
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 ")" */
|
/* sp points at "%(" and ep points at the closing ")" */
|
||||||
at = parse_ref_filter_atom(sp + 2, ep);
|
at = parse_ref_filter_atom(sp + 2, ep);
|
||||||
cp = ep + 1;
|
cp = ep + 1;
|
||||||
@ -875,12 +875,12 @@ static const char *strip_ref_components(const char *refname, const char *nr_arg)
|
|||||||
const char *start = refname;
|
const char *start = refname;
|
||||||
|
|
||||||
if (nr < 1 || *end != '\0')
|
if (nr < 1 || *end != '\0')
|
||||||
die(":strip= requires a positive integer argument");
|
die(_(":strip= requires a positive integer argument"));
|
||||||
|
|
||||||
while (remaining) {
|
while (remaining) {
|
||||||
switch (*start++) {
|
switch (*start++) {
|
||||||
case '\0':
|
case '\0':
|
||||||
die("ref '%s' does not have %ld components to :strip",
|
die(_("ref '%s' does not have %ld components to :strip"),
|
||||||
refname, nr);
|
refname, nr);
|
||||||
case '/':
|
case '/':
|
||||||
remaining--;
|
remaining--;
|
||||||
@ -1043,7 +1043,7 @@ static void populate_value(struct ref_array_item *ref)
|
|||||||
else if (skip_prefix(formatp, "strip=", &arg))
|
else if (skip_prefix(formatp, "strip=", &arg))
|
||||||
refname = strip_ref_components(refname, arg);
|
refname = strip_ref_components(refname, arg);
|
||||||
else
|
else
|
||||||
die("unknown %.*s format %s",
|
die(_("unknown %.*s format %s"),
|
||||||
(int)(formatp - name), name, formatp);
|
(int)(formatp - name), name, formatp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1063,10 +1063,10 @@ static void populate_value(struct ref_array_item *ref)
|
|||||||
need_obj:
|
need_obj:
|
||||||
buf = get_obj(ref->objectname, &obj, &size, &eaten);
|
buf = get_obj(ref->objectname, &obj, &size, &eaten);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
die("missing object %s for %s",
|
die(_("missing object %s for %s"),
|
||||||
sha1_to_hex(ref->objectname), ref->refname);
|
sha1_to_hex(ref->objectname), ref->refname);
|
||||||
if (!obj)
|
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);
|
sha1_to_hex(ref->objectname), ref->refname);
|
||||||
|
|
||||||
grab_values(ref->value, 0, obj, buf, size);
|
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);
|
buf = get_obj(tagged, &obj, &size, &eaten);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
die("missing object %s for %s",
|
die(_("missing object %s for %s"),
|
||||||
sha1_to_hex(tagged), ref->refname);
|
sha1_to_hex(tagged), ref->refname);
|
||||||
if (!obj)
|
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);
|
sha1_to_hex(tagged), ref->refname);
|
||||||
grab_values(ref->value, 1, obj, buf, size);
|
grab_values(ref->value, 1, obj, buf, size);
|
||||||
if (!eaten)
|
if (!eaten)
|
||||||
@ -1370,12 +1370,12 @@ static int ref_filter_handler(const char *refname, const struct object_id *oid,
|
|||||||
unsigned int kind;
|
unsigned int kind;
|
||||||
|
|
||||||
if (flag & REF_BAD_NAME) {
|
if (flag & REF_BAD_NAME) {
|
||||||
warning("ignoring ref with broken name %s", refname);
|
warning(_("ignoring ref with broken name %s"), refname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag & REF_ISBROKEN) {
|
if (flag & REF_ISBROKEN) {
|
||||||
warning("ignoring broken ref %s", refname);
|
warning(_("ignoring broken ref %s"), refname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user