@matheusbsbs / matheus-bagliano / commits / 355ec7a130
Fork 0

i18n: git-status basic messages

Gettextize the most common git-status messages. Many tests checked for these explicitly. Change them to skip under GETTEXT_POISON=YesPlease. Some of the tests in t7508-status.sh needed to be split up when I added C_LOCALE_OUTPUT to them, since parts of them affected later tests (some of which aren't being skipped) indirectly. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Feb 22, 2011 at 23:42 UTC 355ec7a1303af862a76961603ea2a2a11a0d204c
4 files changed +119 -104
t/t7060-wtstatus.sh
+1 -1
@@ -38,7 +38,7 @@ cat >expect <<EOF
38 no changes added to commit (use "git add" and/or "git commit -a")
39 EOF
40
41 -test_expect_success 'M/D conflict does not segfault' '
41 +test_expect_success C_LOCALE_OUTPUT 'M/D conflict does not segfault' '
42 mkdir mdconflict &&
43 (
44 cd mdconflict &&
t/t7506-status-submodule.sh
+10 -10
@@ -30,7 +30,7 @@ test_expect_success 'commit --dry-run -a clean' '
30 grep "nothing to commit" output
31 '
32
33 -test_expect_success 'status with modified file in submodule' '
33 +test_expect_success C_LOCALE_OUTPUT 'status with modified file in submodule' '
34 (cd sub && git reset --hard) &&
35 echo "changed" >sub/foo &&
36 git status >output &&
@@ -46,7 +46,7 @@ test_expect_success 'status with modified file in submodule (porcelain)' '
46 EOF
47 '
48
49 -test_expect_success 'status with added file in submodule' '
49 +test_expect_success C_LOCALE_OUTPUT 'status with added file in submodule' '
50 (cd sub && git reset --hard && echo >foo && git add foo) &&
51 git status >output &&
52 grep "modified: sub (modified content)" output
@@ -60,14 +60,14 @@ test_expect_success 'status with added file in submodule (porcelain)' '
60 EOF
61 '
62
63 -test_expect_success 'status with untracked file in submodule' '
63 +test_expect_success C_LOCALE_OUTPUT 'status with untracked file in submodule' '
64 (cd sub && git reset --hard) &&
65 echo "content" >sub/new-file &&
66 git status >output &&
67 grep "modified: sub (untracked content)" output
68 '
69
70 -test_expect_success 'status -uno with untracked file in submodule' '
70 +test_expect_success C_LOCALE_OUTPUT 'status -uno with untracked file in submodule' '
71 git status -uno >output &&
72 grep "^nothing to commit" output
73 '
@@ -79,7 +79,7 @@ test_expect_success 'status with untracked file in submodule (porcelain)' '
79 EOF
80 '
81
82 -test_expect_success 'status with added and untracked file in submodule' '
82 +test_expect_success C_LOCALE_OUTPUT 'status with added and untracked file in submodule' '
83 (cd sub && git reset --hard && echo >foo && git add foo) &&
84 echo "content" >sub/new-file &&
85 git status >output &&
@@ -95,7 +95,7 @@ test_expect_success 'status with added and untracked file in submodule (porcelai
95 EOF
96 '
97
98 -test_expect_success 'status with modified file in modified submodule' '
98 +test_expect_success C_LOCALE_OUTPUT 'status with modified file in modified submodule' '
99 (cd sub && git reset --hard) &&
100 rm sub/new-file &&
101 (cd sub && echo "next change" >foo && git commit -m "next change" foo) &&
@@ -113,7 +113,7 @@ test_expect_success 'status with modified file in modified submodule (porcelain)
113 EOF
114 '
115
116 -test_expect_success 'status with added file in modified submodule' '
116 +test_expect_success C_LOCALE_OUTPUT 'status with added file in modified submodule' '
117 (cd sub && git reset --hard && echo >foo && git add foo) &&
118 git status >output &&
119 grep "modified: sub (new commits, modified content)" output
@@ -127,7 +127,7 @@ test_expect_success 'status with added file in modified submodule (porcelain)' '
127 EOF
128 '
129
130 -test_expect_success 'status with untracked file in modified submodule' '
130 +test_expect_success C_LOCALE_OUTPUT 'status with untracked file in modified submodule' '
131 (cd sub && git reset --hard) &&
132 echo "content" >sub/new-file &&
133 git status >output &&
@@ -141,7 +141,7 @@ test_expect_success 'status with untracked file in modified submodule (porcelain
141 EOF
142 '
143
144 -test_expect_success 'status with added and untracked file in modified submodule' '
144 +test_expect_success C_LOCALE_OUTPUT 'status with added and untracked file in modified submodule' '
145 (cd sub && git reset --hard && echo >foo && git add foo) &&
146 echo "content" >sub/new-file &&
147 git status >output &&
@@ -167,7 +167,7 @@ test_expect_success 'setup .git file for sub' '
167 git commit -m "added .real to .gitignore" .gitignore
168 '
169
170 -test_expect_success 'status with added file in modified submodule with .git file' '
170 +test_expect_success C_LOCALE_OUTPUT 'status with added file in modified submodule with .git file' '
171 (cd sub && git reset --hard && echo >foo && git add foo) &&
172 git status >output &&
173 grep "modified: sub (new commits, modified content)" output
t/t7508-status.sh
+65 -50
@@ -55,7 +55,7 @@ test_expect_success 'setup' '
55 git add dir2/added
56 '
57
58 -test_expect_success 'status (1)' '
58 +test_expect_success C_LOCALE_OUTPUT 'status (1)' '
59
60 grep "use \"git rm --cached <file>\.\.\.\" to unstage" output
61
@@ -85,7 +85,7 @@ cat >expect <<\EOF
85 # untracked
86 EOF
87
88 -test_expect_success 'status (2)' '
88 +test_expect_success C_LOCALE_OUTPUT 'status (2)' '
89
90 git status >output &&
91 test_cmp expect output
@@ -111,7 +111,7 @@ EOF
111
112 git config advice.statusHints false
113
114 -test_expect_success 'status (advice.statusHints false)' '
114 +test_expect_success C_LOCALE_OUTPUT 'status (advice.statusHints false)' '
115
116 git status >output &&
117 test_cmp expect output
@@ -157,6 +157,12 @@ test_expect_success 'status -s -b' '
157
158 '
159
160 +test_expect_success 'setup dir3' '
161 + mkdir dir3 &&
162 + : >dir3/untracked1 &&
163 + : >dir3/untracked2
164 +'
165 +
166 cat >expect <<EOF
167 # On branch master
168 # Changes to be committed:
@@ -172,16 +178,14 @@ cat >expect <<EOF
178 #
179 # Untracked files not listed (use -u option to show untracked files)
180 EOF
175 -test_expect_success 'status -uno' '
176 - mkdir dir3 &&
177 - : >dir3/untracked1 &&
178 - : >dir3/untracked2 &&
181 +test_expect_success C_LOCALE_OUTPUT 'status -uno' '
182 git status -uno >output &&
183 test_cmp expect output
184 '
185
183 -test_expect_success 'status (status.showUntrackedFiles no)' '
186 +test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles no)' '
187 git config status.showuntrackedfiles no
188 + test_when_finished "git config --unset status.showuntrackedfiles" &&
189 git status >output &&
190 test_cmp expect output
191 '
@@ -197,7 +201,7 @@ cat >expect <<EOF
201 # Untracked files not listed
202 EOF
203 git config advice.statusHints false
200 -test_expect_success 'status -uno (advice.statusHints false)' '
204 +test_expect_success C_LOCALE_OUTPUT 'status -uno (advice.statusHints false)' '
205 git status -uno >output &&
206 test_cmp expect output
207 '
@@ -208,7 +212,6 @@ cat >expect << EOF
212 A dir2/added
213 EOF
214 test_expect_success 'status -s -uno' '
211 - git config --unset status.showuntrackedfiles
215 git status -s -uno >output &&
216 test_cmp expect output
217 '
@@ -243,13 +246,14 @@ cat >expect <<EOF
246 # output
247 # untracked
248 EOF
246 -test_expect_success 'status -unormal' '
249 +test_expect_success C_LOCALE_OUTPUT 'status -unormal' '
250 git status -unormal >output &&
251 test_cmp expect output
252 '
253
251 -test_expect_success 'status (status.showUntrackedFiles normal)' '
254 +test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles normal)' '
255 git config status.showuntrackedfiles normal
256 + test_when_finished "git config --unset status.showuntrackedfiles" &&
257 git status >output &&
258 test_cmp expect output
259 '
@@ -266,7 +270,6 @@ A dir2/added
270 ?? untracked
271 EOF
272 test_expect_success 'status -s -unormal' '
269 - git config --unset status.showuntrackedfiles
273 git status -s -unormal >output &&
274 test_cmp expect output
275 '
@@ -302,18 +305,21 @@ cat >expect <<EOF
305 # output
306 # untracked
307 EOF
305 -test_expect_success 'status -uall' '
308 +test_expect_success C_LOCALE_OUTPUT 'status -uall' '
309 git status -uall >output &&
310 test_cmp expect output
311 '
309 -test_expect_success 'status (status.showUntrackedFiles all)' '
312 +test_expect_success C_LOCALE_OUTPUT 'status (status.showUntrackedFiles all)' '
313 git config status.showuntrackedfiles all
314 + test_when_finished "git config --unset status.showuntrackedfiles" &&
315 git status >output &&
312 - rm -rf dir3 &&
313 - git config --unset status.showuntrackedfiles &&
316 test_cmp expect output
317 '
318
319 +test_expect_success 'teardown dir3' '
320 + rm -rf dir3
321 +'
322 +
323 cat >expect <<EOF
324 M dir1/modified
325 A dir2/added
@@ -361,7 +367,7 @@ cat >expect <<\EOF
367 # ../untracked
368 EOF
369
364 -test_expect_success 'status with relative paths' '
370 +test_expect_success C_LOCALE_OUTPUT 'status with relative paths' '
371
372 (cd dir1 && git status) >output &&
373 test_cmp expect output
@@ -434,18 +440,19 @@ cat >expect <<\EOF
440 # <BLUE>untracked<RESET>
441 EOF
442
437 -test_expect_success 'status with color.ui' '
443 +test_expect_success C_LOCALE_OUTPUT 'status with color.ui' '
444
445 git config color.ui always &&
446 + test_when_finished "git config --unset color.ui" &&
447 git status | test_decode_color >output &&
448 test_cmp expect output
449
450 '
451
445 -test_expect_success 'status with color.status' '
452 +test_expect_success C_LOCALE_OUTPUT 'status with color.status' '
453
447 - git config --unset color.ui &&
454 git config color.status always &&
455 + test_when_finished "git config --unset color.status" &&
456 git status | test_decode_color >output &&
457 test_cmp expect output
458
@@ -464,7 +471,6 @@ EOF
471
472 test_expect_success 'status -s with color.ui' '
473
467 - git config --unset color.status &&
474 git config color.ui always &&
475 git status -s | test_decode_color >output &&
476 test_cmp expect output
@@ -564,9 +570,10 @@ cat >expect <<\EOF
570 EOF
571
572
567 -test_expect_success 'status without relative paths' '
573 +test_expect_success C_LOCALE_OUTPUT 'status without relative paths' '
574
569 - git config status.relativePaths false
575 + git config status.relativePaths false &&
576 + test_when_finished "git config --unset status.relativePaths" &&
577 (cd dir1 && git status) >output &&
578 test_cmp expect output
579
@@ -585,6 +592,8 @@ EOF
592
593 test_expect_success 'status -s without relative paths' '
594
595 + git config status.relativePaths false &&
596 + test_when_finished "git config --unset status.relativePaths" &&
597 (cd dir1 && git status -s) >output &&
598 test_cmp expect output
599
@@ -607,7 +616,10 @@ cat <<EOF >expect
616 # untracked
617 EOF
618 test_expect_success 'dry-run of partial commit excluding new file in index' '
610 - git commit --dry-run dir1/modified >output &&
619 + git commit --dry-run dir1/modified >output
620 +'
621 +
622 +test_expect_success C_LOCALE_OUTPUT 'dry-run of partial commit excluding new file in index: output' '
623 test_cmp expect output
624 '
625
@@ -655,13 +667,13 @@ cat >expect <<EOF
667 # output
668 # untracked
669 EOF
658 -test_expect_success 'status submodule summary is disabled by default' '
670 +test_expect_success C_LOCALE_OUTPUT 'status submodule summary is disabled by default' '
671 git status >output &&
672 test_cmp expect output
673 '
674
675 # we expect the same as the previous test
664 -test_expect_success 'status --untracked-files=all does not show submodule' '
676 +test_expect_success C_LOCALE_OUTPUT 'status --untracked-files=all does not show submodule' '
677 git status --untracked-files=all >output &&
678 test_cmp expect output
679 '
@@ -719,7 +731,7 @@ cat >expect <<EOF
731 # output
732 # untracked
733 EOF
722 -test_expect_success 'status submodule summary' '
734 +test_expect_success C_LOCALE_OUTPUT 'status submodule summary' '
735 git config status.submodulesummary 10 &&
736 git status >output &&
737 test_cmp expect output
@@ -760,8 +772,11 @@ cat >expect <<EOF
772 # untracked
773 no changes added to commit (use "git add" and/or "git commit -a")
774 EOF
763 -test_expect_success 'status submodule summary (clean submodule)' '
764 - git commit -m "commit submodule" &&
775 +test_expect_success 'status submodule summary (clean submodule): commit' '
776 + git commit -m "commit submodule"
777 +'
778 +
779 +test_expect_success C_LOCALE_OUTPUT 'status submodule summary (clean submodule): output' '
780 git config status.submodulesummary 10 &&
781 test_must_fail git commit --dry-run >output &&
782 test_cmp expect output &&
@@ -812,7 +827,7 @@ cat >expect <<EOF
827 # output
828 # untracked
829 EOF
815 -test_expect_success 'commit --dry-run submodule summary (--amend)' '
830 +test_expect_success C_LOCALE_OUTPUT 'commit --dry-run submodule summary (--amend)' '
831 git config status.submodulesummary 10 &&
832 git commit --dry-run --amend >output &&
833 test_cmp expect output
@@ -867,13 +882,13 @@ cat > expect << EOF
882 # untracked
883 EOF
884
870 -test_expect_success '--ignore-submodules=untracked suppresses submodules with untracked content' '
885 +test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=untracked suppresses submodules with untracked content' '
886 echo modified > sm/untracked &&
887 git status --ignore-submodules=untracked > output &&
888 test_cmp expect output
889 '
890
876 -test_expect_success '.gitmodules ignore=untracked suppresses submodules with untracked content' '
891 +test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=untracked suppresses submodules with untracked content' '
892 git config diff.ignoreSubmodules dirty &&
893 git status >output &&
894 test_cmp expect output &&
@@ -885,7 +900,7 @@ test_expect_success '.gitmodules ignore=untracked suppresses submodules with unt
900 git config --unset diff.ignoreSubmodules
901 '
902
888 -test_expect_success '.git/config ignore=untracked suppresses submodules with untracked content' '
903 +test_expect_success C_LOCALE_OUTPUT '.git/config ignore=untracked suppresses submodules with untracked content' '
904 git config --add -f .gitmodules submodule.subname.ignore none &&
905 git config --add -f .gitmodules submodule.subname.path sm &&
906 git config --add submodule.subname.ignore untracked &&
@@ -896,12 +911,12 @@ test_expect_success '.git/config ignore=untracked suppresses submodules with unt
911 git config --remove-section -f .gitmodules submodule.subname
912 '
913
899 -test_expect_success '--ignore-submodules=dirty suppresses submodules with untracked content' '
914 +test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=dirty suppresses submodules with untracked content' '
915 git status --ignore-submodules=dirty > output &&
916 test_cmp expect output
917 '
918
904 -test_expect_success '.gitmodules ignore=dirty suppresses submodules with untracked content' '
919 +test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=dirty suppresses submodules with untracked content' '
920 git config diff.ignoreSubmodules dirty &&
921 git status >output &&
922 ! test -s actual &&
@@ -913,7 +928,7 @@ test_expect_success '.gitmodules ignore=dirty suppresses submodules with untrack
928 git config --unset diff.ignoreSubmodules
929 '
930
916 -test_expect_success '.git/config ignore=dirty suppresses submodules with untracked content' '
931 +test_expect_success C_LOCALE_OUTPUT '.git/config ignore=dirty suppresses submodules with untracked content' '
932 git config --add -f .gitmodules submodule.subname.ignore none &&
933 git config --add -f .gitmodules submodule.subname.path sm &&
934 git config --add submodule.subname.ignore dirty &&
@@ -924,13 +939,13 @@ test_expect_success '.git/config ignore=dirty suppresses submodules with untrack
939 git config -f .gitmodules --remove-section submodule.subname
940 '
941
927 -test_expect_success '--ignore-submodules=dirty suppresses submodules with modified content' '
942 +test_expect_success C_LOCALE_OUTPUT '--ignore-submodules=dirty suppresses submodules with modified content' '
943 echo modified > sm/foo &&
944 git status --ignore-submodules=dirty > output &&
945 test_cmp expect output
946 '
947
933 -test_expect_success '.gitmodules ignore=dirty suppresses submodules with modified content' '
948 +test_expect_success C_LOCALE_OUTPUT '.gitmodules ignore=dirty suppresses submodules with modified content' '
949 git config --add -f .gitmodules submodule.subname.ignore dirty &&
950 git config --add -f .gitmodules submodule.subname.path sm &&
951 git status > output &&
@@ -938,7 +953,7 @@ test_expect_success '.gitmodules ignore=dirty suppresses submodules with modifie
953 git config -f .gitmodules --remove-section submodule.subname
954 '
955
941 -test_expect_success '.git/config ignore=dirty suppresses submodules with modified content' '
956 +test_expect_success C_LOCALE_OUTPUT '.git/config ignore=dirty suppresses submodules with modified content' '
957 git config --add -f .gitmodules submodule.subname.ignore none &&
958 git config --add -f .gitmodules submodule.subname.path sm &&
959 git config --add submodule.subname.ignore dirty &&
@@ -981,12 +996,12 @@ cat > expect << EOF
996 # untracked
997 EOF
998
984 -test_expect_success "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
999 +test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=untracked doesn't suppress submodules with modified content" '
1000 git status --ignore-submodules=untracked > output &&
1001 test_cmp expect output
1002 '
1003
989 -test_expect_success ".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
1004 +test_expect_success C_LOCALE_OUTPUT ".gitmodules ignore=untracked doesn't suppress submodules with modified content" '
1005 git config --add -f .gitmodules submodule.subname.ignore untracked &&
1006 git config --add -f .gitmodules submodule.subname.path sm &&
1007 git status > output &&
@@ -994,7 +1009,7 @@ test_expect_success ".gitmodules ignore=untracked doesn't suppress submodules wi
1009 git config -f .gitmodules --remove-section submodule.subname
1010 '
1011
997 -test_expect_success ".git/config ignore=untracked doesn't suppress submodules with modified content" '
1012 +test_expect_success C_LOCALE_OUTPUT ".git/config ignore=untracked doesn't suppress submodules with modified content" '
1013 git config --add -f .gitmodules submodule.subname.ignore none &&
1014 git config --add -f .gitmodules submodule.subname.path sm &&
1015 git config --add submodule.subname.ignore untracked &&
@@ -1043,12 +1058,12 @@ cat > expect << EOF
1058 # untracked
1059 EOF
1060
1046 -test_expect_success "--ignore-submodules=untracked doesn't suppress submodule summary" '
1061 +test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=untracked doesn't suppress submodule summary" '
1062 git status --ignore-submodules=untracked > output &&
1063 test_cmp expect output
1064 '
1065
1051 -test_expect_success ".gitmodules ignore=untracked doesn't suppress submodule summary" '
1066 +test_expect_success C_LOCALE_OUTPUT ".gitmodules ignore=untracked doesn't suppress submodule summary" '
1067 git config --add -f .gitmodules submodule.subname.ignore untracked &&
1068 git config --add -f .gitmodules submodule.subname.path sm &&
1069 git status > output &&
@@ -1056,7 +1071,7 @@ test_expect_success ".gitmodules ignore=untracked doesn't suppress submodule sum
1071 git config -f .gitmodules --remove-section submodule.subname
1072 '
1073
1059 -test_expect_success ".git/config ignore=untracked doesn't suppress submodule summary" '
1074 +test_expect_success C_LOCALE_OUTPUT ".git/config ignore=untracked doesn't suppress submodule summary" '
1075 git config --add -f .gitmodules submodule.subname.ignore none &&
1076 git config --add -f .gitmodules submodule.subname.path sm &&
1077 git config --add submodule.subname.ignore untracked &&
@@ -1067,11 +1082,11 @@ test_expect_success ".git/config ignore=untracked doesn't suppress submodule sum
1082 git config -f .gitmodules --remove-section submodule.subname
1083 '
1084
1070 -test_expect_success "--ignore-submodules=dirty doesn't suppress submodule summary" '
1085 +test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=dirty doesn't suppress submodule summary" '
1086 git status --ignore-submodules=dirty > output &&
1087 test_cmp expect output
1088 '
1074 -test_expect_success ".gitmodules ignore=dirty doesn't suppress submodule summary" '
1089 +test_expect_success C_LOCALE_OUTPUT ".gitmodules ignore=dirty doesn't suppress submodule summary" '
1090 git config --add -f .gitmodules submodule.subname.ignore dirty &&
1091 git config --add -f .gitmodules submodule.subname.path sm &&
1092 git status > output &&
@@ -1079,7 +1094,7 @@ test_expect_success ".gitmodules ignore=dirty doesn't suppress submodule summary
1094 git config -f .gitmodules --remove-section submodule.subname
1095 '
1096
1082 -test_expect_success ".git/config ignore=dirty doesn't suppress submodule summary" '
1097 +test_expect_success C_LOCALE_OUTPUT ".git/config ignore=dirty doesn't suppress submodule summary" '
1098 git config --add -f .gitmodules submodule.subname.ignore none &&
1099 git config --add -f .gitmodules submodule.subname.path sm &&
1100 git config --add submodule.subname.ignore dirty &&
@@ -1111,7 +1126,7 @@ cat > expect << EOF
1126 no changes added to commit (use "git add" and/or "git commit -a")
1127 EOF
1128
1114 -test_expect_success "--ignore-submodules=all suppresses submodule summary" '
1129 +test_expect_success C_LOCALE_OUTPUT "--ignore-submodules=all suppresses submodule summary" '
1130 git status --ignore-submodules=all > output &&
1131 test_cmp expect output
1132 '
wt-status.c
+43 -43
@@ -131,16 +131,16 @@ static void wt_status_print_unmerged_header(struct wt_status *s)
131 {
132 const char *c = color(WT_STATUS_HEADER, s);
133
134 - status_printf_ln(s, c, "Unmerged paths:");
134 + status_printf_ln(s, c, _("Unmerged paths:"));
135 if (!advice_status_hints)
136 return;
137 if (s->in_merge)
138 ;
139 else if (!s->is_initial)
140 - status_printf_ln(s, c, " (use \"git reset %s <file>...\" to unstage)", s->reference);
140 + status_printf_ln(s, c, _(" (use \"git reset %s <file>...\" to unstage)"), s->reference);
141 else
142 - status_printf_ln(s, c, " (use \"git rm --cached <file>...\" to unstage)");
143 - status_printf_ln(s, c, " (use \"git add/rm <file>...\" as appropriate to mark resolution)");
142 + status_printf_ln(s, c, _(" (use \"git rm --cached <file>...\" to unstage)"));
143 + status_printf_ln(s, c, _(" (use \"git add/rm <file>...\" as appropriate to mark resolution)"));
144 status_printf_ln(s, c, "");
145 }
146
@@ -154,9 +154,9 @@ static void wt_status_print_cached_header(struct wt_status *s)
154 if (s->in_merge)
155 ; /* NEEDSWORK: use "git reset --unresolve"??? */
156 else if (!s->is_initial)
157 - status_printf_ln(s, c, " (use \"git reset %s <file>...\" to unstage)", s->reference);
157 + status_printf_ln(s, c, _(" (use \"git reset %s <file>...\" to unstage)"), s->reference);
158 else
159 - status_printf_ln(s, c, " (use \"git rm --cached <file>...\" to unstage)");
159 + status_printf_ln(s, c, _(" (use \"git rm --cached <file>...\" to unstage)"));
160 status_printf_ln(s, c, "");
161 }
162
@@ -166,16 +166,16 @@ static void wt_status_print_dirty_header(struct wt_status *s,
166 {
167 const char *c = color(WT_STATUS_HEADER, s);
168
169 - status_printf_ln(s, c, "Changes not staged for commit:");
169 + status_printf_ln(s, c, _("Changes not staged for commit:"));
170 if (!advice_status_hints)
171 return;
172 if (!has_deleted)
173 - status_printf_ln(s, c, " (use \"git add <file>...\" to update what will be committed)");
173 + status_printf_ln(s, c, _(" (use \"git add <file>...\" to update what will be committed)"));
174 else
175 - status_printf_ln(s, c, " (use \"git add/rm <file>...\" to update what will be committed)");
176 - status_printf_ln(s, c, " (use \"git checkout -- <file>...\" to discard changes in working directory)");
175 + status_printf_ln(s, c, _(" (use \"git add/rm <file>...\" to update what will be committed)"));
176 + status_printf_ln(s, c, _(" (use \"git checkout -- <file>...\" to discard changes in working directory)"));
177 if (has_dirty_submodules)
178 - status_printf_ln(s, c, " (commit or discard the untracked or modified content in submodules)");
178 + status_printf_ln(s, c, _(" (commit or discard the untracked or modified content in submodules)"));
179 status_printf_ln(s, c, "");
180 }
181
@@ -184,10 +184,10 @@ static void wt_status_print_other_header(struct wt_status *s,
184 const char *how)
185 {
186 const char *c = color(WT_STATUS_HEADER, s);
187 - status_printf_ln(s, c, "%s files:", what);
187 + status_printf_ln(s, c, _("%s files:"), what);
188 if (!advice_status_hints)
189 return;
190 - status_printf_ln(s, c, " (use \"git %s <file>...\" to include in what will be committed)", how);
190 + status_printf_ln(s, c, _(" (use \"git %s <file>...\" to include in what will be committed)"), how);
191 status_printf_ln(s, c, "");
192 }
193
@@ -204,18 +204,18 @@ static void wt_status_print_unmerged_data(struct wt_status *s,
204 const char *c = color(WT_STATUS_UNMERGED, s);
205 struct wt_status_change_data *d = it->util;
206 struct strbuf onebuf = STRBUF_INIT;
207 - const char *one, *how = "bug";
207 + const char *one, *how = _("bug");
208
209 one = quote_path(it->string, -1, &onebuf, s->prefix);
210 status_printf(s, color(WT_STATUS_HEADER, s), "\t");
211 switch (d->stagemask) {
212 - case 1: how = "both deleted:"; break;
213 - case 2: how = "added by us:"; break;
214 - case 3: how = "deleted by them:"; break;
215 - case 4: how = "added by them:"; break;
216 - case 5: how = "deleted by us:"; break;
217 - case 6: how = "both added:"; break;
218 - case 7: how = "both modified:"; break;
212 + case 1: how = _("both deleted:"); break;
213 + case 2: how = _("added by us:"); break;
214 + case 3: how = _("deleted by them:"); break;
215 + case 4: how = _("added by them:"); break;
216 + case 5: how = _("deleted by us:"); break;
217 + case 6: how = _("both added:"); break;
218 + case 7: how = _("both modified:"); break;
219 }
220 status_printf_more(s, c, "%-20s%s\n", how, one);
221 strbuf_release(&onebuf);
@@ -245,11 +245,11 @@ static void wt_status_print_change_data(struct wt_status *s,
245 if (d->new_submodule_commits || d->dirty_submodule) {
246 strbuf_addstr(&extra, " (");
247 if (d->new_submodule_commits)
248 - strbuf_addf(&extra, "new commits, ");
248 + strbuf_addf(&extra, _("new commits, "));
249 if (d->dirty_submodule & DIRTY_SUBMODULE_MODIFIED)
250 - strbuf_addf(&extra, "modified content, ");
250 + strbuf_addf(&extra, _("modified content, "));
251 if (d->dirty_submodule & DIRTY_SUBMODULE_UNTRACKED)
252 - strbuf_addf(&extra, "untracked content, ");
252 + strbuf_addf(&extra, _("untracked content, "));
253 strbuf_setlen(&extra, extra.len - 2);
254 strbuf_addch(&extra, ')');
255 }
@@ -263,31 +263,31 @@ static void wt_status_print_change_data(struct wt_status *s,
263 status_printf(s, color(WT_STATUS_HEADER, s), "\t");
264 switch (status) {
265 case DIFF_STATUS_ADDED:
266 - status_printf_more(s, c, "new file: %s", one);
266 + status_printf_more(s, c, _("new file: %s"), one);
267 break;
268 case DIFF_STATUS_COPIED:
269 - status_printf_more(s, c, "copied: %s -> %s", one, two);
269 + status_printf_more(s, c, _("copied: %s -> %s"), one, two);
270 break;
271 case DIFF_STATUS_DELETED:
272 - status_printf_more(s, c, "deleted: %s", one);
272 + status_printf_more(s, c, _("deleted: %s"), one);
273 break;
274 case DIFF_STATUS_MODIFIED:
275 - status_printf_more(s, c, "modified: %s", one);
275 + status_printf_more(s, c, _("modified: %s"), one);
276 break;
277 case DIFF_STATUS_RENAMED:
278 status_printf_more(s, c, "renamed: %s -> %s", one, two);
279 break;
280 case DIFF_STATUS_TYPE_CHANGED:
281 - status_printf_more(s, c, "typechange: %s", one);
281 + status_printf_more(s, c, _("typechange: %s"), one);
282 break;
283 case DIFF_STATUS_UNKNOWN:
284 - status_printf_more(s, c, "unknown: %s", one);
284 + status_printf_more(s, c, _("unknown: %s"), one);
285 break;
286 case DIFF_STATUS_UNMERGED:
287 - status_printf_more(s, c, "unmerged: %s", one);
287 + status_printf_more(s, c, _("unmerged: %s"), one);
288 break;
289 default:
290 - die("bug: unhandled diff status %c", status);
290 + die(_("bug: unhandled diff status %c"), status);
291 }
292 if (extra.len) {
293 status_printf_more(s, color(WT_STATUS_HEADER, s), "%s", extra.buf);
@@ -707,14 +707,14 @@ void wt_status_print(struct wt_status *s)
707 const char *branch_status_color = color(WT_STATUS_HEADER, s);
708
709 if (s->branch) {
710 - const char *on_what = "On branch ";
710 + const char *on_what = _("On branch ");
711 const char *branch_name = s->branch;
712 if (!prefixcmp(branch_name, "refs/heads/"))
713 branch_name += 11;
714 else if (!strcmp(branch_name, "HEAD")) {
715 branch_name = "";
716 branch_status_color = color(WT_STATUS_NOBRANCH, s);
717 - on_what = "Not currently on any branch.";
717 + on_what = _("Not currently on any branch.");
718 }
719 status_printf(s, color(WT_STATUS_HEADER, s), "");
720 status_printf_more(s, branch_status_color, "%s", on_what);
@@ -739,29 +739,29 @@ void wt_status_print(struct wt_status *s)
739 wt_status_print_submodule_summary(s, 1); /* unstaged */
740 }
741 if (s->show_untracked_files) {
742 - wt_status_print_other(s, &s->untracked, "Untracked", "add");
742 + wt_status_print_other(s, &s->untracked, _("Untracked"), "add");
743 if (s->show_ignored_files)
744 - wt_status_print_other(s, &s->ignored, "Ignored", "add -f");
744 + wt_status_print_other(s, &s->ignored, _("Ignored"), "add -f");
745 } else if (s->commitable)
746 - status_printf_ln(s, GIT_COLOR_NORMAL, "Untracked files not listed%s",
746 + status_printf_ln(s, GIT_COLOR_NORMAL, _("Untracked files not listed%s"),
747 advice_status_hints
748 - ? " (use -u option to show untracked files)" : "");
748 + ? _(" (use -u option to show untracked files)") : "");
749
750 if (s->verbose)
751 wt_status_print_verbose(s);
752 if (!s->commitable) {
753 if (s->amend)
754 - status_printf_ln(s, GIT_COLOR_NORMAL, "No changes");
754 + status_printf_ln(s, GIT_COLOR_NORMAL, _("No changes"));
755 else if (s->nowarn)
756 ; /* nothing */
757 else if (s->workdir_dirty)
758 - printf("no changes added to commit%s\n",
758 + printf(_("no changes added to commit%s\n"),
759 advice_status_hints
760 - ? " (use \"git add\" and/or \"git commit -a\")" : "");
760 + ? _(" (use \"git add\" and/or \"git commit -a\")") : "");
761 else if (s->untracked.nr)
762 - printf("nothing added to commit but untracked files present%s\n",
762 + printf(_("nothing added to commit but untracked files present%s\n"),
763 advice_status_hints
764 - ? " (use \"git add\" to track)" : "");
764 + ? _(" (use \"git add\" to track)") : "");
765 else if (s->is_initial)
766 printf("nothing to commit%s\n", advice_status_hints
767 ? " (create/copy files and use \"git add\" to track)" : "");