git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 06/11] i18n: add--interactive: i18n of help_patch_cmd

From
Vasco Almeida <vascomalmeida@sapo.pt>
Date
Jun 29, 2016, 15:09 UTC
Message-ID
<20160629150945.15015-7-vascomalmeida@sapo.pt>
In-Reply-To
<20160629150945.15015-1-vascomalmeida@sapo.pt>

Mark help message of help_patch_cmd for translation. The message must be unfolded to be free of variables so we can have high quality translations.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 git-add--interactive.perl | 65 +++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 54 insertions(+), 11 deletions(-)
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 5b89b97..acbfa4e 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -1179,15 +1179,58 @@ sub edit_hunk_loop {
 }
 
 sub help_patch_cmd {
-	my $verb = lc $patch_mode_flavour{VERB};
-	my $target = $patch_mode_flavour{TARGET};
-	print colored $help_color, <<EOF ;
-y - $verb this hunk$target
-n - do not $verb this hunk$target
-q - quit; do not $verb this hunk or any of the remaining ones
-a - $verb this hunk and all later hunks in the file
-d - do not $verb this hunk or any of the later hunks in the file
-g - select a hunk to go to
+	if ($patch_mode eq 'stage') {
+		print colored $help_color, __(
+"y - stage this hunk
+n - do not stage this hunk
+q - quit; do not stage this hunk or any of the remaining ones
+a - stage this hunk and all later hunks in the file
+d - do not stage this hunk or any of the later hunks in the file");
+	} elsif ($patch_mode eq 'stash') {
+		print colored $help_color, __(
+"y - stash this hunk
+n - do not stash this hunk
+q - quit; do not stash this hunk or any of the remaining ones
+a - stash this hunk and all later hunks in the file
+d - do not stash this hunk or any of the later hunks in the file");
+	} elsif ($patch_mode eq 'reset_head') {
+		print colored $help_color, __(
+"y - unstage this hunk
+n - do not unstage this hunk
+q - quit; do not unstage this hunk or any of the remaining ones
+a - unstage this hunk and all later hunks in the file
+d - do not unstage this hunk or any of the later hunks in the file");
+	} elsif ($patch_mode eq 'reset_nothead') {
+		print colored $help_color, __(
+"y - apply this hunk to index
+n - do not apply this hunk to index
+q - quit; do not apply this hunk or any of the remaining ones
+a - apply this hunk and all later hunks in the file
+d - do not apply this hunk or any of the later hunks in the file");
+	} elsif ($patch_mode eq 'checkout_index') {
+		print colored $help_color, __(
+"y - discard this hunk from worktree
+n - do not discard this hunk from worktree
+q - quit; do not discard this hunk or any of the remaining ones
+a - discard this hunk and all later hunks in the file
+d - do not discard this hunk or any of the later hunks in the file");
+	} elsif ($patch_mode eq 'checkout_head') {
+		print colored $help_color, __(
+"y - discard this hunk from index and worktree
+n - do not discard this hunk from index and worktree
+q - quit; do not discard this hunk or any of the remaining ones
+a - discard this hunk and all later hunks in the file
+d - do not discard this hunk or any of the later hunks in the file");
+	} elsif ($patch_mode eq 'checkout_nothead') {
+		print colored $help_color, __(
+"y - apply this hunk to index and worktree
+n - do not apply this hunk to index and worktree
+q - quit; do not apply this hunk or any of the remaining ones
+a - apply this hunk and all later hunks in the file
+d - do not apply this hunk or any of the later hunks in the file");
+	}
+	print colored $help_color, "\n", __(
+"g - select a hunk to go to
 / - search for a hunk matching the given regex
 j - leave this hunk undecided, see next undecided hunk
 J - leave this hunk undecided, see next hunk
@@ -1195,8 +1238,8 @@ k - leave this hunk undecided, see previous undecided hunk
 K - leave this hunk undecided, see previous hunk
 s - split the current hunk into smaller hunks
 e - manually edit the current hunk
-? - print help
-EOF
+? - print help"),
+"\n";
 }
 
 sub apply_patch {
-- 
2.7.4
Previous: Vasco AlmeidaNext: Vasco Almeida
Message 7 of 12 in “Mark strings in perl script for translation”
  1. 00/11 Mark strings in perl script for translationVasco Almeida, Jun 29, 2016
  2. 01/11 i18n: add--interactive: mark strings for translationVasco Almeida, Jun 29, 2016
  3. 03/11 i18n: add--interactive: mark strings with interpolation for translationVasco Almeida, Jun 29, 2016
  4. 04/11 i18n: add--interactive: mark plural stringsVasco Almeida, Jun 29, 2016
  5. 02/11 i18n: add--interactive: mark simple here documents for translationVasco Almeida, Jun 29, 2016
  6. 05/11 i18n: add--interactive: mark message for translationVasco Almeida, Jun 29, 2016
  7. 06/11 i18n: add--interactive: i18n of help_patch_cmdVasco Almeida, Jun 29, 2016
  8. 08/11 i18n: send-email: mark strings for translationVasco Almeida, Jun 29, 2016
  9. 07/11 i18n: add--interactive: mark edit_hunk_manually message for translationVasco Almeida, Jun 29, 2016
  10. 09/11 i18n: send-email: mark warnings and errors for translationVasco Almeida, Jun 29, 2016
  11. 10/11 i18n: send-email: mark string with interpolation for translationVasco Almeida, Jun 29, 2016
  12. 11/11 i18n: difftool: mark warnings for translationVasco Almeida, Jun 29, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.