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>
This commit is contained in:
Vasco Almeida 2016-10-17 13:15:27 +00:00 committed by Junio C Hamano
parent f25dfb5e8d
commit 87cb7845fe
2 changed files with 13 additions and 5 deletions

View File

@ -197,17 +197,21 @@ static void check_safe_crlf(const char *path, enum crlf_action crlf_action,
* CRLFs would not be restored by checkout
*/
if (checksafe == SAFE_CRLF_WARN)
warning("CRLF will be replaced by LF in %s.\nThe file will have its original line endings in your working directory.", path);
warning(_("CRLF will be replaced by LF in %s.\n"
"The file will have its original line"
" endings in your working directory."), path);
else /* i.e. SAFE_CRLF_FAIL */
die("CRLF would be replaced by LF in %s.", path);
die(_("CRLF would be replaced by LF in %s."), path);
} else if (old_stats->lonelf && !new_stats->lonelf ) {
/*
* CRLFs would be added by checkout
*/
if (checksafe == SAFE_CRLF_WARN)
warning("LF will be replaced by CRLF in %s.\nThe file will have its original line endings in your working directory.", path);
warning(_("LF will be replaced by CRLF in %s.\n"
"The file will have its original line"
" endings in your working directory."), path);
else /* i.e. SAFE_CRLF_FAIL */
die("LF would be replaced by CRLF in %s", path);
die(_("LF would be replaced by CRLF in %s"), path);
}
}

View File

@ -83,7 +83,11 @@ test_expect_success 'safecrlf: print warning only once' '
git add doublewarn &&
git commit -m "nowarn" &&
for w in Oh here is CRLFQ in text; do echo $w; done | q_to_cr >doublewarn &&
test $(git add doublewarn 2>&1 | grep "CRLF will be replaced by LF" | wc -l) = 1
git add doublewarn 2>err &&
if test_have_prereq C_LOCALE_OUTPUT
then
test $(grep "CRLF will be replaced by LF" err | wc -l) = 1
fi
'