Signed-off-by: Nguyễn Thái Ngọc Duy
---
config.c | 76 +++
t/t1305-config-include.sh | 2 +-
2 files changed, 39 insertions(+), 39 deletions(-)
diff --git a/config.c b/config.c
index fbbf0f8e9f..80eae290e9 100644
--- a/config.c
+++ b/config.c
@@ -116,12 +116,12 @@ static long config_buf_ftell(struct config_source *conf)
}
#define MAX_INCLUDE_DEPTH 10
-static const char include_depth_advice[] =
+static const char include_depth_advice[] = N_(
"exceeded maximum include depth (%d) while including\n"
" %s\n"
"from\n"
" %s\n"
-"Do you have circular includes?";
+"Do you have circular includes?");
static int handle_path_include(const char *path, struct config_include_data
*inc)
{
int ret = 0;
@@ -133,7 +133,7 @@ static int handle_path_include(const char *path, struct
config_include_data *inc
expanded = expand_user_path(path, 0);
if (!expanded)
- return error("could not expand include path '%s'", path);
+ return error(_("could not expand include path '%s'"), path);
path = expanded;
/*
@@ -144,7 +144,7 @@ static int handle_path_include(const char *path, struct
config_include_data *inc
char *slash;
if (!cf || !cf->path)
- return error("relative config includes must come from
files");
+ return error(_("relative config includes must come from
files"));
slash = find_last_dir_sep(cf->path);
if (slash)
@@ -155,7 +155,7 @@ static int handle_path_include(const char *path, struct
config_include_data *inc
if (!access_or_die(path, R_OK, 0)) {
if (++inc->depth > MAX_INCLUDE_DEPTH)
- die(include_depth_advice, MAX_INCLUDE_DEPTH, path,
+ die(_(include_depth_advice), MAX_INCLUDE_DEPTH, path,
!cf ? "" :
cf->name ? cf->name :
"the command line");
@@ -342,13 +342,13 @@ static int git_config_parse_key_1(const char *key, char
**store_key, int *basele
if (last_dot == NULL || last_dot == key) {
if (!quiet)
- error("key does not contain a section: %s", key);
+ error(_("key does not contain a section: %s"), key);
return -CONFIG_NO_SECTION_OR_NAME;
}
if (!last_dot[1]) {
if (!quiet)
- error("key does not contain variable name: %s", key);
+ error(_("key does not contain variable name: %s"), key);
return -CONFIG_NO_SECTION_OR_NAME;
}
@@ -372,13 +372,13 @@ static int git_config_parse_key_1(const char *key, char
**store_key, int *basele
if (!iskeychar(c) ||
(i == baselen + 1 && !isalpha(c))) {
if (!quiet)
- error("invalid key: %s", key);
+ error(_("invalid key: %s"), key);
goto out_free_ret_1;
}
c = tolower(c);
} else if (c == '\n') {
if (!quiet)
- error("invalid key (newline): %s", key);
+ error(_("invalid key (newline): %s"), key);
goto out_free_ret_1;
}
if (store_key)
@@ -414,7 +414,7 @@ int git_config_parse_parameter(const char *text,
pair = strbuf_split_str(text, '=', 2);
if (!pair[0])
- return error("bogus config parameter: %s", text);
+ return error(_("bogus config parameter: %s"), text);
if (pair[0]->len && pair[0]->buf[pair[0]->len - 1] == '=') {
strbuf_setlen(pair[0], pair[0]->len - 1);
@@ -426,7 +426,7 @@ int git_config_parse_parameter(const char *text,
strbuf_trim(pair[0]);
if (!pair[0]->len) {
strbuf_list_free(pair);
- return error("bogus config parameter: %s", text);
+ return error(_("bogus config parameter: %s"), text);
}
if (git_config_parse_key(pair[0]->buf, _name, NULL)) {
@@ -461,7 +461,7 @@ int git_config_from_parameters(config_fn_t fn, void *data)
envw = xstrdup(env);
if (sq_dequote_to_argv(envw, , , ) < 0) {
- ret = error("bogus format in " CONFIG_DATA_ENVIRONMENT);
+ ret = error(("bogus format in %s"), CONFIG_DATA_ENVIRONMENT);
goto out;
}
@@ -1154,7 +1154,7 @@ static int git_default_core_config(const char *var, const
char *value)
else {
int abbrev = git_config_int(var, value);
if (abbrev < minimum_abbrev || abbrev > 40)
-