{"thread":{"id":"44313","subject":"[PATCH 4/4] i18n: diff: mark warnings for translation","startedAt":"2016-10-17T13:18:05Z","lastAt":"2016-10-17T13:18:20Z","messageCount":4,"participants":["Vasco Almeida"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"304273","messageId":"20161017131529.27856-4-vascomalmeida@sapo.pt","threadId":"44313","inReplyTo":"20161017131529.27856-1-vascomalmeida@sapo.pt","subject":"[PATCH 4/4] i18n: diff: mark warnings for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-10-17T13:15:29Z","receivedAt":"2016-10-17T13:18:05Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark rename_limit_warning and degrade_cc_to_c_warning and\nrename_limit_warning for translation.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n diff.c | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/diff.c b/diff.c\nindex 1d304e0..1687317 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -4638,25 +4638,25 @@ static int is_summary_empty(const struct diff_queue_struct *q)\n }\n \n static const char rename_limit_warning[] =\n-\"inexact rename detection was skipped due to too many files.\";\n+N_(\"inexact rename detection was skipped due to too many files.\");\n \n static const char degrade_cc_to_c_warning[] =\n-\"only found copies from modified paths due to too many files.\";\n+N_(\"only found copies from modified paths due to too many files.\");\n \n static const char rename_limit_advice[] =\n-\"you may want to set your %s variable to at least \"\n-\"%d and retry the command.\";\n+N_(\"you may want to set your %s variable to at least \"\n+   \"%d and retry the command.\");\n \n void diff_warn_rename_limit(const char *varname, int needed, int degraded_cc)\n {\n \tif (degraded_cc)\n-\t\twarning(degrade_cc_to_c_warning);\n+\t\twarning(_(degrade_cc_to_c_warning));\n \telse if (needed)\n-\t\twarning(rename_limit_warning);\n+\t\twarning(_(rename_limit_warning));\n \telse\n \t\treturn;\n \tif (0 < needed && needed < 32767)\n-\t\twarning(rename_limit_advice, varname, needed);\n+\t\twarning(_(rename_limit_advice), varname, needed);\n }\n \n void diff_flush(struct diff_options *options)\n-- \n2.10.1.459.g5fd885d\n\n"},{"id":"304274","messageId":"20161017131529.27856-2-vascomalmeida@sapo.pt","threadId":"44313","inReplyTo":"20161017131529.27856-1-vascomalmeida@sapo.pt","subject":"[PATCH 2/4] i18n: convert mark error messages for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-10-17T13:15:27Z","receivedAt":"2016-10-17T13:18:09Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark error messages about CRLF for translation.\n\nUpdate test to reflect changes.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n convert.c       | 12 ++++++++----\n t/t0020-crlf.sh |  6 +++++-\n 2 files changed, 13 insertions(+), 5 deletions(-)\n\ndiff --git a/convert.c b/convert.c\nindex 077f5e6..0ad39b1 100644\n--- a/convert.c\n+++ b/convert.c\n@@ -197,17 +197,21 @@ static void check_safe_crlf(const char *path, enum crlf_action crlf_action,\n \t\t * CRLFs would not be restored by checkout\n \t\t */\n \t\tif (checksafe == SAFE_CRLF_WARN)\n-\t\t\twarning(\"CRLF will be replaced by LF in %s.\\nThe file will have its original line endings in your working directory.\", path);\n+\t\t\twarning(_(\"CRLF will be replaced by LF in %s.\\n\"\n+\t\t\t\t  \"The file will have its original line\"\n+\t\t\t\t  \" endings in your working directory.\"), path);\n \t\telse /* i.e. SAFE_CRLF_FAIL */\n-\t\t\tdie(\"CRLF would be replaced by LF in %s.\", path);\n+\t\t\tdie(_(\"CRLF would be replaced by LF in %s.\"), path);\n \t} else if (old_stats->lonelf && !new_stats->lonelf ) {\n \t\t/*\n \t\t * CRLFs would be added by checkout\n \t\t */\n \t\tif (checksafe == SAFE_CRLF_WARN)\n-\t\t\twarning(\"LF will be replaced by CRLF in %s.\\nThe file will have its original line endings in your working directory.\", path);\n+\t\t\twarning(_(\"LF will be replaced by CRLF in %s.\\n\"\n+\t\t\t\t  \"The file will have its original line\"\n+\t\t\t\t  \" endings in your working directory.\"), path);\n \t\telse /* i.e. SAFE_CRLF_FAIL */\n-\t\t\tdie(\"LF would be replaced by CRLF in %s\", path);\n+\t\t\tdie(_(\"LF would be replaced by CRLF in %s\"), path);\n \t}\n }\n \ndiff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh\nindex f94120a..71350e0 100755\n--- a/t/t0020-crlf.sh\n+++ b/t/t0020-crlf.sh\n@@ -83,7 +83,11 @@ test_expect_success 'safecrlf: print warning only once' '\n \tgit add doublewarn &&\n \tgit commit -m \"nowarn\" &&\n \tfor w in Oh here is CRLFQ in text; do echo $w; done | q_to_cr >doublewarn &&\n-\ttest $(git add doublewarn 2>&1 | grep \"CRLF will be replaced by LF\" | wc -l) = 1\n+\tgit add doublewarn 2>err &&\n+\tif test_have_prereq C_LOCALE_OUTPUT\n+\tthen\n+\t\ttest $(grep \"CRLF will be replaced by LF\" err | wc -l) = 1\n+\tfi\n '\n \n \n-- \n2.10.1.459.g5fd885d\n\n"},{"id":"304275","messageId":"20161017131529.27856-3-vascomalmeida@sapo.pt","threadId":"44313","inReplyTo":"20161017131529.27856-1-vascomalmeida@sapo.pt","subject":"[PATCH 3/4] i18n: credential-cache--daemon: mark advice for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-10-17T13:15:28Z","receivedAt":"2016-10-17T13:18:10Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Mark permissions_advice for translation.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n credential-cache--daemon.c | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/credential-cache--daemon.c b/credential-cache--daemon.c\nindex 1e5f16a..46c5937 100644\n--- a/credential-cache--daemon.c\n+++ b/credential-cache--daemon.c\n@@ -219,11 +219,11 @@ static void serve_cache(const char *socket_path, int debug)\n \tclose(fd);\n }\n \n-static const char permissions_advice[] =\n+static const char permissions_advice[] = N_(\n \"The permissions on your socket directory are too loose; other\\n\"\n \"users may be able to read your cached credentials. Consider running:\\n\"\n \"\\n\"\n-\"\tchmod 0700 %s\";\n+\"\tchmod 0700 %s\");\n static void init_socket_directory(const char *path)\n {\n \tstruct stat st;\n@@ -232,7 +232,7 @@ static void init_socket_directory(const char *path)\n \n \tif (!stat(dir, &st)) {\n \t\tif (st.st_mode & 077)\n-\t\t\tdie(permissions_advice, dir);\n+\t\t\tdie(_(permissions_advice), dir);\n \t} else {\n \t\t/*\n \t\t * We must be sure to create the directory with the correct mode,\n-- \n2.10.1.459.g5fd885d\n\n"},{"id":"304276","messageId":"20161017131529.27856-1-vascomalmeida@sapo.pt","threadId":"44313","inReplyTo":null,"subject":"[PATCH 1/4] i18n: apply: mark error message for translation","fromName":"Vasco Almeida","fromEmail":"vascomalmeida@sapo.pt","sentAt":"2016-10-17T13:15:26Z","receivedAt":"2016-10-17T13:18:20Z","isPatch":true,"sender":{"key":"vascomalmeida@sapo.pt","avatar":"https://avatars.githubusercontent.com/u/9001556?v=4"},"body":"Update test to reflect changes.\n\nSigned-off-by: Vasco Almeida <vascomalmeida@sapo.pt>\n---\n apply.c               | 4 ++--\n t/t4254-am-corrupt.sh | 2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/apply.c b/apply.c\nindex 8215874..705cf56 100644\n--- a/apply.c\n+++ b/apply.c\n@@ -1586,8 +1586,8 @@ static int find_header(struct apply_state *state,\n \t\t\t\tpatch->new_name = xstrdup(patch->def_name);\n \t\t\t}\n \t\t\tif (!patch->is_delete && !patch->new_name) {\n-\t\t\t\terror(\"git diff header lacks filename information \"\n-\t\t\t\t\t     \"(line %d)\", state->linenr);\n+\t\t\t\terror(_(\"git diff header lacks filename information \"\n+\t\t\t\t\t     \"(line %d)\"), state->linenr);\n \t\t\t\treturn -128;\n \t\t\t}\n \t\t\tpatch->is_toplevel_relative = 1;\ndiff --git a/t/t4254-am-corrupt.sh b/t/t4254-am-corrupt.sh\nindex 9bd7dd2..168739c 100755\n--- a/t/t4254-am-corrupt.sh\n+++ b/t/t4254-am-corrupt.sh\n@@ -31,7 +31,7 @@ test_expect_success 'try to apply corrupted patch' '\n test_expect_success 'compare diagnostic; ensure file is still here' '\n \techo \"error: git diff header lacks filename information (line 4)\" >expected &&\n \ttest_path_is_file f &&\n-\ttest_cmp expected actual\n+\ttest_i18ncmp expected actual\n '\n \n test_done\n-- \n2.10.1.459.g5fd885d\n\n"}]}