git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: pclouds@gmail.com
Cc: git@vger.kernel.org, Eric Sunshine <sunshine@sunshineco.com>
Subject: [PATCH v2 00/23] Mark strings for translation
Date: Sun,  3 Jun 2018 18:33:57 +0200	[thread overview]
Message-ID: <20180603163420.13702-1-pclouds@gmail.com> (raw)
In-Reply-To: <20180602043241.9941-1-pclouds@gmail.com>

v2 changes

- fix one _() (was "()" by accident)
- improve some error messages while i'm making changes
- restore some multi-sentence messages back

All non-_() changes are now collected in the first patch.

Interdiff

diff --git a/builtin/config.c b/builtin/config.c
index 85f043a243..3c26df6c48 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -160,7 +160,11 @@ static struct option builtin_config_options[] = {
 static void check_argc(int argc, int min, int max) {
 	if (argc >= min && argc <= max)
 		return;
-	error(_("wrong number of arguments"));
+	if (min == max)
+		error(_("wrong number of arguments, should be %d"), min);
+	else
+		error(_("wrong number of arguments, should be from %d to %d"),
+		      min, max);
 	usage_with_options(builtin_config_usage, builtin_config_options);
 }
 
@@ -746,7 +750,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 		ret = git_config_set_in_file_gently(given_config_source.file, argv[0], value);
 		if (ret == CONFIG_NOTHING_SET)
 			error(_("cannot overwrite multiple values with a single value\n"
-			"       Use a regexp, --add or --replace-all to change %s"), argv[0]);
+			"       Use a regexp, --add or --replace-all to change %s."), argv[0]);
 		return ret;
 	}
 	else if (actions == ACTION_SET_ALL) {
@@ -819,7 +823,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 		if (ret < 0)
 			return ret;
 		if (ret == 0)
-			die(_("no such section!"));
+			die(_("no such section: %s"), argv[0]);
 	}
 	else if (actions == ACTION_REMOVE_SECTION) {
 		int ret;
@@ -830,7 +834,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 		if (ret < 0)
 			return ret;
 		if (ret == 0)
-			die(_("no such section!"));
+			die(_("no such section: %s"), argv[0]);
 	}
 	else if (actions == ACTION_GET_COLOR) {
 		check_argc(argc, 1, 2);
diff --git a/builtin/replace.c b/builtin/replace.c
index c203534fd3..c77b325aa1 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -171,10 +171,10 @@ static int replace_object_oid(const char *object_ref,
 	obj_type = oid_object_info(the_repository, object, NULL);
 	repl_type = oid_object_info(the_repository, repl, NULL);
 	if (!force && obj_type != repl_type)
-		return error(_("objects must be of the same type.\n"
+		return error(_("Objects must be of the same type.\n"
 			       "'%s' points to a replaced object of type '%s'\n"
 			       "while '%s' points to a replacement object of "
-			       "type '%s'"),
+			       "type '%s'."),
 			     object_ref, type_name(obj_type),
 			     replace_ref, type_name(repl_type));
 
diff --git a/config.c b/config.c
index 80eae290e9..96b6020819 100644
--- a/config.c
+++ b/config.c
@@ -461,7 +461,7 @@ int git_config_from_parameters(config_fn_t fn, void *data)
 	envw = xstrdup(env);
 
 	if (sq_dequote_to_argv(envw, &argv, &nr, &alloc) < 0) {
-		ret = error(("bogus format in %s"), CONFIG_DATA_ENVIRONMENT);
+		ret = error(_("bogus format in %s"), CONFIG_DATA_ENVIRONMENT);
 		goto out;
 	}
 
diff --git a/connect.c b/connect.c
index af8a581d0e..70b97cfef6 100644
--- a/connect.c
+++ b/connect.c
@@ -60,7 +60,7 @@ static NORETURN void die_initial_contact(int unexpected)
 	if (unexpected)
 		die(_("the remote end hung up upon initial contact"));
 	else
-		die(_("could not read from remote repository.\n\n"
+		die(_("Could not read from remote repository.\n\n"
 		      "Please make sure you have the correct access rights\n"
 		      "and the repository exists."));
 }
@@ -928,7 +928,7 @@ static enum protocol parse_connect_url(const char *url_orig, char **ret_host,
 		path = strchr(end, separator);
 
 	if (!path || !*path)
-		die(_("no path specified. See 'man git-pull' for valid url syntax"));
+		die(_("no path specified; see 'git help pull' for valid url syntax"));
 
 	/*
 	 * null-terminate hostname and point path to ~ for URL's like this:
diff --git a/dir.c b/dir.c
index 848df83321..8e7fa02a01 100644
--- a/dir.c
+++ b/dir.c
@@ -560,7 +560,7 @@ int report_path_error(const char *ps_matched,
 		if (found_dup)
 			continue;
 
-		error(_("pathspec '%s' did not match any file(s) known to git."),
+		error(_("pathspec '%s' did not match any file(s) known to git"),
 		      pathspec->items[num].original);
 		errors++;
 	}
diff --git a/refs.c b/refs.c
index 88b60ac1c6..becb78e441 100644
--- a/refs.c
+++ b/refs.c
@@ -567,9 +567,9 @@ int expand_ref(const char *str, int len, struct object_id *oid, char **ref)
 			if (!warn_ambiguous_refs)
 				break;
 		} else if ((flag & REF_ISSYMREF) && strcmp(fullref.buf, "HEAD")) {
-			warning(_("ignoring dangling symref %s."), fullref.buf);
+			warning(_("ignoring dangling symref %s"), fullref.buf);
 		} else if ((flag & REF_ISBROKEN) && strchr(fullref.buf, '/')) {
-			warning(_("ignoring broken ref %s."), fullref.buf);
+			warning(_("ignoring broken ref %s"), fullref.buf);
 		}
 	}
 	strbuf_release(&fullref);
@@ -1845,7 +1845,7 @@ int ref_update_reject_duplicates(struct string_list *refnames,
 
 		if (!cmp) {
 			strbuf_addf(err,
-				    _("multiple updates for ref '%s' not allowed."),
+				    _("multiple updates for ref '%s' not allowed"),
 				    refnames->items[i].string);
 			return 1;
 		} else if (cmp > 0) {
diff --git a/sequencer.c b/sequencer.c
index 1802b49626..01f3afe7f4 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -304,7 +304,7 @@ static const char *action_name(const struct replay_opts *opts)
 	case REPLAY_INTERACTIVE_REBASE:
 		return N_("rebase -i");
 	}
-	die(_("Unknown action: %d"), opts->action);
+	die(_("unknown action: %d"), opts->action);
 }
 
 struct commit_message {
diff --git a/sha1-file.c b/sha1-file.c
index ab055181ec..a0ce97b10b 100644
--- a/sha1-file.c
+++ b/sha1-file.c
@@ -71,17 +71,17 @@ static void git_hash_sha1_final(unsigned char *hash, git_hash_ctx *ctx)
 
 static void git_hash_unknown_init(git_hash_ctx *ctx)
 {
-	die(_("trying to init unknown hash"));
+	BUG("trying to init unknown hash");
 }
 
 static void git_hash_unknown_update(git_hash_ctx *ctx, const void *data, size_t len)
 {
-	die(_("trying to update unknown hash"));
+	BUG("trying to update unknown hash");
 }
 
 static void git_hash_unknown_final(unsigned char *hash, git_hash_ctx *ctx)
 {
-	die(_("trying to finalize unknown hash"));
+	BUG("trying to finalize unknown hash");
 }
 
 const struct git_hash_algo hash_algos[GIT_HASH_NALGOS] = {
@@ -379,7 +379,7 @@ static int alt_odb_usable(struct raw_object_store *o,
 	/* Detect cases where alternate disappeared */
 	if (!is_directory(path->buf)) {
 		error(_("object directory %s does not exist; "
-			"check .git/objects/info/alternates."),
+			"check .git/objects/info/alternates"),
 		      path->buf);
 		return 0;
 	}
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index 2a0007a985..7c8df20955 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -650,7 +650,7 @@ test_expect_success 'stdin fails with duplicate refs' '
 	create $a $m
 	EOF
 	test_must_fail git update-ref --stdin <stdin 2>err &&
-	test_i18ngrep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed." err
+	test_i18ngrep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err
 '
 
 test_expect_success 'stdin create ref works' '
@@ -1052,7 +1052,7 @@ test_expect_success 'stdin -z fails option with unknown name' '
 test_expect_success 'stdin -z fails with duplicate refs' '
 	printf $F "create $a" "$m" "create $b" "$m" "create $a" "$m" >stdin &&
 	test_must_fail git update-ref -z --stdin <stdin 2>err &&
-	test_i18ngrep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed." err
+	test_i18ngrep "fatal: multiple updates for ref '"'"'$a'"'"' not allowed" err
 '
 
 test_expect_success 'stdin -z create ref works' '
diff --git a/t/t3005-ls-files-relative.sh b/t/t3005-ls-files-relative.sh
index cd63ad129a..209b4c7cd8 100755
--- a/t/t3005-ls-files-relative.sh
+++ b/t/t3005-ls-files-relative.sh
@@ -44,7 +44,7 @@ test_expect_success 'ls-files -c' '
 		cd top/sub &&
 		for f in ../y*
 		do
-			echo "error: pathspec $sq$f$sq did not match any file(s) known to git."
+			echo "error: pathspec $sq$f$sq did not match any file(s) known to git"
 		done >expect.err &&
 		echo "Did you forget to ${sq}git add${sq}?" >>expect.err &&
 		ls ../x* >expect.out &&
@@ -59,7 +59,7 @@ test_expect_success 'ls-files -o' '
 		cd top/sub &&
 		for f in ../x*
 		do
-			echo "error: pathspec $sq$f$sq did not match any file(s) known to git."
+			echo "error: pathspec $sq$f$sq did not match any file(s) known to git"
 		done >expect.err &&
 		echo "Did you forget to ${sq}git add${sq}?" >>expect.err &&
 		ls ../y* >expect.out &&
diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh
index 051d2659ae..6a949484d0 100755
--- a/t/t5512-ls-remote.sh
+++ b/t/t5512-ls-remote.sh
@@ -130,7 +130,7 @@ test_expect_success 'confuses pattern as remote when no remote specified' '
 	fi &&
 	cat >exp <<-EOF &&
 	fatal: '\''$does_not_exist'\'' does not appear to be a git repository
-	fatal: could not read from remote repository.
+	fatal: Could not read from remote repository.
 
 	Please make sure you have the correct access rights
 	and the repository exists.
diff --git a/transport-helper.c b/transport-helper.c
index 442acec4f4..84a10661cc 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -196,8 +196,8 @@ static struct child_process *get_helper(struct transport *transport)
 		} else if (starts_with(capname, "no-private-update")) {
 			data->no_private_update = 1;
 		} else if (mandatory) {
-			die(_("Unknown mandatory capability %s. This remote "
-			      "helper probably needs newer version of Git."),
+			die(_("unknown mandatory capability %s; this remote "
+			      "helper probably needs newer version of Git"),
 			    capname);
 		}
 	}

Nguyễn Thái Ngọc Duy (23):
  Update messages in preparation for i18n
  archive-tar.c: mark more strings for translation
  archive-zip.c: mark more strings for translation
  builtin/config.c: mark more strings for translation
  builtin/grep.c: mark strings for translation and no full stops
  builtin/pack-objects.c: mark more strings for translation
  builtin/replace.c: mark more strings for translation
  commit-graph.c: mark more strings for translation
  config.c: mark more strings for translation
  connect.c: mark more strings for translation
  convert.c: mark more strings for translation
  dir.c: mark more strings for translation
  environment.c: mark more strings for translation
  exec-cmd.c: mark more strings for translation
  object.c: mark more strings for translation
  pkt-line.c: mark more strings for translation
  refs.c: mark more strings for translation
  refspec.c: mark more strings for translation
  replace-object.c: mark more strings for translation
  sequencer.c: mark more strings for translation
  sha1-file.c: mark more strings for translation
  transport.c: mark more strings for translation
  transport-helper.c: mark more strings for translation

 archive-tar.c                         |  12 +--
 archive-zip.c                         |  14 ++--
 builtin/config.c                      |  50 ++++++------
 builtin/grep.c                        |  12 +--
 builtin/pack-objects.c                | 108 ++++++++++++-------------
 builtin/replace.c                     |  90 ++++++++++-----------
 commit-graph.c                        |  20 ++---
 config.c                              |  76 +++++++++---------
 connect.c                             |  85 +++++++++++---------
 convert.c                             |  42 +++++-----
 dir.c                                 |   8 +-
 environment.c                         |   4 +-
 exec-cmd.c                            |   2 +-
 object.c                              |  10 +--
 pkt-line.c                            |  26 +++---
 refs.c                                |  40 +++++-----
 refspec.c                             |   2 +-
 replace-object.c                      |   6 +-
 sequencer.c                           |  28 ++++---
 sha1-file.c                           | 110 +++++++++++++-------------
 t/t0021-conversion.sh                 |   2 +-
 t/t1305-config-include.sh             |   2 +-
 t/t1308-config-set.sh                 |   2 +-
 t/t1400-update-ref.sh                 |  20 ++---
 t/t1404-update-ref-errors.sh          |   4 +-
 t/t1450-fsck.sh                       |   2 +-
 t/t3005-ls-files-relative.sh          |   8 +-
 t/t3210-pack-refs.sh                  |   2 +-
 t/t3310-notes-merge-manual-resolve.sh |   6 +-
 t/t5500-fetch-pack.sh                 |   2 +-
 t/t5505-remote.sh                     |   2 +-
 t/t5570-git-daemon.sh                 |   6 +-
 t/t5801-remote-helpers.sh             |   8 +-
 t/t7063-status-untracked-cache.sh     |   2 +-
 t/t7400-submodule-basic.sh            |   2 +-
 transport-helper.c                    |  89 ++++++++++-----------
 transport.c                           |  18 ++---
 37 files changed, 470 insertions(+), 452 deletions(-)

-- 
2.18.0.rc0.333.g22e6ee6cdf


  parent reply	other threads:[~2018-06-03 16:34 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-02  4:32 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
2018-06-02  4:32 ` [PATCH 01/22] archive-tar.c: mark " Nguyễn Thái Ngọc Duy
2018-06-02  4:32 ` [PATCH 02/22] archive-zip.c: " Nguyễn Thái Ngọc Duy
2018-06-02  6:17   ` Duy Nguyen
2018-06-03 18:27     ` brian m. carlson
2018-06-02  4:32 ` [PATCH 03/22] builtin/config.c: " Nguyễn Thái Ngọc Duy
2018-06-03  9:01   ` Eric Sunshine
2018-06-03 15:00     ` Duy Nguyen
2018-06-02  4:32 ` [PATCH 04/22] builtin/grep.c: mark strings for translation and no full stops Nguyễn Thái Ngọc Duy
2018-06-02  4:32 ` [PATCH 05/22] builtin/pack-objects.c: mark more strings for translation Nguyễn Thái Ngọc Duy
2018-06-02  4:32 ` [PATCH 06/22] builtin/replace.c: " Nguyễn Thái Ngọc Duy
2018-06-03  8:41   ` Eric Sunshine
2018-06-02  4:32 ` [PATCH 07/22] commit-graph.c: " Nguyễn Thái Ngọc Duy
2018-06-02  4:32 ` [PATCH 08/22] config.c: " Nguyễn Thái Ngọc Duy
2018-06-03  8:51   ` Eric Sunshine
2018-06-02  4:32 ` [PATCH 09/22] connect.c: " Nguyễn Thái Ngọc Duy
2018-06-03  8:55   ` Eric Sunshine
2018-06-02  4:32 ` [PATCH 10/22] convert.c: " Nguyễn Thái Ngọc Duy
2018-06-03  8:46   ` Eric Sunshine
2018-06-02  4:32 ` [PATCH 11/22] dir.c: " Nguyễn Thái Ngọc Duy
2018-06-03  8:47   ` Eric Sunshine
2018-06-02  4:32 ` [PATCH 12/22] environment.c: " Nguyễn Thái Ngọc Duy
2018-06-02  4:32 ` [PATCH 13/22] exec-cmd.c: " Nguyễn Thái Ngọc Duy
2018-06-02  4:32 ` [PATCH 14/22] object.c: " Nguyễn Thái Ngọc Duy
2018-06-02  4:32 ` [PATCH 15/22] pkt-line.c: " Nguyễn Thái Ngọc Duy
2018-06-02  4:32 ` [PATCH 16/22] refs.c: " Nguyễn Thái Ngọc Duy
2018-06-03  8:08   ` Eric Sunshine
2018-06-02  4:32 ` [PATCH 17/22] refspec.c: " Nguyễn Thái Ngọc Duy
2018-06-02  4:32 ` [PATCH 18/22] replace-object.c: " Nguyễn Thái Ngọc Duy
2018-06-02  4:32 ` [PATCH 19/22] sequencer.c: " Nguyễn Thái Ngọc Duy
2018-06-03  8:16   ` Eric Sunshine
2018-06-03 15:14     ` Duy Nguyen
2018-06-03 18:27       ` Eric Sunshine
2018-06-02  4:32 ` [PATCH 20/22] sha1-file.c: " Nguyễn Thái Ngọc Duy
2018-06-03  8:13   ` Eric Sunshine
2018-06-02  4:32 ` [PATCH 21/22] transport.c: " Nguyễn Thái Ngọc Duy
2018-06-03  8:29   ` Eric Sunshine
2018-06-03 15:17     ` Duy Nguyen
2018-06-02  4:32 ` [PATCH 22/22] transport-helper.c: " Nguyễn Thái Ngọc Duy
2018-06-03  8:32   ` Eric Sunshine
2018-06-03 16:33 ` Nguyễn Thái Ngọc Duy [this message]
2018-06-03 16:33   ` [PATCH v2 01/23] Update messages in preparation for i18n Nguyễn Thái Ngọc Duy
2018-06-03 16:33   ` [PATCH v2 02/23] archive-tar.c: mark more strings for translation Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 03/23] archive-zip.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 04/23] builtin/config.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 05/23] builtin/grep.c: mark strings for translation and no full stops Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 06/23] builtin/pack-objects.c: mark more strings for translation Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 07/23] builtin/replace.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 08/23] commit-graph.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 09/23] config.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 10/23] connect.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 11/23] convert.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 12/23] dir.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 13/23] environment.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 14/23] exec-cmd.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 15/23] object.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 16/23] pkt-line.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 17/23] refs.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 18/23] refspec.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 19/23] replace-object.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 20/23] sequencer.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 21/23] sha1-file.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 22/23] transport.c: " Nguyễn Thái Ngọc Duy
2018-06-03 16:34   ` [PATCH v2 23/23] transport-helper.c: " Nguyễn Thái Ngọc Duy
  -- strict thread matches above, loose matches on Subject: below --
2018-07-18 16:10 [PATCH v2 00/23] Mark " Nguyễn Thái Ngọc Duy

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=20180603163420.13702-1-pclouds@gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sunshine@sunshineco.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).