From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH 06/22] builtin/config.c: mark strings for translation
Date: Sat, 27 Feb 2016 13:41:57 +0700 [thread overview]
Message-ID: <1456555333-5853-7-git-send-email-pclouds@gmail.com> (raw)
In-Reply-To: <1456555333-5853-1-git-send-email-pclouds@gmail.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
builtin/config.c | 41 +++++++++++++++++++++--------------------
1 file changed, 21 insertions(+), 20 deletions(-)
diff --git a/builtin/config.c b/builtin/config.c
index 98ca43d..b07df26 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -90,7 +90,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);
}
@@ -213,7 +213,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(key_regexp);
key_regexp = NULL;
ret = CONFIG_INVALID_PATTERN;
@@ -234,7 +234,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(regexp);
regexp = NULL;
ret = CONFIG_INVALID_PATTERN;
@@ -381,10 +381,10 @@ static void check_write(void)
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 {
@@ -489,7 +489,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);
}
@@ -510,7 +510,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 not set"));
if (access_or_warn(user_config, R_OK, 0) &&
xdg_config && !access_or_warn(xdg_config, R_OK, 0))
@@ -540,17 +540,17 @@ int cmd_config(int argc, const char **argv, const char *prefix)
}
if (HAS_MULTI_BITS(types)) {
- error("only one type at a time.");
+ error(_("only one type at a time."));
usage_with_options(builtin_config_usage, builtin_config_options);
}
if ((actions & (ACTION_GET_COLOR|ACTION_GET_COLORBOOL)) && types) {
- 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)
@@ -563,7 +563,7 @@ 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);
}
@@ -580,10 +580,10 @@ int cmd_config(int argc, const char **argv, const char *prefix)
&given_config_source,
respect_includes) < 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) {
@@ -591,11 +591,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 = xstrdup(given_config_source.file ?
given_config_source.file : git_path("config"));
@@ -620,8 +620,9 @@ int cmd_config(int argc, const char **argv, const char *prefix)
value = normalize_value(argv[0], argv[1]);
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]);
+ error(_("cannot overwrite multiple values with a single value\n"
+ "Use a regexp, --add or --replace-all to change %s."),
+ argv[0]);
return ret;
}
else if (actions == ACTION_SET_ALL) {
@@ -691,7 +692,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;
@@ -702,7 +703,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);
--
2.8.0.rc0.205.g7ec8cf1
next prev parent reply other threads:[~2016-02-27 6:42 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-27 6:41 [PATCH 00/22] Mark more strings for translation Nguyễn Thái Ngọc Duy
2016-02-27 6:41 ` [PATCH 01/22] credential-cache--daemon: enable localized messages Nguyễn Thái Ngọc Duy
2016-02-27 6:41 ` [PATCH 02/22] builtin/blame.c: mark strings for translation Nguyễn Thái Ngọc Duy
2016-02-28 18:57 ` Junio C Hamano
2016-02-29 0:33 ` Duy Nguyen
2016-02-29 18:22 ` Junio C Hamano
2016-02-27 6:41 ` [PATCH 03/22] builtin/checkout.c: " Nguyễn Thái Ngọc Duy
2016-02-28 19:00 ` Junio C Hamano
2016-02-27 6:41 ` [PATCH 04/22] builtin/clone.c: " Nguyễn Thái Ngọc Duy
2016-02-28 19:05 ` Junio C Hamano
2016-02-27 6:41 ` [PATCH 05/22] builtin/config.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:25 ` Junio C Hamano
2016-02-27 6:41 ` Nguyễn Thái Ngọc Duy [this message]
2016-02-27 6:41 ` [PATCH 07/22] builtin/update-index.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:27 ` Junio C Hamano
2016-02-27 6:41 ` [PATCH 08/22] convert.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:29 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 09/22] credential-cache--daemon.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:30 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 10/22] http.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:31 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 11/22] ident.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:34 ` Junio C Hamano
2016-03-01 14:56 ` Jeff King
2016-02-27 6:42 ` [PATCH 12/22] notes.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:36 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 13/22] ref-filter.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:41 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 14/22] refs/files-backend.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:43 ` Junio C Hamano
2016-03-01 10:40 ` Duy Nguyen
2016-02-27 6:42 ` [PATCH 15/22] remote-curl.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:50 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 16/22] run-command.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:52 ` Junio C Hamano
2016-03-01 0:00 ` Stefan Beller
2016-02-27 6:42 ` [PATCH 17/22] sha1_file.c: " Nguyễn Thái Ngọc Duy
2016-02-27 6:42 ` [PATCH 18/22] submodule.c: " Nguyễn Thái Ngọc Duy
2016-02-27 6:42 ` [PATCH 19/22] trailer.c: " Nguyễn Thái Ngọc Duy
2016-02-29 18:55 ` Junio C Hamano
2016-02-27 6:42 ` [PATCH 20/22] transport-helper.c: mark strings for translating Nguyễn Thái Ngọc Duy
2016-02-27 6:42 ` [PATCH 21/22] transport.c: " Nguyễn Thái Ngọc Duy
2016-02-27 6:42 ` [PATCH 22/22] wrapper.c: mark strings for translation Nguyễn Thái Ngọc Duy
2016-02-27 17:34 ` [PATCH 00/22] Mark more " Junio C Hamano
2016-02-27 19:00 ` Junio C Hamano
2016-02-28 0:43 ` Duy Nguyen
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=1456555333-5853-7-git-send-email-pclouds@gmail.com \
--to=pclouds@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).