{"thread":{"id":"52639","subject":"[PATCH] submodule.c: mark more strings for translation","startedAt":"2020-01-15T18:07:20Z","lastAt":"2020-01-21T21:58:34Z","messageCount":2,"participants":["Ralf Thielow","Josh Steadmon"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"389807","messageId":"20200115180701.14657-1-ralf.thielow@gmail.com","threadId":"52639","inReplyTo":null,"subject":"[PATCH] submodule.c: mark more strings for translation","fromName":"Ralf Thielow","fromEmail":"ralf.thielow@gmail.com","sentAt":"2020-01-15T18:07:01Z","receivedAt":"2020-01-15T18:07:20Z","isPatch":true,"sender":{"key":"ralf.thielow@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1275832?v=4"},"body":"Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>\n---\n submodule.c | 28 ++++++++++++++--------------\n 1 file changed, 14 insertions(+), 14 deletions(-)\n\ndiff --git a/submodule.c b/submodule.c\nindex 9da7181321..9430db8ffc 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -431,7 +431,7 @@ void handle_ignore_submodules_arg(struct diff_options *diffopt,\n \telse if (!strcmp(arg, \"dirty\"))\n \t\tdiffopt->flags.ignore_dirty_submodules = 1;\n \telse if (strcmp(arg, \"none\"))\n-\t\tdie(\"bad --ignore-submodules argument: %s\", arg);\n+\t\tdie(_(\"bad --ignore-submodules argument: %s\"), arg);\n \t/*\n \t * Please update _git_status() in git-completion.bash when you\n \t * add new options\n@@ -812,9 +812,9 @@ static void collect_changed_submodules_cb(struct diff_queue_struct *q,\n \t\t\t\tsubmodule = submodule_from_name(me->repo,\n \t\t\t\t\t\t\t\tcommit_oid, name);\n \t\t\tif (submodule) {\n-\t\t\t\twarning(\"Submodule in commit %s at path: \"\n+\t\t\t\twarning(_(\"Submodule in commit %s at path: \"\n \t\t\t\t\t\"'%s' collides with a submodule named \"\n-\t\t\t\t\t\"the same. Skipping it.\",\n+\t\t\t\t\t\"the same. Skipping it.\"),\n \t\t\t\t\toid_to_hex(commit_oid), p->two->path);\n \t\t\t\tname = NULL;\n \t\t\t}\n@@ -844,7 +844,7 @@ static void collect_changed_submodules(struct repository *r,\n \trepo_init_revisions(r, &rev, NULL);\n \tsetup_revisions(argv->argc, argv->argv, &rev, NULL);\n \tif (prepare_revision_walk(&rev))\n-\t\tdie(\"revision walk setup failed\");\n+\t\tdie(_(\"revision walk setup failed\"));\n \n \twhile ((commit = get_revision(&rev))) {\n \t\tstruct rev_info diff_rev;\n@@ -992,7 +992,7 @@ static int submodule_needs_pushing(struct repository *r,\n \t\tcp.out = -1;\n \t\tcp.dir = path;\n \t\tif (start_command(&cp))\n-\t\t\tdie(\"Could not run 'git rev-list <commits> --not --remotes -n 1' command in submodule %s\",\n+\t\t\tdie(_(\"Could not run 'git rev-list <commits> --not --remotes -n 1' command in submodule %s\"),\n \t\t\t\t\tpath);\n \t\tif (strbuf_read(&buf, cp.out, the_hash_algo->hexsz + 1))\n \t\t\tneeds_pushing = 1;\n@@ -1115,7 +1115,7 @@ static void submodule_push_check(const char *path, const char *head,\n \t * child process.\n \t */\n \tif (run_command(&cp))\n-\t\tdie(\"process for submodule '%s' failed\", path);\n+\t\tdie(_(\"process for submodule '%s' failed\"), path);\n }\n \n int push_unpushed_submodules(struct repository *r,\n@@ -1155,10 +1155,10 @@ int push_unpushed_submodules(struct repository *r,\n \t/* Actually push the submodules */\n \tfor (i = 0; i < needs_pushing.nr; i++) {\n \t\tconst char *path = needs_pushing.items[i].string;\n-\t\tfprintf(stderr, \"Pushing submodule '%s'\\n\", path);\n+\t\tfprintf(stderr, _(\"Pushing submodule '%s'\\n\"), path);\n \t\tif (!push_submodule(path, remote, rs,\n \t\t\t\t    push_options, dry_run)) {\n-\t\t\tfprintf(stderr, \"Unable to push submodule '%s'\\n\", path);\n+\t\t\tfprintf(stderr, _(\"Unable to push submodule '%s'\\n\"), path);\n \t\t\tret = 0;\n \t\t}\n \t}\n@@ -1448,7 +1448,7 @@ static int get_next_submodule(struct child_process *cp,\n \t\t\tprepare_submodule_repo_env_in_gitdir(&cp->env_array);\n \t\t\tcp->git_cmd = 1;\n \t\t\tif (!spf->quiet)\n-\t\t\t\tstrbuf_addf(err, \"Fetching submodule %s%s\\n\",\n+\t\t\t\tstrbuf_addf(err, _(\"Fetching submodule %s%s\\n\"),\n \t\t\t\t\t    spf->prefix, ce->name);\n \t\t\targv_array_init(&cp->args);\n \t\t\targv_array_pushv(&cp->args, spf->args.argv);\n@@ -1610,7 +1610,7 @@ int fetch_populated_submodules(struct repository *r,\n \t\tgoto out;\n \n \tif (repo_read_index(r) < 0)\n-\t\tdie(\"index file corrupt\");\n+\t\tdie(_(\"index file corrupt\"));\n \n \targv_array_push(&spf.args, \"fetch\");\n \tfor (i = 0; i < options->argc; i++)\n@@ -1665,7 +1665,7 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked)\n \tcp.out = -1;\n \tcp.dir = path;\n \tif (start_command(&cp))\n-\t\tdie(\"Could not run 'git status --porcelain=2' in submodule %s\", path);\n+\t\tdie(_(\"Could not run 'git status --porcelain=2' in submodule %s\"), path);\n \n \tfp = xfdopen(cp.out, \"r\");\n \twhile (strbuf_getwholeline(&buf, fp, '\\n') != EOF) {\n@@ -1706,7 +1706,7 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked)\n \tfclose(fp);\n \n \tif (finish_command(&cp) && !ignore_cp_exit_code)\n-\t\tdie(\"'git status --porcelain=2' failed in submodule %s\", path);\n+\t\tdie(_(\"'git status --porcelain=2' failed in submodule %s\"), path);\n \n \tstrbuf_release(&buf);\n \treturn dirty_submodule;\n@@ -1841,7 +1841,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)\n \tcp.no_stdout = 1;\n \tcp.dir = sub->path;\n \tif (start_command(&cp))\n-\t\tdie(\"could not recurse into submodule '%s'\", sub->path);\n+\t\tdie(_(\"could not recurse into submodule '%s'\"), sub->path);\n \n \treturn finish_command(&cp);\n }\n@@ -1862,7 +1862,7 @@ static void submodule_reset_index(const char *path)\n \targv_array_push(&cp.args, empty_tree_oid_hex());\n \n \tif (run_command(&cp))\n-\t\tdie(\"could not reset submodule index\");\n+\t\tdie(_(\"could not reset submodule index\"));\n }\n \n /**\n-- \n2.25.0.341.g760bfbb309\n\n"},{"id":"390206","messageId":"20200121215826.GC63040@google.com","threadId":"52639","inReplyTo":"20200115180701.14657-1-ralf.thielow@gmail.com","subject":"Re: [PATCH] submodule.c: mark more strings for translation","fromName":"Josh Steadmon","fromEmail":"steadmon@google.com","sentAt":"2020-01-21T21:58:26Z","receivedAt":"2020-01-21T21:58:34Z","isPatch":true,"sender":{"key":"steadmon@google.com","avatar":"https://avatars.githubusercontent.com/u/2654920?v=4"},"body":"On 2020.01.15 19:07, Ralf Thielow wrote:\n> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>\n> ---\n>  submodule.c | 28 ++++++++++++++--------------\n>  1 file changed, 14 insertions(+), 14 deletions(-)\n> \n> diff --git a/submodule.c b/submodule.c\n> index 9da7181321..9430db8ffc 100644\n> --- a/submodule.c\n> +++ b/submodule.c\n> @@ -431,7 +431,7 @@ void handle_ignore_submodules_arg(struct diff_options *diffopt,\n>  \telse if (!strcmp(arg, \"dirty\"))\n>  \t\tdiffopt->flags.ignore_dirty_submodules = 1;\n>  \telse if (strcmp(arg, \"none\"))\n> -\t\tdie(\"bad --ignore-submodules argument: %s\", arg);\n> +\t\tdie(_(\"bad --ignore-submodules argument: %s\"), arg);\n>  \t/*\n>  \t * Please update _git_status() in git-completion.bash when you\n>  \t * add new options\n> @@ -812,9 +812,9 @@ static void collect_changed_submodules_cb(struct diff_queue_struct *q,\n>  \t\t\t\tsubmodule = submodule_from_name(me->repo,\n>  \t\t\t\t\t\t\t\tcommit_oid, name);\n>  \t\t\tif (submodule) {\n> -\t\t\t\twarning(\"Submodule in commit %s at path: \"\n> +\t\t\t\twarning(_(\"Submodule in commit %s at path: \"\n>  \t\t\t\t\t\"'%s' collides with a submodule named \"\n> -\t\t\t\t\t\"the same. Skipping it.\",\n> +\t\t\t\t\t\"the same. Skipping it.\"),\n>  \t\t\t\t\toid_to_hex(commit_oid), p->two->path);\n>  \t\t\t\tname = NULL;\n>  \t\t\t}\n> @@ -844,7 +844,7 @@ static void collect_changed_submodules(struct repository *r,\n>  \trepo_init_revisions(r, &rev, NULL);\n>  \tsetup_revisions(argv->argc, argv->argv, &rev, NULL);\n>  \tif (prepare_revision_walk(&rev))\n> -\t\tdie(\"revision walk setup failed\");\n> +\t\tdie(_(\"revision walk setup failed\"));\n>  \n>  \twhile ((commit = get_revision(&rev))) {\n>  \t\tstruct rev_info diff_rev;\n> @@ -992,7 +992,7 @@ static int submodule_needs_pushing(struct repository *r,\n>  \t\tcp.out = -1;\n>  \t\tcp.dir = path;\n>  \t\tif (start_command(&cp))\n> -\t\t\tdie(\"Could not run 'git rev-list <commits> --not --remotes -n 1' command in submodule %s\",\n> +\t\t\tdie(_(\"Could not run 'git rev-list <commits> --not --remotes -n 1' command in submodule %s\"),\n>  \t\t\t\t\tpath);\n>  \t\tif (strbuf_read(&buf, cp.out, the_hash_algo->hexsz + 1))\n>  \t\t\tneeds_pushing = 1;\n> @@ -1115,7 +1115,7 @@ static void submodule_push_check(const char *path, const char *head,\n>  \t * child process.\n>  \t */\n>  \tif (run_command(&cp))\n> -\t\tdie(\"process for submodule '%s' failed\", path);\n> +\t\tdie(_(\"process for submodule '%s' failed\"), path);\n>  }\n>  \n>  int push_unpushed_submodules(struct repository *r,\n> @@ -1155,10 +1155,10 @@ int push_unpushed_submodules(struct repository *r,\n>  \t/* Actually push the submodules */\n>  \tfor (i = 0; i < needs_pushing.nr; i++) {\n>  \t\tconst char *path = needs_pushing.items[i].string;\n> -\t\tfprintf(stderr, \"Pushing submodule '%s'\\n\", path);\n> +\t\tfprintf(stderr, _(\"Pushing submodule '%s'\\n\"), path);\n>  \t\tif (!push_submodule(path, remote, rs,\n>  \t\t\t\t    push_options, dry_run)) {\n> -\t\t\tfprintf(stderr, \"Unable to push submodule '%s'\\n\", path);\n> +\t\t\tfprintf(stderr, _(\"Unable to push submodule '%s'\\n\"), path);\n>  \t\t\tret = 0;\n>  \t\t}\n>  \t}\n> @@ -1448,7 +1448,7 @@ static int get_next_submodule(struct child_process *cp,\n>  \t\t\tprepare_submodule_repo_env_in_gitdir(&cp->env_array);\n>  \t\t\tcp->git_cmd = 1;\n>  \t\t\tif (!spf->quiet)\n> -\t\t\t\tstrbuf_addf(err, \"Fetching submodule %s%s\\n\",\n> +\t\t\t\tstrbuf_addf(err, _(\"Fetching submodule %s%s\\n\"),\n>  \t\t\t\t\t    spf->prefix, ce->name);\n>  \t\t\targv_array_init(&cp->args);\n>  \t\t\targv_array_pushv(&cp->args, spf->args.argv);\n> @@ -1610,7 +1610,7 @@ int fetch_populated_submodules(struct repository *r,\n>  \t\tgoto out;\n>  \n>  \tif (repo_read_index(r) < 0)\n> -\t\tdie(\"index file corrupt\");\n> +\t\tdie(_(\"index file corrupt\"));\n>  \n>  \targv_array_push(&spf.args, \"fetch\");\n>  \tfor (i = 0; i < options->argc; i++)\n> @@ -1665,7 +1665,7 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked)\n>  \tcp.out = -1;\n>  \tcp.dir = path;\n>  \tif (start_command(&cp))\n> -\t\tdie(\"Could not run 'git status --porcelain=2' in submodule %s\", path);\n> +\t\tdie(_(\"Could not run 'git status --porcelain=2' in submodule %s\"), path);\n>  \n>  \tfp = xfdopen(cp.out, \"r\");\n>  \twhile (strbuf_getwholeline(&buf, fp, '\\n') != EOF) {\n> @@ -1706,7 +1706,7 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked)\n>  \tfclose(fp);\n>  \n>  \tif (finish_command(&cp) && !ignore_cp_exit_code)\n> -\t\tdie(\"'git status --porcelain=2' failed in submodule %s\", path);\n> +\t\tdie(_(\"'git status --porcelain=2' failed in submodule %s\"), path);\n>  \n>  \tstrbuf_release(&buf);\n>  \treturn dirty_submodule;\n> @@ -1841,7 +1841,7 @@ static int submodule_has_dirty_index(const struct submodule *sub)\n>  \tcp.no_stdout = 1;\n>  \tcp.dir = sub->path;\n>  \tif (start_command(&cp))\n> -\t\tdie(\"could not recurse into submodule '%s'\", sub->path);\n> +\t\tdie(_(\"could not recurse into submodule '%s'\"), sub->path);\n>  \n>  \treturn finish_command(&cp);\n>  }\n> @@ -1862,7 +1862,7 @@ static void submodule_reset_index(const char *path)\n>  \targv_array_push(&cp.args, empty_tree_oid_hex());\n>  \n>  \tif (run_command(&cp))\n> -\t\tdie(\"could not reset submodule index\");\n> +\t\tdie(_(\"could not reset submodule index\"));\n>  }\n>  \n>  /**\n> -- \n> 2.25.0.341.g760bfbb309\n\nThis all looks good to me. Thanks for the patch!\n"}]}