Skip to content

Commit 4bea848

Browse files
committed
Merge branch 'nd/i18n'
Many more strings are prepared for l10n. * nd/i18n: (23 commits) transport-helper.c: mark more strings for translation transport.c: mark more strings for translation sha1-file.c: mark more strings for translation sequencer.c: mark more strings for translation replace-object.c: mark more strings for translation refspec.c: mark more strings for translation refs.c: mark more strings for translation pkt-line.c: mark more strings for translation object.c: mark more strings for translation exec-cmd.c: mark more strings for translation environment.c: mark more strings for translation dir.c: mark more strings for translation convert.c: mark more strings for translation connect.c: mark more strings for translation config.c: mark more strings for translation commit-graph.c: mark more strings for translation builtin/replace.c: mark more strings for translation builtin/pack-objects.c: mark more strings for translation builtin/grep.c: mark strings for translation builtin/config.c: mark more strings for translation ...
2 parents 3ec5ebe + 6b5b309 commit 4bea848

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+502
-483
lines changed

Diff for: archive-tar.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static int stream_blocked(const struct object_id *oid)
122122

123123
st = open_istream(oid, &type, &sz, NULL);
124124
if (!st)
125-
return error("cannot stream blob %s", oid_to_hex(oid));
125+
return error(_("cannot stream blob %s"), oid_to_hex(oid));
126126
for (;;) {
127127
readlen = read_istream(st, buf, sizeof(buf));
128128
if (readlen <= 0)
@@ -257,7 +257,7 @@ static int write_tar_entry(struct archiver_args *args,
257257
*header.typeflag = TYPEFLAG_REG;
258258
mode = (mode | ((mode & 0100) ? 0777 : 0666)) & ~tar_umask;
259259
} else {
260-
return error("unsupported file mode: 0%o (SHA1: %s)",
260+
return error(_("unsupported file mode: 0%o (SHA1: %s)"),
261261
mode, oid_to_hex(oid));
262262
}
263263
if (pathlen > sizeof(header.name)) {
@@ -284,7 +284,7 @@ static int write_tar_entry(struct archiver_args *args,
284284
enum object_type type;
285285
buffer = object_file_to_archive(args, path, oid, old_mode, &type, &size);
286286
if (!buffer)
287-
return error("cannot read %s", oid_to_hex(oid));
287+
return error(_("cannot read %s"), oid_to_hex(oid));
288288
} else {
289289
buffer = NULL;
290290
size = 0;
@@ -455,17 +455,17 @@ static int write_tar_filter_archive(const struct archiver *ar,
455455
filter.in = -1;
456456

457457
if (start_command(&filter) < 0)
458-
die_errno("unable to start '%s' filter", argv[0]);
458+
die_errno(_("unable to start '%s' filter"), argv[0]);
459459
close(1);
460460
if (dup2(filter.in, 1) < 0)
461-
die_errno("unable to redirect descriptor");
461+
die_errno(_("unable to redirect descriptor"));
462462
close(filter.in);
463463

464464
r = write_tar_archive(ar, args);
465465

466466
close(1);
467467
if (finish_command(&filter) != 0)
468-
die("'%s' filter reported error", argv[0]);
468+
die(_("'%s' filter reported error"), argv[0]);
469469

470470
strbuf_release(&cmd);
471471
return r;

Diff for: archive-zip.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,11 @@ static int write_zip_entry(struct archiver_args *args,
310310
if (is_utf8(path))
311311
flags |= ZIP_UTF8;
312312
else
313-
warning("Path is not valid UTF-8: %s", path);
313+
warning(_("path is not valid UTF-8: %s"), path);
314314
}
315315

316316
if (pathlen > 0xffff) {
317-
return error("path too long (%d chars, SHA1: %s): %s",
317+
return error(_("path too long (%d chars, SHA1: %s): %s"),
318318
(int)pathlen, oid_to_hex(oid), path);
319319
}
320320

@@ -341,15 +341,15 @@ static int write_zip_entry(struct archiver_args *args,
341341
size > big_file_threshold) {
342342
stream = open_istream(oid, &type, &size, NULL);
343343
if (!stream)
344-
return error("cannot stream blob %s",
344+
return error(_("cannot stream blob %s"),
345345
oid_to_hex(oid));
346346
flags |= ZIP_STREAM;
347347
out = buffer = NULL;
348348
} else {
349349
buffer = object_file_to_archive(args, path, oid, mode,
350350
&type, &size);
351351
if (!buffer)
352-
return error("cannot read %s",
352+
return error(_("cannot read %s"),
353353
oid_to_hex(oid));
354354
crc = crc32(crc, buffer, size);
355355
is_binary = entry_is_binary(path_without_prefix,
@@ -358,7 +358,7 @@ static int write_zip_entry(struct archiver_args *args,
358358
}
359359
compressed_size = (method == 0) ? size : 0;
360360
} else {
361-
return error("unsupported file mode: 0%o (SHA1: %s)", mode,
361+
return error(_("unsupported file mode: 0%o (SHA1: %s)"), mode,
362362
oid_to_hex(oid));
363363
}
364364

@@ -467,7 +467,7 @@ static int write_zip_entry(struct archiver_args *args,
467467
zstream.avail_in = readlen;
468468
result = git_deflate(&zstream, 0);
469469
if (result != Z_OK)
470-
die("deflate error (%d)", result);
470+
die(_("deflate error (%d)"), result);
471471
out_len = zstream.next_out - compressed;
472472

473473
if (out_len > 0) {
@@ -602,7 +602,7 @@ static void dos_time(timestamp_t *timestamp, int *dos_date, int *dos_time)
602602
struct tm *t;
603603

604604
if (date_overflows(*timestamp))
605-
die("timestamp too large for this system: %"PRItime,
605+
die(_("timestamp too large for this system: %"PRItime),
606606
*timestamp);
607607
time = (time_t)*timestamp;
608608
t = localtime(&time);

Diff for: builtin/blame.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ static void parse_color_fields(const char *s)
410410
}
411411

412412
if (next == EXPECT_COLOR)
413-
die (_("must end with a color"));
413+
die(_("must end with a color"));
414414

415415
colorfield[colorfield_nr].hop = TIME_MAX;
416416
string_list_clear(&l, 0);

Diff for: builtin/checkout.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1198,12 +1198,12 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
11981198
if (opts.track != BRANCH_TRACK_UNSPECIFIED && !opts.new_branch) {
11991199
const char *argv0 = argv[0];
12001200
if (!argc || !strcmp(argv0, "--"))
1201-
die (_("--track needs a branch name"));
1201+
die(_("--track needs a branch name"));
12021202
skip_prefix(argv0, "refs/", &argv0);
12031203
skip_prefix(argv0, "remotes/", &argv0);
12041204
argv0 = strchr(argv0, '/');
12051205
if (!argv0 || !argv0[1])
1206-
die (_("Missing branch name; try -b"));
1206+
die(_("missing branch name; try -b"));
12071207
opts.new_branch = argv0 + 1;
12081208
}
12091209

Diff for: builtin/commit.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1647,9 +1647,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
16471647
unlink(git_path_squash_msg(the_repository));
16481648

16491649
if (commit_index_files())
1650-
die (_("Repository has been updated, but unable to write\n"
1651-
"new_index file. Check that disk is not full and quota is\n"
1652-
"not exceeded, and then \"git reset HEAD\" to recover."));
1650+
die(_("repository has been updated, but unable to write\n"
1651+
"new_index file. Check that disk is not full and quota is\n"
1652+
"not exceeded, and then \"git reset HEAD\" to recover."));
16531653

16541654
rerere(0);
16551655
run_command_v_opt(argv_gc_auto, RUN_GIT_CMD);

Diff for: builtin/config.c

+27-23
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static int option_parse_type(const struct option *opt, const char *arg,
110110
* --int' and '--type=bool
111111
* --type=int'.
112112
*/
113-
error("only one type at a time.");
113+
error(_("only one type at a time"));
114114
usage_builtin_config();
115115
}
116116
*to_type = new_type;
@@ -164,7 +164,11 @@ static NORETURN void usage_builtin_config(void)
164164
static void check_argc(int argc, int min, int max) {
165165
if (argc >= min && argc <= max)
166166
return;
167-
error("wrong number of arguments");
167+
if (min == max)
168+
error(_("wrong number of arguments, should be %d"), min);
169+
else
170+
error(_("wrong number of arguments, should be from %d to %d"),
171+
min, max);
168172
usage_builtin_config();
169173
}
170174

@@ -297,7 +301,7 @@ static int get_value(const char *key_, const char *regex_)
297301

298302
key_regexp = (regex_t*)xmalloc(sizeof(regex_t));
299303
if (regcomp(key_regexp, key, REG_EXTENDED)) {
300-
error("invalid key pattern: %s", key_);
304+
error(_("invalid key pattern: %s"), key_);
301305
FREE_AND_NULL(key_regexp);
302306
ret = CONFIG_INVALID_PATTERN;
303307
goto free_strings;
@@ -317,7 +321,7 @@ static int get_value(const char *key_, const char *regex_)
317321

318322
regexp = (regex_t*)xmalloc(sizeof(regex_t));
319323
if (regcomp(regexp, regex_, REG_EXTENDED)) {
320-
error("invalid pattern: %s", regex_);
324+
error(_("invalid pattern: %s"), regex_);
321325
FREE_AND_NULL(regexp);
322326
ret = CONFIG_INVALID_PATTERN;
323327
goto free_strings;
@@ -390,7 +394,7 @@ static char *normalize_value(const char *key, const char *value)
390394
if (type == TYPE_COLOR) {
391395
char v[COLOR_MAXLEN];
392396
if (git_config_color(v, key, value))
393-
die("cannot parse color '%s'", value);
397+
die(_("cannot parse color '%s'"), value);
394398

395399
/*
396400
* The contents of `v` now contain an ANSI escape
@@ -485,13 +489,13 @@ static int get_colorbool(const char *var, int print)
485489
static void check_write(void)
486490
{
487491
if (!given_config_source.file && !startup_info->have_repository)
488-
die("not in a git directory");
492+
die(_("not in a git directory"));
489493

490494
if (given_config_source.use_stdin)
491-
die("writing to stdin is not supported");
495+
die(_("writing to stdin is not supported"));
492496

493497
if (given_config_source.blob)
494-
die("writing config blobs is not supported");
498+
die(_("writing config blobs is not supported"));
495499
}
496500

497501
struct urlmatch_current_candidate_value {
@@ -599,7 +603,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
599603

600604
if (use_global_config + use_system_config + use_local_config +
601605
!!given_config_source.file + !!given_config_source.blob > 1) {
602-
error("only one config file at a time.");
606+
error(_("only one config file at a time"));
603607
usage_builtin_config();
604608
}
605609

@@ -626,7 +630,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
626630
* location; error out even if XDG_CONFIG_HOME
627631
* is set and points at a sane location.
628632
*/
629-
die("$HOME not set");
633+
die(_("$HOME not set"));
630634

631635
if (access_or_warn(user_config, R_OK, 0) &&
632636
xdg_config && !access_or_warn(xdg_config, R_OK, 0)) {
@@ -663,12 +667,12 @@ int cmd_config(int argc, const char **argv, const char *prefix)
663667
}
664668

665669
if ((actions & (ACTION_GET_COLOR|ACTION_GET_COLORBOOL)) && type) {
666-
error("--get-color and variable type are incoherent");
670+
error(_("--get-color and variable type are incoherent"));
667671
usage_builtin_config();
668672
}
669673

670674
if (HAS_MULTI_BITS(actions)) {
671-
error("only one action at a time.");
675+
error(_("only one action at a time"));
672676
usage_builtin_config();
673677
}
674678
if (actions == 0)
@@ -681,19 +685,19 @@ int cmd_config(int argc, const char **argv, const char *prefix)
681685
}
682686
if (omit_values &&
683687
!(actions == ACTION_LIST || actions == ACTION_GET_REGEXP)) {
684-
error("--name-only is only applicable to --list or --get-regexp");
688+
error(_("--name-only is only applicable to --list or --get-regexp"));
685689
usage_builtin_config();
686690
}
687691

688692
if (show_origin && !(actions &
689693
(ACTION_GET|ACTION_GET_ALL|ACTION_GET_REGEXP|ACTION_LIST))) {
690-
error("--show-origin is only applicable to --get, --get-all, "
691-
"--get-regexp, and --list.");
694+
error(_("--show-origin is only applicable to --get, --get-all, "
695+
"--get-regexp, and --list"));
692696
usage_builtin_config();
693697
}
694698

695699
if (default_value && !(actions & ACTION_GET)) {
696-
error("--default is only applicable to --get");
700+
error(_("--default is only applicable to --get"));
697701
usage_builtin_config();
698702
}
699703

@@ -706,22 +710,22 @@ int cmd_config(int argc, const char **argv, const char *prefix)
706710
&given_config_source,
707711
&config_options) < 0) {
708712
if (given_config_source.file)
709-
die_errno("unable to read config file '%s'",
713+
die_errno(_("unable to read config file '%s'"),
710714
given_config_source.file);
711715
else
712-
die("error processing config file(s)");
716+
die(_("error processing config file(s)"));
713717
}
714718
}
715719
else if (actions == ACTION_EDIT) {
716720
char *config_file;
717721

718722
check_argc(argc, 0, 0);
719723
if (!given_config_source.file && nongit)
720-
die("not in a git directory");
724+
die(_("not in a git directory"));
721725
if (given_config_source.use_stdin)
722-
die("editing stdin is not supported");
726+
die(_("editing stdin is not supported"));
723727
if (given_config_source.blob)
724-
die("editing blobs is not supported");
728+
die(_("editing blobs is not supported"));
725729
git_config(git_default_config, NULL);
726730
config_file = given_config_source.file ?
727731
xstrdup(given_config_source.file) :
@@ -822,7 +826,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
822826
if (ret < 0)
823827
return ret;
824828
if (ret == 0)
825-
die("No such section!");
829+
die(_("no such section: %s"), argv[0]);
826830
}
827831
else if (actions == ACTION_REMOVE_SECTION) {
828832
int ret;
@@ -833,7 +837,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
833837
if (ret < 0)
834838
return ret;
835839
if (ret == 0)
836-
die("No such section!");
840+
die(_("no such section: %s"), argv[0]);
837841
}
838842
else if (actions == ACTION_GET_COLOR) {
839843
check_argc(argc, 1, 2);

0 commit comments

Comments
 (0)