{"thread":{"id":"43026","subject":"[PATCH 1/3] i18n: setup: mark error messages for translation","startedAt":"2016-08-08T11:17:11Z","lastAt":"2016-08-10T19:50:54Z","messageCount":9,"participants":["Vasco Almeida","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"293343","messageId":"1470654961-2842-1-git-send-email-vascomalmeida@sapo.pt","threadId":"43026","inReplyTo":null,"subject":"[PATCH 1/3] i18n: setup: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-08-08T11:15:59Z","receivedAt":"2016-08-08T11:17:11Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n setup.c | 18 +++++++++---------\n 1 file changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/setup.c b/setup.c\nindex 6d0e0c9..fe572b8 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -759,9 +759,9 @@ static const char *setup_bare_git_dir(struct strbuf *cwd, int offset,\n static const char *setup_nongit(const char *cwd, int *nongit_ok)\n {\n \tif (!nongit_ok)\n-\t\tdie(\"Not a git repository (or any of the parent directories): %s\", DEFAULT_GIT_DIR_ENVIRONMENT);\n+\t\tdie(_(\"Not a git repository (or any of the parent directories): %s\"), DEFAULT_GIT_DIR_ENVIRONMENT);\n \tif (chdir(cwd))\n-\t\tdie_errno(\"Cannot come back to cwd\");\n+\t\tdie_errno(_(\"Cannot come back to cwd\"));\n \t*nongit_ok = 1;\n \treturn NULL;\n }\n@@ -842,7 +842,7 @@ static const char *setup_git_directory_gently_1(int *nongit_ok)\n \t\t*nongit_ok = 0;\n \n \tif (strbuf_getcwd(&cwd))\n-\t\tdie_errno(\"Unable to read current working directory\");\n+\t\tdie_errno(_(\"Unable to read current working directory\"));\n \toffset = cwd.len;\n \n \t/*\n@@ -912,19 +912,19 @@ static const char *setup_git_directory_gently_1(int *nongit_ok)\n \t\t\tif (parent_device != current_device) {\n \t\t\t\tif (nongit_ok) {\n \t\t\t\t\tif (chdir(cwd.buf))\n-\t\t\t\t\t\tdie_errno(\"Cannot come back to cwd\");\n+\t\t\t\t\t\tdie_errno(_(\"Cannot come back to cwd\"));\n \t\t\t\t\t*nongit_ok = 1;\n \t\t\t\t\treturn NULL;\n \t\t\t\t}\n \t\t\t\tstrbuf_setlen(&cwd, offset);\n-\t\t\t\tdie(\"Not a git repository (or any parent up to mount point %s)\\n\"\n-\t\t\t\t\"Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).\",\n+\t\t\t\tdie(_(\"Not a git repository (or any parent up to mount point %s)\\n\"\n+\t\t\t\t\"Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).\"),\n \t\t\t\t    cwd.buf);\n \t\t\t}\n \t\t}\n \t\tif (chdir(\"..\")) {\n \t\t\tstrbuf_setlen(&cwd, offset);\n-\t\t\tdie_errno(\"Cannot change to '%s/..'\", cwd.buf);\n+\t\t\tdie_errno(_(\"Cannot change to '%s/..'\"), cwd.buf);\n \t\t}\n \t\toffset = offset_parent;\n \t}\n@@ -986,9 +986,9 @@ int git_config_perm(const char *var, const char *value)\n \t/* A filemode value was given: 0xxx */\n \n \tif ((i & 0600) != 0600)\n-\t\tdie(\"Problem with core.sharedRepository filemode value \"\n+\t\tdie(_(\"Problem with core.sharedRepository filemode value \"\n \t\t    \"(0%.3o).\\nThe owner of files must always have \"\n-\t\t    \"read and write permissions.\", i);\n+\t\t    \"read and write permissions.\"), i);\n \n \t/*\n \t * Mask filemode value. Others can not get write permission.\n-- \n2.7.4\n\n"},{"id":"293344","messageId":"1470654961-2842-2-git-send-email-vascomalmeida@sapo.pt","threadId":"43026","inReplyTo":"1470654961-2842-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 2/3] i18n: archive: mark errors for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-08-08T11:16:00Z","receivedAt":"2016-08-08T11:17:20Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n archive.c | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/archive.c b/archive.c\nindex 42df974..dde1ab4 100644\n--- a/archive.c\n+++ b/archive.c\n@@ -458,11 +458,11 @@ static int parse_archive_args(int argc, const char **argv,\n \targc = parse_options(argc, argv, NULL, opts, archive_usage, 0);\n \n \tif (remote)\n-\t\tdie(\"Unexpected option --remote\");\n+\t\tdie(_(\"Unexpected option --remote\"));\n \tif (exec)\n-\t\tdie(\"Option --exec can only be used together with --remote\");\n+\t\tdie(_(\"Option --exec can only be used together with --remote\"));\n \tif (output)\n-\t\tdie(\"Unexpected option --output\");\n+\t\tdie(_(\"Unexpected option --output\"));\n \n \tif (!base)\n \t\tbase = \"\";\n@@ -484,14 +484,14 @@ static int parse_archive_args(int argc, const char **argv,\n \t\tusage_with_options(archive_usage, opts);\n \t*ar = lookup_archiver(format);\n \tif (!*ar || (is_remote && !((*ar)->flags & ARCHIVER_REMOTE)))\n-\t\tdie(\"Unknown archive format '%s'\", format);\n+\t\tdie(_(\"Unknown archive format '%s'\"), format);\n \n \targs->compression_level = Z_DEFAULT_COMPRESSION;\n \tif (compression_level != -1) {\n \t\tif ((*ar)->flags & ARCHIVER_WANT_COMPRESSION_LEVELS)\n \t\t\targs->compression_level = compression_level;\n \t\telse {\n-\t\t\tdie(\"Argument not supported for format '%s': -%d\",\n+\t\t\tdie(_(\"Argument not supported for format '%s': -%d\"),\n \t\t\t\t\tformat, compression_level);\n \t\t}\n \t}\n-- \n2.7.4\n\n"},{"id":"293345","messageId":"1470654961-2842-3-git-send-email-vascomalmeida@sapo.pt","threadId":"43026","inReplyTo":"1470654961-2842-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH 3/3] i18n: git-stash: mark message for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-08-08T11:16:01Z","receivedAt":"2016-08-08T11:17:22Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n git-stash.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-stash.sh b/git-stash.sh\nindex 22fb8bc..9cbd682 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -265,7 +265,7 @@ save_stash () {\n \tcreate_stash \"$stash_msg\" $untracked\n \tstore_stash -m \"$stash_msg\" -q $w_commit ||\n \tdie \"$(gettext \"Cannot save the current status\")\"\n-\tsay Saved working directory and index state \"$stash_msg\"\n+\tsay \"$(eval_gettext \"Saved working directory and index state \\$stash_msg\")\"\n \n \tif test -z \"$patch_mode\"\n \tthen\n-- \n2.7.4\n\n"},{"id":"293536","messageId":"xmqqvaz991m0.fsf@gitster.mtv.corp.google.com","threadId":"43026","inReplyTo":"1470654961-2842-2-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH 2/3] i18n: archive: mark errors for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-08-09T19:35:51Z","receivedAt":"2016-08-09T19:35:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Vasco Almeida <vascomalmeida@sapo.pt> writes:\n\n> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n> ---\n>  archive.c | 10 +++++-----\n>  1 file changed, 5 insertions(+), 5 deletions(-)\n>\n> diff --git a/archive.c b/archive.c\n> index 42df974..dde1ab4 100644\n> --- a/archive.c\n> +++ b/archive.c\n> @@ -458,11 +458,11 @@ static int parse_archive_args(int argc, const char **argv,\n>  \targc = parse_options(argc, argv, NULL, opts, archive_usage, 0);\n>  \n>  \tif (remote)\n> -\t\tdie(\"Unexpected option --remote\");\n> +\t\tdie(_(\"Unexpected option --remote\"));\n>  \tif (exec)\n> -\t\tdie(\"Option --exec can only be used together with --remote\");\n> +\t\tdie(_(\"Option --exec can only be used together with --remote\"));\n>  \tif (output)\n> -\t\tdie(\"Unexpected option --output\");\n> +\t\tdie(_(\"Unexpected option --output\"));\n> ...\n> -\t\tdie(\"Unknown archive format '%s'\", format);\n> +\t\tdie(_(\"Unknown archive format '%s'\"), format);\n> ...\n> -\t\t\tdie(\"Argument not supported for format '%s': -%d\",\n> +\t\t\tdie(_(\"Argument not supported for format '%s': -%d\"),\n>  \t\t\t\t\tformat, compression_level);\n\nHmm, this function is called by write_archive(), which can be called\nby the upload-archive process running on the remote end, whose\nlocale certainly is different from that of your local environment.\n\nIf I do not read English and got one of these messages from the\nremote end, I can copy that into a search engine to read more about\nthe error, but if I got it translated into, say, Portuguese, I'd\nhave a (slightly) harder time dealing with the error, I would think.\n\nHaving said that, I expect that sites that expect internatinal\naudience to come would run these services in C locale, and other\nsites that target audiences in a single locale would choose to use\ntheir favourite single locale, so probably we do not have to worry\nabout it.\n\nThanks.\n"},{"id":"293537","messageId":"xmqqr39x91k6.fsf@gitster.mtv.corp.google.com","threadId":"43026","inReplyTo":"1470654961-2842-3-git-send-email-vascomalmeida@sapo.pt","subject":"Re: [PATCH 3/3] i18n: git-stash: mark message for translation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-08-09T19:36:57Z","receivedAt":"2016-08-09T19:37:06Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Vasco Almeida <vascomalmeida@sapo.pt> writes:\n\n> Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n> ---\n>  git-stash.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/git-stash.sh b/git-stash.sh\n> index 22fb8bc..9cbd682 100755\n> --- a/git-stash.sh\n> +++ b/git-stash.sh\n> @@ -265,7 +265,7 @@ save_stash () {\n>  \tcreate_stash \"$stash_msg\" $untracked\n>  \tstore_stash -m \"$stash_msg\" -q $w_commit ||\n>  \tdie \"$(gettext \"Cannot save the current status\")\"\n> -\tsay Saved working directory and index state \"$stash_msg\"\n> +\tsay \"$(eval_gettext \"Saved working directory and index state \\$stash_msg\")\"\n>  \n>  \tif test -z \"$patch_mode\"\n>  \tthen\n\nThere is another \"say\" without gettext in pop_stash function.  Don't\nyou want to do that one, too?\n"},{"id":"293585","messageId":"1470835697.2820.3.camel@sapo.pt","threadId":"43026","inReplyTo":"xmqqvaz991m0.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 2/3] i18n: archive: mark errors for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-08-10T13:28:17Z","receivedAt":"2016-08-10T18:55:36Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"A Ter, 09-08-2016 às 12:35 -0700, Junio C Hamano escreveu:\n> Hmm, this function is called by write_archive(), which can be called\n> by the upload-archive process running on the remote end, whose\n> locale certainly is different from that of your local environment.\n> \n> If I do not read English and got one of these messages from the\n> remote end, I can copy that into a search engine to read more about\n> the error, but if I got it translated into, say, Portuguese, I'd\n> have a (slightly) harder time dealing with the error, I would think.\n> \n> Having said that, I expect that sites that expect internatinal\n> audience to come would run these services in C locale, and other\n> sites that target audiences in a single locale would choose to use\n> their favourite single locale, so probably we do not have to worry\n> about it.\n\nI don't know what is the best. I trust you to decide. I'm happy with\nwhatever you decide.\n\nWhen I marked those string I did not noticed what you did, just spot\nthe string and marked them. So I submitted this without taking that\ninto consideration.\n"},{"id":"293626","messageId":"1470826230-4211-1-git-send-email-vascomalmeida@sapo.pt","threadId":"43026","inReplyTo":"1470654961-2842-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 1/3] i18n: setup: mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-08-10T10:50:28Z","receivedAt":"2016-08-10T19:50:46Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n setup.c | 18 +++++++++---------\n 1 file changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/setup.c b/setup.c\nindex 6d0e0c9..fe572b8 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -759,9 +759,9 @@ static const char *setup_bare_git_dir(struct strbuf *cwd, int offset,\n static const char *setup_nongit(const char *cwd, int *nongit_ok)\n {\n \tif (!nongit_ok)\n-\t\tdie(\"Not a git repository (or any of the parent directories): %s\", DEFAULT_GIT_DIR_ENVIRONMENT);\n+\t\tdie(_(\"Not a git repository (or any of the parent directories): %s\"), DEFAULT_GIT_DIR_ENVIRONMENT);\n \tif (chdir(cwd))\n-\t\tdie_errno(\"Cannot come back to cwd\");\n+\t\tdie_errno(_(\"Cannot come back to cwd\"));\n \t*nongit_ok = 1;\n \treturn NULL;\n }\n@@ -842,7 +842,7 @@ static const char *setup_git_directory_gently_1(int *nongit_ok)\n \t\t*nongit_ok = 0;\n \n \tif (strbuf_getcwd(&cwd))\n-\t\tdie_errno(\"Unable to read current working directory\");\n+\t\tdie_errno(_(\"Unable to read current working directory\"));\n \toffset = cwd.len;\n \n \t/*\n@@ -912,19 +912,19 @@ static const char *setup_git_directory_gently_1(int *nongit_ok)\n \t\t\tif (parent_device != current_device) {\n \t\t\t\tif (nongit_ok) {\n \t\t\t\t\tif (chdir(cwd.buf))\n-\t\t\t\t\t\tdie_errno(\"Cannot come back to cwd\");\n+\t\t\t\t\t\tdie_errno(_(\"Cannot come back to cwd\"));\n \t\t\t\t\t*nongit_ok = 1;\n \t\t\t\t\treturn NULL;\n \t\t\t\t}\n \t\t\t\tstrbuf_setlen(&cwd, offset);\n-\t\t\t\tdie(\"Not a git repository (or any parent up to mount point %s)\\n\"\n-\t\t\t\t\"Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).\",\n+\t\t\t\tdie(_(\"Not a git repository (or any parent up to mount point %s)\\n\"\n+\t\t\t\t\"Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).\"),\n \t\t\t\t    cwd.buf);\n \t\t\t}\n \t\t}\n \t\tif (chdir(\"..\")) {\n \t\t\tstrbuf_setlen(&cwd, offset);\n-\t\t\tdie_errno(\"Cannot change to '%s/..'\", cwd.buf);\n+\t\t\tdie_errno(_(\"Cannot change to '%s/..'\"), cwd.buf);\n \t\t}\n \t\toffset = offset_parent;\n \t}\n@@ -986,9 +986,9 @@ int git_config_perm(const char *var, const char *value)\n \t/* A filemode value was given: 0xxx */\n \n \tif ((i & 0600) != 0600)\n-\t\tdie(\"Problem with core.sharedRepository filemode value \"\n+\t\tdie(_(\"Problem with core.sharedRepository filemode value \"\n \t\t    \"(0%.3o).\\nThe owner of files must always have \"\n-\t\t    \"read and write permissions.\", i);\n+\t\t    \"read and write permissions.\"), i);\n \n \t/*\n \t * Mask filemode value. Others can not get write permission.\n-- \n2.7.4\n\n"},{"id":"293627","messageId":"1470826230-4211-2-git-send-email-vascomalmeida@sapo.pt","threadId":"43026","inReplyTo":"1470826230-4211-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 2/3] i18n: archive: mark errors for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-08-10T10:50:29Z","receivedAt":"2016-08-10T19:50:50Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n archive.c | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/archive.c b/archive.c\nindex 42df974..dde1ab4 100644\n--- a/archive.c\n+++ b/archive.c\n@@ -458,11 +458,11 @@ static int parse_archive_args(int argc, const char **argv,\n \targc = parse_options(argc, argv, NULL, opts, archive_usage, 0);\n \n \tif (remote)\n-\t\tdie(\"Unexpected option --remote\");\n+\t\tdie(_(\"Unexpected option --remote\"));\n \tif (exec)\n-\t\tdie(\"Option --exec can only be used together with --remote\");\n+\t\tdie(_(\"Option --exec can only be used together with --remote\"));\n \tif (output)\n-\t\tdie(\"Unexpected option --output\");\n+\t\tdie(_(\"Unexpected option --output\"));\n \n \tif (!base)\n \t\tbase = \"\";\n@@ -484,14 +484,14 @@ static int parse_archive_args(int argc, const char **argv,\n \t\tusage_with_options(archive_usage, opts);\n \t*ar = lookup_archiver(format);\n \tif (!*ar || (is_remote && !((*ar)->flags & ARCHIVER_REMOTE)))\n-\t\tdie(\"Unknown archive format '%s'\", format);\n+\t\tdie(_(\"Unknown archive format '%s'\"), format);\n \n \targs->compression_level = Z_DEFAULT_COMPRESSION;\n \tif (compression_level != -1) {\n \t\tif ((*ar)->flags & ARCHIVER_WANT_COMPRESSION_LEVELS)\n \t\t\targs->compression_level = compression_level;\n \t\telse {\n-\t\t\tdie(\"Argument not supported for format '%s': -%d\",\n+\t\t\tdie(_(\"Argument not supported for format '%s': -%d\"),\n \t\t\t\t\tformat, compression_level);\n \t\t}\n \t}\n-- \n2.7.4\n\n"},{"id":"293628","messageId":"1470826230-4211-3-git-send-email-vascomalmeida@sapo.pt","threadId":"43026","inReplyTo":"1470826230-4211-1-git-send-email-vascomalmeida@sapo.pt","subject":"[PATCH v2 3/3] i18n: git-stash: mark messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-08-10T10:50:30Z","receivedAt":"2016-08-10T19:50:54Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n\nI added the second mark that I had missed the first time.\nThank you Junio C Hamano for spotting that.\n\n git-stash.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-stash.sh b/git-stash.sh\nindex 22fb8bc..826af18 100755\n--- a/git-stash.sh\n+++ b/git-stash.sh\n@@ -265,7 +265,7 @@ save_stash () {\n \tcreate_stash \"$stash_msg\" $untracked\n \tstore_stash -m \"$stash_msg\" -q $w_commit ||\n \tdie \"$(gettext \"Cannot save the current status\")\"\n-\tsay Saved working directory and index state \"$stash_msg\"\n+\tsay \"$(eval_gettext \"Saved working directory and index state \\$stash_msg\")\"\n \n \tif test -z \"$patch_mode\"\n \tthen\n@@ -548,7 +548,7 @@ pop_stash() {\n \t\tdrop_stash \"$@\"\n \telse\n \t\tstatus=$?\n-\t\tsay \"The stash is kept in case you need it again.\"\n+\t\tsay \"$(gettext \"The stash is kept in case you need it again.\")\"\n \t\texit $status\n \tfi\n }\n-- \n2.7.4\n\n"}]}