Mark dirstat error messages for translation
Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johan Herland committed
Apr 29, 2011 at 11:36 UTC
7478ac57c4b5cd589cb134d88e8cd78db1247b30
2 files changed
+15
-15
diff.c
+4
-4
@@ -101,12 +101,12 @@ static int parse_dirstat_params(struct diff_options *options, const char *params
101
if (end - p == p_len)
102
options->dirstat_permille = permille;
103
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"),
105
p_len, p);
106
ret++;
107
}
108
} else {
109
- strbuf_addf(errmsg, " Unknown dirstat parameter '%.*s'\n",
109
+ strbuf_addf(errmsg, _(" Unknown dirstat parameter '%.*s'\n"),
110
p_len, p);
111
ret++;
112
}
@@ -202,7 +202,7 @@ int git_diff_basic_config(const char *var, const char *value, void *cb)
202
struct strbuf errmsg = STRBUF_INIT;
203
default_diff_options.dirstat_permille = diff_dirstat_permille_default;
204
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"),
206
errmsg.buf);
207
strbuf_release(&errmsg);
208
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)
3260
{
3261
struct strbuf errmsg = STRBUF_INIT;
3262
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"),
3264
errmsg.buf);
3265
strbuf_release(&errmsg);
3266
/*
t/t4047-diff-dirstat.sh
+11
-11
@@ -943,37 +943,37 @@ test_expect_success '--dirstat=future_param,lines,0 should fail loudly' '
943
test_must_fail git diff --dirstat=future_param,lines,0 HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&
944
test_debug "cat actual_error" &&
945
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
948
'
949
950
test_expect_success '--dirstat=dummy1,cumulative,2dummy should report both unrecognized parameters' '
951
test_must_fail git diff --dirstat=dummy1,cumulative,2dummy HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&
952
test_debug "cat actual_error" &&
953
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
957
'
958
959
test_expect_success 'diff.dirstat=future_param,0,lines should warn, but still work' '
960
git -c diff.dirstat=future_param,0,lines diff --dirstat HEAD^..HEAD >actual_diff_dirstat 2>actual_error &&
961
test_debug "cat actual_error" &&
962
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 &&
965
966
git -c diff.dirstat=future_param,0,lines diff --dirstat -M HEAD^..HEAD >actual_diff_dirstat_M 2>actual_error &&
967
test_debug "cat actual_error" &&
968
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 &&
971
972
git -c diff.dirstat=future_param,0,lines diff --dirstat -C -C HEAD^..HEAD >actual_diff_dirstat_CC 2>actual_error &&
973
test_debug "cat actual_error" &&
974
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
977
'
978
979
test_done