Skip to content

Commit 50bd8b7

Browse files
pcloudsgitster
authored andcommitted
status: remove i18n legos
"%s files" gives no sense what "%s" might be. Give translators full phrases. "blah blah blah%s\n" where %s is another sentence does not show the real length of full line. As a result, l10n messages may exceed 80 columns unintentionally. Make it two sentences. Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 871e293 commit 50bd8b7

File tree

1 file changed

+28
-20
lines changed

1 file changed

+28
-20
lines changed

wt-status.c

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static void wt_status_print_other_header(struct wt_status *s,
221221
const char *how)
222222
{
223223
const char *c = color(WT_STATUS_HEADER, s);
224-
status_printf_ln(s, c, _("%s files:"), what);
224+
status_printf_ln(s, c, "%s:", what);
225225
if (!advice_status_hints)
226226
return;
227227
status_printf_ln(s, c, _(" (use \"git %s <file>...\" to include in what will be committed)"), how);
@@ -1008,9 +1008,9 @@ void wt_status_print(struct wt_status *s)
10081008
wt_status_print_submodule_summary(s, 1); /* unstaged */
10091009
}
10101010
if (s->show_untracked_files) {
1011-
wt_status_print_other(s, &s->untracked, _("Untracked"), "add");
1011+
wt_status_print_other(s, &s->untracked, _("Untracked files"), "add");
10121012
if (s->show_ignored_files)
1013-
wt_status_print_other(s, &s->ignored, _("Ignored"), "add -f");
1013+
wt_status_print_other(s, &s->ignored, _("Ignored files"), "add -f");
10141014
} else if (s->commitable)
10151015
status_printf_ln(s, GIT_COLOR_NORMAL, _("Untracked files not listed%s"),
10161016
advice_status_hints
@@ -1023,23 +1023,31 @@ void wt_status_print(struct wt_status *s)
10231023
status_printf_ln(s, GIT_COLOR_NORMAL, _("No changes"));
10241024
else if (s->nowarn)
10251025
; /* nothing */
1026-
else if (s->workdir_dirty)
1027-
printf(_("no changes added to commit%s\n"),
1028-
advice_status_hints
1029-
? _(" (use \"git add\" and/or \"git commit -a\")") : "");
1030-
else if (s->untracked.nr)
1031-
printf(_("nothing added to commit but untracked files present%s\n"),
1032-
advice_status_hints
1033-
? _(" (use \"git add\" to track)") : "");
1034-
else if (s->is_initial)
1035-
printf(_("nothing to commit%s\n"), advice_status_hints
1036-
? _(" (create/copy files and use \"git add\" to track)") : "");
1037-
else if (!s->show_untracked_files)
1038-
printf(_("nothing to commit%s\n"), advice_status_hints
1039-
? _(" (use -u to show untracked files)") : "");
1040-
else
1041-
printf(_("nothing to commit%s\n"), advice_status_hints
1042-
? _(" (working directory clean)") : "");
1026+
else if (s->workdir_dirty) {
1027+
if (advice_status_hints)
1028+
printf(_("no changes added to commit "
1029+
"(use \"git add\" and/or \"git commit -a\")\n"));
1030+
else
1031+
printf(_("no changes added to commit\n"));
1032+
} else if (s->untracked.nr) {
1033+
if (advice_status_hints)
1034+
printf(_("nothing added to commit but untracked files "
1035+
"present (use \"git add\" to track)\n"));
1036+
else
1037+
printf(_("nothing added to commit but untracked files present\n"));
1038+
} else if (s->is_initial) {
1039+
if (advice_status_hints)
1040+
printf(_("nothing to commit (create/copy files "
1041+
"and use \"git add\" to track)\n"));
1042+
else
1043+
printf(_("nothing to commit\n"));
1044+
} else if (!s->show_untracked_files) {
1045+
if (advice_status_hints)
1046+
printf(_("nothing to commit (use -u to show untracked files)\n"));
1047+
else
1048+
printf(_("nothing to commit\n"));
1049+
} else
1050+
printf(_("nothing to commit, working directory clean\n"));
10431051
}
10441052
}
10451053

0 commit comments

Comments
 (0)