i18n: convert mark error messages for translation

Mark error messages about CRLF for translation. Update test to reflect changes. Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Vasco Almeida committed Oct 17, 2016 at 13:15 UTC 87cb7845fee4f23434da8b601583dab225dd85d6
2 files changed +13 -5
convert.c
+8 -4
@@ -197,17 +197,21 @@ static void check_safe_crlf(const char *path, enum crlf_action crlf_action,
197 * CRLFs would not be restored by checkout
198 */
199 if (checksafe == SAFE_CRLF_WARN)
200 - warning("CRLF will be replaced by LF in %s.\nThe file will have its original line endings in your working directory.", path);
200 + warning(_("CRLF will be replaced by LF in %s.\n"
201 + "The file will have its original line"
202 + " endings in your working directory."), path);
203 else /* i.e. SAFE_CRLF_FAIL */
202 - die("CRLF would be replaced by LF in %s.", path);
204 + die(_("CRLF would be replaced by LF in %s."), path);
205 } else if (old_stats->lonelf && !new_stats->lonelf ) {
206 /*
207 * CRLFs would be added by checkout
208 */
209 if (checksafe == SAFE_CRLF_WARN)
208 - warning("LF will be replaced by CRLF in %s.\nThe file will have its original line endings in your working directory.", path);
210 + warning(_("LF will be replaced by CRLF in %s.\n"
211 + "The file will have its original line"
212 + " endings in your working directory."), path);
213 else /* i.e. SAFE_CRLF_FAIL */
210 - die("LF would be replaced by CRLF in %s", path);
214 + die(_("LF would be replaced by CRLF in %s"), path);
215 }
216 }
217
t/t0020-crlf.sh
+5 -1
@@ -83,7 +83,11 @@ test_expect_success 'safecrlf: print warning only once' '
83 git add doublewarn &&
84 git commit -m "nowarn" &&
85 for w in Oh here is CRLFQ in text; do echo $w; done | q_to_cr >doublewarn &&
86 - test $(git add doublewarn 2>&1 | grep "CRLF will be replaced by LF" | wc -l) = 1
86 + git add doublewarn 2>err &&
87 + if test_have_prereq C_LOCALE_OUTPUT
88 + then
89 + test $(grep "CRLF will be replaced by LF" err | wc -l) = 1
90 + fi
91 '
92
93