i18n: convert mark error messages for translation
authorVasco Almeida <vascomalmeida@sapo.pt>
Mon, 17 Oct 2016 13:15:27 +0000 (13:15 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Oct 2016 21:51:45 +0000 (14:51 -0700)
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>
convert.c
t/t0020-crlf.sh
index 077f5e601e3283b7b2566bff791290209be4694e..0ad39b16cc40c27ef9af493d95542c52c60439a0 100644 (file)
--- a/convert.c
+++ b/convert.c
@@ -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);
        }
 }
 
index f94120a8940a37c48fbb97abd85002da95e3abe9..71350e0657986d7b3e38801d82058c53f9fd23d0 100755 (executable)
@@ -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
 '