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: git@vger.kernel.org
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 03/22] builtin/config.c: mark more strings for translation
Date: Sat,  2 Jun 2018 06:32:22 +0200	[thread overview]
Message-ID: <20180602043241.9941-4-pclouds@gmail.com> (raw)
In-Reply-To: <20180602043241.9941-1-pclouds@gmail.com>

There are also some minor adjustments in the strings.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin/config.c      | 48 +++++++++++++++++++++----------------------
 t/t1308-config-set.sh |  2 +-
 2 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/builtin/config.c b/builtin/config.c
index b29d26dede..85f043a243 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -110,7 +110,7 @@ static int option_parse_type(const struct option *opt, const char *arg,
 		 * --int' and '--type=bool
 		 * --type=int'.
 		 */
-		error("only one type at a time.");
+		error(_("only one type at a time"));
 		usage_with_options(builtin_config_usage,
 			builtin_config_options);
 	}
@@ -160,7 +160,7 @@ 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");
+	error(_("wrong number of arguments"));
 	usage_with_options(builtin_config_usage, builtin_config_options);
 }
 
@@ -293,7 +293,7 @@ static int get_value(const char *key_, const char *regex_)
 
 		key_regexp = (regex_t*)xmalloc(sizeof(regex_t));
 		if (regcomp(key_regexp, key, REG_EXTENDED)) {
-			error("invalid key pattern: %s", key_);
+			error(_("invalid key pattern: %s"), key_);
 			FREE_AND_NULL(key_regexp);
 			ret = CONFIG_INVALID_PATTERN;
 			goto free_strings;
@@ -313,7 +313,7 @@ static int get_value(const char *key_, const char *regex_)
 
 		regexp = (regex_t*)xmalloc(sizeof(regex_t));
 		if (regcomp(regexp, regex_, REG_EXTENDED)) {
-			error("invalid pattern: %s", regex_);
+			error(_("invalid pattern: %s"), regex_);
 			FREE_AND_NULL(regexp);
 			ret = CONFIG_INVALID_PATTERN;
 			goto free_strings;
@@ -386,7 +386,7 @@ static char *normalize_value(const char *key, const char *value)
 	if (type == TYPE_COLOR) {
 		char v[COLOR_MAXLEN];
 		if (git_config_color(v, key, value))
-			die("cannot parse color '%s'", value);
+			die(_("cannot parse color '%s'"), value);
 
 		/*
 		 * The contents of `v` now contain an ANSI escape
@@ -481,13 +481,13 @@ static int get_colorbool(const char *var, int print)
 static void check_write(void)
 {
 	if (!given_config_source.file && !startup_info->have_repository)
-		die("not in a git directory");
+		die(_("not in a git directory"));
 
 	if (given_config_source.use_stdin)
-		die("writing to stdin is not supported");
+		die(_("writing to stdin is not supported"));
 
 	if (given_config_source.blob)
-		die("writing config blobs is not supported");
+		die(_("writing config blobs is not supported"));
 }
 
 struct urlmatch_current_candidate_value {
@@ -595,7 +595,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 
 	if (use_global_config + use_system_config + use_local_config +
 	    !!given_config_source.file + !!given_config_source.blob > 1) {
-		error("only one config file at a time.");
+		error(_("only one config file at a time"));
 		usage_with_options(builtin_config_usage, builtin_config_options);
 	}
 
@@ -622,7 +622,7 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 			 * location; error out even if XDG_CONFIG_HOME
 			 * is set and points at a sane location.
 			 */
-			die("$HOME not set");
+			die(_("$HOME is not set"));
 
 		if (access_or_warn(user_config, R_OK, 0) &&
 		    xdg_config && !access_or_warn(xdg_config, R_OK, 0)) {
@@ -659,12 +659,12 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 	}
 
 	if ((actions & (ACTION_GET_COLOR|ACTION_GET_COLORBOOL)) && type) {
-		error("--get-color and variable type are incoherent");
+		error(_("--get-color and variable type are incoherent"));
 		usage_with_options(builtin_config_usage, builtin_config_options);
 	}
 
 	if (HAS_MULTI_BITS(actions)) {
-		error("only one action at a time.");
+		error(_("only one action at a time"));
 		usage_with_options(builtin_config_usage, builtin_config_options);
 	}
 	if (actions == 0)
@@ -677,19 +677,19 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 		}
 	if (omit_values &&
 	    !(actions == ACTION_LIST || actions == ACTION_GET_REGEXP)) {
-		error("--name-only is only applicable to --list or --get-regexp");
+		error(_("--name-only is only applicable to --list or --get-regexp"));
 		usage_with_options(builtin_config_usage, builtin_config_options);
 	}
 
 	if (show_origin && !(actions &
 		(ACTION_GET|ACTION_GET_ALL|ACTION_GET_REGEXP|ACTION_LIST))) {
-		error("--show-origin is only applicable to --get, --get-all, "
-			  "--get-regexp, and --list.");
+		error(_("--show-origin is only applicable to --get, --get-all, "
+			"--get-regexp, and --list"));
 		usage_with_options(builtin_config_usage, builtin_config_options);
 	}
 
 	if (default_value && !(actions & ACTION_GET)) {
-		error("--default is only applicable to --get");
+		error(_("--default is only applicable to --get"));
 		usage_with_options(builtin_config_usage,
 			builtin_config_options);
 	}
@@ -703,10 +703,10 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 					&given_config_source,
 					&config_options) < 0) {
 			if (given_config_source.file)
-				die_errno("unable to read config file '%s'",
+				die_errno(_("unable to read config file '%s'"),
 					  given_config_source.file);
 			else
-				die("error processing config file(s)");
+				die(_("error processing config file(s)"));
 		}
 	}
 	else if (actions == ACTION_EDIT) {
@@ -714,11 +714,11 @@ int cmd_config(int argc, const char **argv, const char *prefix)
 
 		check_argc(argc, 0, 0);
 		if (!given_config_source.file && nongit)
-			die("not in a git directory");
+			die(_("not in a git directory"));
 		if (given_config_source.use_stdin)
-			die("editing stdin is not supported");
+			die(_("editing stdin is not supported"));
 		if (given_config_source.blob)
-			die("editing blobs is not supported");
+			die(_("editing blobs is not supported"));
 		git_config(git_default_config, NULL);
 		config_file = given_config_source.file ?
 				xstrdup(given_config_source.file) :
@@ -746,7 +746,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 +819,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!"));
 	}
 	else if (actions == ACTION_REMOVE_SECTION) {
 		int ret;
@@ -830,7 +830,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!"));
 	}
 	else if (actions == ACTION_GET_COLOR) {
 		check_argc(argc, 1, 2);
diff --git a/t/t1308-config-set.sh b/t/t1308-config-set.sh
index 3e00d1af01..d0a2727b85 100755
--- a/t/t1308-config-set.sh
+++ b/t/t1308-config-set.sh
@@ -233,7 +233,7 @@ test_expect_success 'check line errors for malformed values' '
 
 test_expect_success 'error on modifying repo config without repo' '
 	nongit test_must_fail git config a.b c 2>err &&
-	grep "not in a git directory" err
+	test_i18ngrep "not in a git directory" err
 '
 
 cmdline_config="'foo.bar=from-cmdline'"
-- 
2.18.0.rc0.309.g77c7720784


  parent reply	other threads:[~2018-06-02  4:33 UTC|newest]

Thread overview: 64+ 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 ` Nguyễn Thái Ngọc Duy [this message]
2018-06-03  9:01   ` [PATCH 03/22] builtin/config.c: " 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 ` [PATCH v2 00/23] Mark " Nguyễn Thái Ngọc Duy
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

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=20180602043241.9941-4-pclouds@gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    /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).