Skip to content

Commit 7478ac5

Browse files
jherlandgitster
authored andcommitted
Mark dirstat error messages for translation
Suggested-by: Junio C Hamano <[email protected]> Signed-off-by: Johan Herland <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 51670fc commit 7478ac5

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

diff.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ static int parse_dirstat_params(struct diff_options *options, const char *params
101101
if (end - p == p_len)
102102
options->dirstat_permille = permille;
103103
else {
104-
strbuf_addf(errmsg, " Failed to parse dirstat cut-off percentage '%.*s'\n",
104+
strbuf_addf(errmsg, _(" Failed to parse dirstat cut-off percentage '%.*s'\n"),
105105
p_len, p);
106106
ret++;
107107
}
108108
} else {
109-
strbuf_addf(errmsg, " Unknown dirstat parameter '%.*s'\n",
109+
strbuf_addf(errmsg, _(" Unknown dirstat parameter '%.*s'\n"),
110110
p_len, p);
111111
ret++;
112112
}
@@ -202,7 +202,7 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
202202
struct strbuf errmsg = STRBUF_INIT;
203203
default_diff_options.dirstat_permille = diff_dirstat_permille_default;
204204
if (parse_dirstat_params(&default_diff_options, value, &errmsg))
205-
warning("Found errors in 'diff.dirstat' config variable:\n%s",
205+
warning(_("Found errors in 'diff.dirstat' config variable:\n%s"),
206206
errmsg.buf);
207207
strbuf_release(&errmsg);
208208
diff_dirstat_permille_default = default_diff_options.dirstat_permille;
@@ -3260,7 +3260,7 @@ static int parse_dirstat_opt(struct diff_options *options, const char *params)
32603260
{
32613261
struct strbuf errmsg = STRBUF_INIT;
32623262
if (parse_dirstat_params(options, params, &errmsg))
3263-
die("Failed to parse --dirstat/-X option parameter:\n%s",
3263+
die(_("Failed to parse --dirstat/-X option parameter:\n%s"),
32643264
errmsg.buf);
32653265
strbuf_release(&errmsg);
32663266
/*

t/t4047-diff-dirstat.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -943,37 +943,37 @@ test_expect_success '--dirstat=future_param,lines,0 should fail loudly' '
943943
test_must_fail git diff --dirstat=future_param,lines,0 HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&
944944
test_debug "cat actual_error" &&
945945
test_cmp /dev/null actual_diff_dirstat &&
946-
grep -q "future_param" actual_error &&
947-
grep -q "\--dirstat" actual_error
946+
test_i18ngrep -q "future_param" actual_error &&
947+
test_i18ngrep -q "\--dirstat" actual_error
948948
'
949949

950950
test_expect_success '--dirstat=dummy1,cumulative,2dummy should report both unrecognized parameters' '
951951
test_must_fail git diff --dirstat=dummy1,cumulative,2dummy HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&
952952
test_debug "cat actual_error" &&
953953
test_cmp /dev/null actual_diff_dirstat &&
954-
grep -q "dummy1" actual_error &&
955-
grep -q "2dummy" actual_error &&
956-
grep -q "\--dirstat" actual_error
954+
test_i18ngrep -q "dummy1" actual_error &&
955+
test_i18ngrep -q "2dummy" actual_error &&
956+
test_i18ngrep -q "\--dirstat" actual_error
957957
'
958958

959959
test_expect_success 'diff.dirstat=future_param,0,lines should warn, but still work' '
960960
git -c diff.dirstat=future_param,0,lines diff --dirstat HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&
961961
test_debug "cat actual_error" &&
962962
test_cmp expect_diff_dirstat actual_diff_dirstat &&
963-
grep -q "future_param" actual_error &&
964-
grep -q "diff\\.dirstat" actual_error &&
963+
test_i18ngrep -q "future_param" actual_error &&
964+
test_i18ngrep -q "diff\\.dirstat" actual_error &&
965965
966966
git -c diff.dirstat=future_param,0,lines diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M 2>actual_error &&
967967
test_debug "cat actual_error" &&
968968
test_cmp expect_diff_dirstat_M actual_diff_dirstat_M &&
969-
grep -q "future_param" actual_error &&
970-
grep -q "diff\\.dirstat" actual_error &&
969+
test_i18ngrep -q "future_param" actual_error &&
970+
test_i18ngrep -q "diff\\.dirstat" actual_error &&
971971
972972
git -c diff.dirstat=future_param,0,lines diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC 2>actual_error &&
973973
test_debug "cat actual_error" &&
974974
test_cmp expect_diff_dirstat_CC actual_diff_dirstat_CC &&
975-
grep -q "future_param" actual_error &&
976-
grep -q "diff\\.dirstat" actual_error
975+
test_i18ngrep -q "future_param" actual_error &&
976+
test_i18ngrep -q "diff\\.dirstat" actual_error
977977
'
978978

979979
test_done

0 commit comments

Comments
 (0)