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

[PATCH v2 02/11] i18n: add--interactive: mark simple here documents for translation

From
Vasco Almeida <vascomalmeida@sapo.pt>
Date
Jun 29, 2016, 15:09 UTC
Message-ID
<20160629150945.15015-3-vascomalmeida@sapo.pt>
In-Reply-To
<20160629150945.15015-1-vascomalmeida@sapo.pt>
Mark messages in here document without interpolation for translation.

Marking for translation by removing here documents this way, rather than take advantage of "print __ << EOF" way, makes other instances of help messages in clean.c match the first two in this file. Otherwise, reusing here document would add a trailer newline to the message, making them not match 100%, hence creating two entries in pot template for translation rather than a single entry.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
---
 git-add--interactive.perl | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index fb8e5de..e11a33d 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -636,25 +636,25 @@ sub list_and_choose {
 }
 
 sub singleton_prompt_help_cmd {
-	print colored $help_color, <<\EOF ;
-Prompt help:
+	print colored $help_color, __(
+"Prompt help:
 1          - select a numbered item
 foo        - select item based on unique prefix
-           - (empty) select nothing
-EOF
+           - (empty) select nothing"),
+"\n";
 }
 
 sub prompt_help_cmd {
-	print colored $help_color, <<\EOF ;
-Prompt help:
+	print colored $help_color, __(
+"Prompt help:
 1          - select a single item
 3-5        - select a range of items
 2-3,6-9    - select multiple ranges
 foo        - select item based on unique prefix
 -...       - unselect specified items
 *          - choose all items
-           - (empty) finish selecting
-EOF
+           - (empty) finish selecting"),
+"\n";
 }
 
 sub status_cmd {
@@ -1573,14 +1573,14 @@ sub quit_cmd {
 }
 
 sub help_cmd {
-	print colored $help_color, <<\EOF ;
-status        - show paths with changes
+	print colored $help_color, __(
+"status        - show paths with changes
 update        - add working tree state to the staged set of changes
 revert        - revert staged set of changes back to the HEAD version
 patch         - pick hunks and update selectively
 diff	      - view diff between HEAD and index
-add untracked - add contents of untracked files to the staged set of changes
-EOF
+add untracked - add contents of untracked files to the staged set of changes"),
+"\n";
 }
 
 sub process_args {
-- 
2.7.4
Previous: Vasco AlmeidaNext: Vasco Almeida
Message 5 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.