Git development
 help / color / mirror / Atom feed
From: Vasco Almeida <vascomalmeida@sapo.pt>
To: git@vger.kernel.org
Cc: "Vasco Almeida" <vascomalmeida@sapo.pt>,
	"Jiang Xin" <worldhello.net@gmail.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Jean-Noël AVILA" <jn.avila@free.fr>
Subject: [PATCH 2/4] i18n: convert mark error messages for translation
Date: Mon, 17 Oct 2016 13:15:27 +0000	[thread overview]
Message-ID: <20161017131529.27856-2-vascomalmeida@sapo.pt> (raw)
In-Reply-To: <20161017131529.27856-1-vascomalmeida@sapo.pt>

Mark error messages about CRLF for translation.

Update test to reflect changes.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 convert.c       | 12 ++++++++----
 t/t0020-crlf.sh |  6 +++++-
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/convert.c b/convert.c
index 077f5e6..0ad39b1 100644
--- 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);
 	}
 }
 
diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh
index f94120a..71350e0 100755
--- a/t/t0020-crlf.sh
+++ b/t/t0020-crlf.sh
@@ -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
 '
 
 
-- 
2.10.1.459.g5fd885d


  reply	other threads:[~2016-10-17 13:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17 13:15 [PATCH 1/4] i18n: apply: mark error message for translation Vasco Almeida
2016-10-17 13:15 ` Vasco Almeida [this message]
2016-10-17 13:15 ` [PATCH 3/4] i18n: credential-cache--daemon: mark advice " Vasco Almeida
2016-10-17 13:15 ` [PATCH 4/4] i18n: diff: mark warnings " Vasco Almeida

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161017131529.27856-2-vascomalmeida@sapo.pt \
    --to=vascomalmeida@sapo.pt \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jn.avila@free.fr \
    --cc=worldhello.net@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox