git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 24/25] gettextize: git-status basic messages
Date: Thu,  2 Sep 2010 19:40:45 +0000	[thread overview]
Message-ID: <1283456446-22577-25-git-send-email-avarab@gmail.com> (raw)
In-Reply-To: <1283373845-2022-1-git-send-email-avarab@gmail.com>

Ripped out as-is from the "Add initial C, Shell and Perl gettext
translations" patch that was part of the gettext RFC for a long time
and has already been reviewed by a lot of eyeballs.

The only change is the removal of two messages that didn't really
belong: _("#\t") and _("%-20s%s\n").

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 wt-status.c |  102 +++++++++++++++++++++++++++++-----------------------------
 1 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index 7716dd9..1c1a575 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -54,16 +54,16 @@ static void wt_status_print_unmerged_header(struct wt_status *s)
 {
 	const char *c = color(WT_STATUS_HEADER, s);
 
-	color_fprintf_ln(s->fp, c, "# Unmerged paths:");
+	color_fprintf_ln(s->fp, c, _("# Unmerged paths:"));
 	if (!advice_status_hints)
 		return;
 	if (s->in_merge)
 		;
 	else if (!s->is_initial)
-		color_fprintf_ln(s->fp, c, "#   (use \"git reset %s <file>...\" to unstage)", s->reference);
+		color_fprintf_ln(s->fp, c, _("#   (use \"git reset %s <file>...\" to unstage)"), s->reference);
 	else
-		color_fprintf_ln(s->fp, c, "#   (use \"git rm --cached <file>...\" to unstage)");
-	color_fprintf_ln(s->fp, c, "#   (use \"git add/rm <file>...\" as appropriate to mark resolution)");
+		color_fprintf_ln(s->fp, c, _("#   (use \"git rm --cached <file>...\" to unstage)"));
+	color_fprintf_ln(s->fp, c, _("#   (use \"git add/rm <file>...\" as appropriate to mark resolution)"));
 	color_fprintf_ln(s->fp, c, "#");
 }
 
@@ -71,15 +71,15 @@ static void wt_status_print_cached_header(struct wt_status *s)
 {
 	const char *c = color(WT_STATUS_HEADER, s);
 
-	color_fprintf_ln(s->fp, c, "# Changes to be committed:");
+	color_fprintf_ln(s->fp, c, _("# Changes to be committed:"));
 	if (!advice_status_hints)
 		return;
 	if (s->in_merge)
 		; /* NEEDSWORK: use "git reset --unresolve"??? */
 	else if (!s->is_initial)
-		color_fprintf_ln(s->fp, c, "#   (use \"git reset %s <file>...\" to unstage)", s->reference);
+		color_fprintf_ln(s->fp, c, _("#   (use \"git reset %s <file>...\" to unstage)"), s->reference);
 	else
-		color_fprintf_ln(s->fp, c, "#   (use \"git rm --cached <file>...\" to unstage)");
+		color_fprintf_ln(s->fp, c, _("#   (use \"git rm --cached <file>...\" to unstage)"));
 	color_fprintf_ln(s->fp, c, "#");
 }
 
@@ -89,16 +89,16 @@ static void wt_status_print_dirty_header(struct wt_status *s,
 {
 	const char *c = color(WT_STATUS_HEADER, s);
 
-	color_fprintf_ln(s->fp, c, "# Changed but not updated:");
+	color_fprintf_ln(s->fp, c, _("# Changed but not updated:"));
 	if (!advice_status_hints)
 		return;
 	if (!has_deleted)
-		color_fprintf_ln(s->fp, c, "#   (use \"git add <file>...\" to update what will be committed)");
+		color_fprintf_ln(s->fp, c, _("#   (use \"git add <file>...\" to update what will be committed)"));
 	else
-		color_fprintf_ln(s->fp, c, "#   (use \"git add/rm <file>...\" to update what will be committed)");
-	color_fprintf_ln(s->fp, c, "#   (use \"git checkout -- <file>...\" to discard changes in working directory)");
+		color_fprintf_ln(s->fp, c, _("#   (use \"git add/rm <file>...\" to update what will be committed)"));
+	color_fprintf_ln(s->fp, c, _("#   (use \"git checkout -- <file>...\" to discard changes in working directory)"));
 	if (has_dirty_submodules)
-		color_fprintf_ln(s->fp, c, "#   (commit or discard the untracked or modified content in submodules)");
+		color_fprintf_ln(s->fp, c, _("#   (commit or discard the untracked or modified content in submodules)"));
 	color_fprintf_ln(s->fp, c, "#");
 }
 
@@ -107,10 +107,10 @@ static void wt_status_print_other_header(struct wt_status *s,
 					 const char *how)
 {
 	const char *c = color(WT_STATUS_HEADER, s);
-	color_fprintf_ln(s->fp, c, "# %s files:", what);
+	color_fprintf_ln(s->fp, c, _("# %s files:"), what);
 	if (!advice_status_hints)
 		return;
-	color_fprintf_ln(s->fp, c, "#   (use \"git %s <file>...\" to include in what will be committed)", how);
+	color_fprintf_ln(s->fp, c, _("#   (use \"git %s <file>...\" to include in what will be committed)"), how);
 	color_fprintf_ln(s->fp, c, "#");
 }
 
@@ -127,18 +127,18 @@ static void wt_status_print_unmerged_data(struct wt_status *s,
 	const char *c = color(WT_STATUS_UNMERGED, s);
 	struct wt_status_change_data *d = it->util;
 	struct strbuf onebuf = STRBUF_INIT;
-	const char *one, *how = "bug";
+	const char *one, *how = _("bug");
 
 	one = quote_path(it->string, -1, &onebuf, s->prefix);
 	color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "#\t");
 	switch (d->stagemask) {
-	case 1: how = "both deleted:"; break;
-	case 2: how = "added by us:"; break;
-	case 3: how = "deleted by them:"; break;
-	case 4: how = "added by them:"; break;
-	case 5: how = "deleted by us:"; break;
-	case 6: how = "both added:"; break;
-	case 7: how = "both modified:"; break;
+	case 1: how = _("both deleted:"); break;
+	case 2: how = _("added by us:"); break;
+	case 3: how = _("deleted by them:"); break;
+	case 4: how = _("added by them:"); break;
+	case 5: how = _("deleted by us:"); break;
+	case 6: how = _("both added:"); break;
+	case 7: how = _("both modified:"); break;
 	}
 	color_fprintf(s->fp, c, "%-20s%s\n", how, one);
 	strbuf_release(&onebuf);
@@ -168,11 +168,11 @@ static void wt_status_print_change_data(struct wt_status *s,
 		if (d->new_submodule_commits || d->dirty_submodule) {
 			strbuf_addstr(&extra, " (");
 			if (d->new_submodule_commits)
-				strbuf_addf(&extra, "new commits, ");
+				strbuf_addf(&extra, _("new commits, "));
 			if (d->dirty_submodule & DIRTY_SUBMODULE_MODIFIED)
-				strbuf_addf(&extra, "modified content, ");
+				strbuf_addf(&extra, _("modified content, "));
 			if (d->dirty_submodule & DIRTY_SUBMODULE_UNTRACKED)
-				strbuf_addf(&extra, "untracked content, ");
+				strbuf_addf(&extra, _("untracked content, "));
 			strbuf_setlen(&extra, extra.len - 2);
 			strbuf_addch(&extra, ')');
 		}
@@ -186,31 +186,31 @@ static void wt_status_print_change_data(struct wt_status *s,
 	color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "#\t");
 	switch (status) {
 	case DIFF_STATUS_ADDED:
-		color_fprintf(s->fp, c, "new file:   %s", one);
+		color_fprintf(s->fp, c, _("new file:   %s"), one);
 		break;
 	case DIFF_STATUS_COPIED:
-		color_fprintf(s->fp, c, "copied:     %s -> %s", one, two);
+		color_fprintf(s->fp, c, _("copied:     %s -> %s"), one, two);
 		break;
 	case DIFF_STATUS_DELETED:
-		color_fprintf(s->fp, c, "deleted:    %s", one);
+		color_fprintf(s->fp, c, _("deleted:    %s"), one);
 		break;
 	case DIFF_STATUS_MODIFIED:
-		color_fprintf(s->fp, c, "modified:   %s", one);
+		color_fprintf(s->fp, c, _("modified:   %s"), one);
 		break;
 	case DIFF_STATUS_RENAMED:
-		color_fprintf(s->fp, c, "renamed:    %s -> %s", one, two);
+		color_fprintf(s->fp, c, _("renamed:    %s -> %s"), one, two);
 		break;
 	case DIFF_STATUS_TYPE_CHANGED:
-		color_fprintf(s->fp, c, "typechange: %s", one);
+		color_fprintf(s->fp, c, _("typechange: %s"), one);
 		break;
 	case DIFF_STATUS_UNKNOWN:
-		color_fprintf(s->fp, c, "unknown:    %s", one);
+		color_fprintf(s->fp, c, _("unknown:    %s"), one);
 		break;
 	case DIFF_STATUS_UNMERGED:
-		color_fprintf(s->fp, c, "unmerged:   %s", one);
+		color_fprintf(s->fp, c, _("unmerged:   %s"), one);
 		break;
 	default:
-		die("bug: unhandled diff status %c", status);
+		die(_("bug: unhandled diff status %c"), status);
 	}
 	if (extra.len) {
 		color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "%s", extra.buf);
@@ -633,14 +633,14 @@ void wt_status_print(struct wt_status *s)
 	const char *branch_color = color(WT_STATUS_HEADER, s);
 
 	if (s->branch) {
-		const char *on_what = "On branch ";
+		const char *on_what = _("On branch ");
 		const char *branch_name = s->branch;
 		if (!prefixcmp(branch_name, "refs/heads/"))
 			branch_name += 11;
 		else if (!strcmp(branch_name, "HEAD")) {
 			branch_name = "";
 			branch_color = color(WT_STATUS_NOBRANCH, s);
-			on_what = "Not currently on any branch.";
+			on_what = _("Not currently on any branch.");
 		}
 		color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "# ");
 		color_fprintf_ln(s->fp, branch_color, "%s%s", on_what, branch_name);
@@ -650,7 +650,7 @@ void wt_status_print(struct wt_status *s)
 
 	if (s->is_initial) {
 		color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "#");
-		color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "# Initial commit");
+		color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), _("# Initial commit"));
 		color_fprintf_ln(s->fp, color(WT_STATUS_HEADER, s), "#");
 	}
 
@@ -664,38 +664,38 @@ void wt_status_print(struct wt_status *s)
 		wt_status_print_submodule_summary(s, 1);  /* unstaged */
 	}
 	if (s->show_untracked_files) {
-		wt_status_print_other(s, &s->untracked, "Untracked", "add");
+		wt_status_print_other(s, &s->untracked, _("Untracked"), _("add"));
 		if (s->show_ignored_files)
-			wt_status_print_other(s, &s->ignored, "Ignored", "add -f");
+			wt_status_print_other(s, &s->ignored, _("Ignored"), _("add -f"));
 	} else if (s->commitable)
-		fprintf(s->fp, "# Untracked files not listed%s\n",
+		fprintf(s->fp, _("# Untracked files not listed%s\n"),
 			advice_status_hints
-			? " (use -u option to show untracked files)" : "");
+			? _(" (use -u option to show untracked files)") : "");
 
 	if (s->verbose)
 		wt_status_print_verbose(s);
 	if (!s->commitable) {
 		if (s->amend)
-			fprintf(s->fp, "# No changes\n");
+			fprintf(s->fp, _("# No changes\n"));
 		else if (s->nowarn)
 			; /* nothing */
 		else if (s->workdir_dirty)
-			printf("no changes added to commit%s\n",
+			printf(_("no changes added to commit%s\n"),
 				advice_status_hints
-				? " (use \"git add\" and/or \"git commit -a\")" : "");
+				? _(" (use \"git add\" and/or \"git commit -a\")") : "");
 		else if (s->untracked.nr)
-			printf("nothing added to commit but untracked files present%s\n",
+			printf(_("nothing added to commit but untracked files present%s\n"),
 				advice_status_hints
-				? " (use \"git add\" to track)" : "");
+				? _(" (use \"git add\" to track)") : "");
 		else if (s->is_initial)
 			printf("nothing to commit%s\n", advice_status_hints
-				? " (create/copy files and use \"git add\" to track)" : "");
+				? _(" (create/copy files and use \"git add\" to track)") : "");
 		else if (!s->show_untracked_files)
-			printf("nothing to commit%s\n", advice_status_hints
-				? " (use -u to show untracked files)" : "");
+			printf(_("nothing to commit%s\n"), advice_status_hints
+				? _(" (use -u to show untracked files)") : "");
 		else
-			printf("nothing to commit%s\n", advice_status_hints
-				? " (working directory clean)" : "");
+			printf(_("nothing to commit%s\n"), advice_status_hints
+				? _(" (working directory clean)") : "");
 	}
 }
 
-- 
1.7.2.2.614.g1dc9

  parent reply	other threads:[~2010-09-02 19:42 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-01 20:43 [PATCH 00/13] gettextize the first 4 C mainporcelain common commands Ævar Arnfjörð Bjarmason
2010-09-01 20:43 ` [PATCH 01/13] git-clone: use builtin.h to get gettext.h Ævar Arnfjörð Bjarmason
2010-09-01 20:43 ` [PATCH 02/13] gettextize: git-clone basic messages Ævar Arnfjörð Bjarmason
2010-09-01 20:43 ` [PATCH 03/13] gettextize: git-clone "Cloning into" message Ævar Arnfjörð Bjarmason
2010-09-01 20:43 ` [PATCH 04/13] gettextize: git-add basic messages Ævar Arnfjörð Bjarmason
2010-09-01 20:43 ` [PATCH 05/13] gettextize: git-add refresh_index message Ævar Arnfjörð Bjarmason
2010-09-02  4:21   ` Jonathan Nieder
2010-09-01 20:43 ` [PATCH 06/13] gettextize: git-branch basic messages Ævar Arnfjörð Bjarmason
2010-09-01 20:43 ` [PATCH 07/13] gettextize: git-branch "remote branch '%s' not found" message Ævar Arnfjörð Bjarmason
2010-09-01 20:44 ` [PATCH 08/13] gettextize: git-branch "git branch -v" messages Ævar Arnfjörð Bjarmason
2010-09-01 20:44 ` [PATCH 09/13] gettextize: git-branch "(no branch)" message Ævar Arnfjörð Bjarmason
2010-09-01 20:44 ` [PATCH 10/13] gettextize: git-checkout: our/their version message Ævar Arnfjörð Bjarmason
2010-09-01 20:44 ` [PATCH 11/13] gettextize: git-checkout basic messages Ævar Arnfjörð Bjarmason
2010-09-01 20:44 ` [PATCH 12/13] gettextize: git-checkout describe_detached_head messages Ævar Arnfjörð Bjarmason
2010-09-01 20:44 ` [PATCH 13/13] gettextize: git-checkout "Switched to a .. branch" message Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 00/25] [CONTINUED] gettextize all C mainporcelain common commands Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 01/25] gettextize: git-commit basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 02/25] gettextize: git-commit formatting messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 03/25] gettextize: git-commit advice messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 04/25] gettextize: git-diff basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 05/25] gettextize: git-fetch " Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 06/25] gettextize: git-fetch formatting messages Ævar Arnfjörð Bjarmason
2010-09-02 19:59   ` Jonathan Nieder
2010-09-02 20:13     ` Ævar Arnfjörð Bjarmason
2010-09-02 20:28     ` Jeff King
2010-09-02 20:48       ` Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 07/25] gettextize: git-grep basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 08/25] gettextize: git-log " Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 09/25] gettextize: git-format-patch --cover-letter message Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 10/25] gettextize: git-merge basic messages Ævar Arnfjörð Bjarmason
2010-09-02 20:09   ` Jonathan Nieder
2010-09-02 20:30     ` Ævar Arnfjörð Bjarmason
2010-09-02 20:37       ` Jonathan Nieder
2010-09-02 20:54         ` Ævar Arnfjörð Bjarmason
2010-09-02 21:13           ` Jonathan Nieder
2010-09-02 22:45             ` Ævar Arnfjörð Bjarmason
2010-09-02 23:04               ` Jonathan Nieder
2010-09-03 12:13                 ` Ævar Arnfjörð Bjarmason
2010-09-03 17:51                   ` Jonathan Nieder
2010-09-03 18:06                     ` Ævar Arnfjörð Bjarmason
2010-09-03 13:01         ` Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 11/25] gettextize: git-merge "In-index merge" message Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 12/25] gettextize: git-merge "Merge made by %s." message Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 13/25] gettextize: git-merge remaining cmd_merge messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 14/25] gettextize: git-mv basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 15/25] gettextize: git-mv "bad" messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 16/25] gettextize: git-rm basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 17/25] builtin: use builtin.h in git-reset Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 18/25] gettextize: git-reset basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 19/25] gettextize: git-reset reset_type_names messages Ævar Arnfjörð Bjarmason
2010-09-15 11:17   ` Peter Krefting
2010-09-15 15:50     ` Thomas Rast
2010-09-02 19:40 ` [PATCH 20/25] gettextize: git-tag basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 21/25] gettextize: git-tag tag_template message Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 22/25] gettextize: git-push basic messages Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` [PATCH 23/25] builtin: use builtin.h in git-status Ævar Arnfjörð Bjarmason
2010-09-02 19:40 ` Ævar Arnfjörð Bjarmason [this message]
2010-09-02 20:28   ` [PATCH 24/25] gettextize: git-status basic messages Jonathan Nieder
2010-09-02 20:41     ` Ævar Arnfjörð Bjarmason
2010-09-02 20:47       ` Jonathan Nieder
2010-09-02 19:40 ` [PATCH 25/25] gettextize: git-status shortstatus messages Ævar Arnfjörð Bjarmason
2010-09-02 20:25   ` Jonathan Nieder
2010-09-02 20:34     ` Ævar Arnfjörð Bjarmason

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=1283456446-22577-25-git-send-email-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).