parse-options.c: mark more strings for translation
One error is updated to start with lowercase to be consistent with the rest. 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
Nov 10, 2018 at 06:16 UTC
8900342628c1c0c52dff62edaa2ee73d82287f2d
2 files changed
+9
-9
parse-options.c
+7
-7
@@ -319,8 +319,8 @@ is_abbreviated:
319
}
320
321
if (ambiguous_option) {
322
- error("Ambiguous option: %s "
323
- "(could be --%s%s or --%s%s)",
322
+ error(_("ambiguous option: %s "
323
+ "(could be --%s%s or --%s%s)"),
324
arg,
325
(ambiguous_flags & OPT_UNSET) ? "no-" : "",
326
ambiguous_option->long_name,
@@ -353,7 +353,7 @@ static void check_typos(const char *arg, const struct option *options)
353
return;
354
355
if (starts_with(arg, "no-")) {
356
- error ("did you mean `--%s` (with two dashes ?)", arg);
356
+ error(_("did you mean `--%s` (with two dashes ?)"), arg);
357
exit(129);
358
}
359
@@ -361,7 +361,7 @@ static void check_typos(const char *arg, const struct option *options)
361
if (!options->long_name)
362
continue;
363
if (starts_with(options->long_name, arg)) {
364
- error ("did you mean `--%s` (with two dashes ?)", arg);
364
+ error(_("did you mean `--%s` (with two dashes ?)"), arg);
365
exit(129);
366
}
367
}
@@ -644,11 +644,11 @@ int parse_options(int argc, const char **argv, const char *prefix,
644
break;
645
default: /* PARSE_OPT_UNKNOWN */
646
if (ctx.argv[0][1] == '-') {
647
- error("unknown option `%s'", ctx.argv[0] + 2);
647
+ error(_("unknown option `%s'"), ctx.argv[0] + 2);
648
} else if (isascii(*ctx.opt)) {
649
- error("unknown switch `%c'", *ctx.opt);
649
+ error(_("unknown switch `%c'"), *ctx.opt);
650
} else {
651
- error("unknown non-ascii option in string: `%s'",
651
+ error(_("unknown non-ascii option in string: `%s'"),
652
ctx.argv[0]);
653
}
654
usage_with_options(usagestr, options);
t/t0040-parse-options.sh
+2
-2
@@ -228,7 +228,7 @@ EOF
228
test_expect_success 'detect possible typos' '
229
test_must_fail test-tool parse-options -boolean >output 2>output.err &&
230
test_must_be_empty output &&
231
- test_cmp typo.err output.err
231
+ test_i18ncmp typo.err output.err
232
'
233
234
cat >typo.err <<\EOF
@@ -238,7 +238,7 @@ EOF
238
test_expect_success 'detect possible typos' '
239
test_must_fail test-tool parse-options -ambiguous >output 2>output.err &&
240
test_must_be_empty output &&
241
- test_cmp typo.err output.err
241
+ test_i18ncmp typo.err output.err
242
'
243
244
test_expect_success 'keep some options as arguments' '