convert.c: mark more strings for translation

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Jul 21, 2018 at 09:49 UTC d26a328eaf7fb627fe70d241d9dd13370380cb25
2 files changed +21 -19
convert.c
+20 -18
@@ -190,7 +190,7 @@ static enum eol output_eol(enum crlf_action crlf_action)
190 /* fall through */
191 return text_eol_is_crlf() ? EOL_CRLF : EOL_LF;
192 }
193 - warning("illegal crlf_action %d", (int)crlf_action);
193 + warning(_("illegal crlf_action %d"), (int)crlf_action);
194 return core_eol;
195 }
196
@@ -207,7 +207,7 @@ static void check_global_conv_flags_eol(const char *path, enum crlf_action crlf_
207 else if (conv_flags & CONV_EOL_RNDTRP_WARN)
208 warning(_("CRLF will be replaced by LF in %s.\n"
209 "The file will have its original line"
210 - " endings in your working directory."), path);
210 + " endings in your working directory"), path);
211 } else if (old_stats->lonelf && !new_stats->lonelf ) {
212 /*
213 * CRLFs would be added by checkout
@@ -217,7 +217,7 @@ static void check_global_conv_flags_eol(const char *path, enum crlf_action crlf_
217 else if (conv_flags & CONV_EOL_RNDTRP_WARN)
218 warning(_("LF will be replaced by CRLF in %s.\n"
219 "The file will have its original line"
220 - " endings in your working directory."), path);
220 + " endings in your working directory"), path);
221 }
222 }
223
@@ -492,7 +492,7 @@ static int encode_to_worktree(const char *path, const char *src, size_t src_len,
492 dst = reencode_string_len(src, src_len, enc, default_encoding,
493 &dst_len);
494 if (!dst) {
495 - error("failed to encode '%s' from %s to %s",
495 + error(_("failed to encode '%s' from %s to %s"),
496 path, default_encoding, enc);
497 return 0;
498 }
@@ -670,7 +670,8 @@ static int filter_buffer_or_fd(int in, int out, void *data)
670
671 if (start_command(&child_process)) {
672 strbuf_release(&cmd);
673 - return error("cannot fork to run external filter '%s'", params->cmd);
673 + return error(_("cannot fork to run external filter '%s'"),
674 + params->cmd);
675 }
676
677 sigchain_push(SIGPIPE, SIG_IGN);
@@ -689,13 +690,14 @@ static int filter_buffer_or_fd(int in, int out, void *data)
690 if (close(child_process.in))
691 write_err = 1;
692 if (write_err)
692 - error("cannot feed the input to external filter '%s'", params->cmd);
693 + error(_("cannot feed the input to external filter '%s'"),
694 + params->cmd);
695
696 sigchain_pop(SIGPIPE);
697
698 status = finish_command(&child_process);
699 if (status)
698 - error("external filter '%s' failed %d", params->cmd, status);
700 + error(_("external filter '%s' failed %d"), params->cmd, status);
701
702 strbuf_release(&cmd);
703 return (write_err || status);
@@ -730,13 +732,13 @@ static int apply_single_file_filter(const char *path, const char *src, size_t le
732 return 0; /* error was already reported */
733
734 if (strbuf_read(&nbuf, async.out, len) < 0) {
733 - err = error("read from external filter '%s' failed", cmd);
735 + err = error(_("read from external filter '%s' failed"), cmd);
736 }
737 if (close(async.out)) {
736 - err = error("read from external filter '%s' failed", cmd);
738 + err = error(_("read from external filter '%s' failed"), cmd);
739 }
740 if (finish_async(&async)) {
739 - err = error("external filter '%s' failed", cmd);
741 + err = error(_("external filter '%s' failed"), cmd);
742 }
743
744 if (!err) {
@@ -790,7 +792,7 @@ static void handle_filter_error(const struct strbuf *filter_status,
792 * Something went wrong with the protocol filter.
793 * Force shutdown and restart if another blob requires filtering.
794 */
793 - error("external filter '%s' failed", entry->subprocess.cmd);
795 + error(_("external filter '%s' failed"), entry->subprocess.cmd);
796 subprocess_stop(&subprocess_map, &entry->subprocess);
797 free(entry);
798 }
@@ -838,7 +840,7 @@ static int apply_multi_file_filter(const char *path, const char *src, size_t len
840 else if (wanted_capability & CAP_SMUDGE)
841 filter_type = "smudge";
842 else
841 - die("unexpected filter type");
843 + die(_("unexpected filter type"));
844
845 sigchain_push(SIGPIPE, SIG_IGN);
846
@@ -849,7 +851,7 @@ static int apply_multi_file_filter(const char *path, const char *src, size_t len
851
852 err = strlen(path) > LARGE_PACKET_DATA_MAX - strlen("pathname=\n");
853 if (err) {
852 - error("path name too long for external filter");
854 + error(_("path name too long for external filter"));
855 goto done;
856 }
857
@@ -923,8 +925,8 @@ int async_query_available_blobs(const char *cmd, struct string_list *available_p
925 assert(subprocess_map_initialized);
926 entry = (struct cmd2process *)subprocess_find_entry(&subprocess_map, cmd);
927 if (!entry) {
926 - error("external filter '%s' is not available anymore although "
927 - "not all paths have been filtered", cmd);
928 + error(_("external filter '%s' is not available anymore although "
929 + "not all paths have been filtered"), cmd);
930 return 0;
931 }
932 process = &entry->subprocess.process;
@@ -1395,7 +1397,7 @@ int convert_to_git(const struct index_state *istate,
1397
1398 ret |= apply_filter(path, src, len, -1, dst, ca.drv, CAP_CLEAN, NULL);
1399 if (!ret && ca.drv && ca.drv->required)
1398 - die("%s: clean filter '%s' failed", path, ca.drv->name);
1400 + die(_("%s: clean filter '%s' failed"), path, ca.drv->name);
1401
1402 if (ret && dst) {
1403 src = dst->buf;
@@ -1429,7 +1431,7 @@ void convert_to_git_filter_fd(const struct index_state *istate,
1431 assert(ca.drv->clean || ca.drv->process);
1432
1433 if (!apply_filter(path, NULL, 0, fd, dst, ca.drv, CAP_CLEAN, NULL))
1432 - die("%s: clean filter '%s' failed", path, ca.drv->name);
1434 + die(_("%s: clean filter '%s' failed"), path, ca.drv->name);
1435
1436 encode_to_git(path, dst->buf, dst->len, dst, ca.working_tree_encoding, conv_flags);
1437 crlf_to_git(istate, path, dst->buf, dst->len, dst, ca.crlf_action, conv_flags);
@@ -1472,7 +1474,7 @@ static int convert_to_working_tree_internal(const char *path, const char *src,
1474 ret_filter = apply_filter(
1475 path, src, len, -1, dst, ca.drv, CAP_SMUDGE, dco);
1476 if (!ret_filter && ca.drv && ca.drv->required)
1475 - die("%s: smudge filter %s failed", path, ca.drv->name);
1477 + die(_("%s: smudge filter %s failed"), path, ca.drv->name);
1478
1479 return ret | ret_filter;
1480 }
t/t0021-conversion.sh
+1 -1
@@ -583,7 +583,7 @@ test_expect_success PERL 'process filter should restart after unexpected write f
583 git checkout --quiet --no-progress . 2>git-stderr.log &&
584
585 grep "smudge write error at" git-stderr.log &&
586 - grep "error: external filter" git-stderr.log &&
586 + test_i18ngrep "error: external filter" git-stderr.log &&
587
588 cat >expected.log <<-EOF &&
589 START