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

[PATCH] help: mark common_guides[] as translatable

From
Simon Ruderich <simon@ruderich.org>
Date
Apr 12, 2013, 13:51 UTC
Message-ID
<20130412135142.GA29454@ruderich.org>
In-Reply-To
<1364942392-576-5-git-send-email-philipoakley@iee.org>
Signed-off-by: Simon Ruderich <simon@ruderich.org>
---
On Tue, Apr 02, 2013 at 11:39:51PM +0100, Philip Oakley wrote:
Show 20 quoted lines
> --- a/help.c
> +++ b/help.c
> @@ -240,6 +241,23 @@ void list_common_cmds_help(void)
>  	}
>  }
>
> +void list_common_guides_help(void)
> +{
> +	int i, longest = 0;
> +
> +	for (i = 0; i < ARRAY_SIZE(common_guides); i++) {
> +		if (longest < strlen(common_guides[i].name))
> +			longest = strlen(common_guides[i].name);
> +	}
> +
> +	puts(_("The common Git guides are:\n"));
> +	for (i = 0; i < ARRAY_SIZE(common_guides); i++) {
> +		printf("   %s   ", common_guides[i].name);
> +		mput_char(' ', longest - strlen(common_guides[i].name));
> +		puts(_(common_guides[i].help));

common_guides[] is used here, but without N_() not picked up by xgettext when creating the pot file.

Regards Simon

 builtin/help.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/builtin/help.c b/builtin/help.c
index 034c36c..062957f 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -419,13 +419,13 @@ static struct {
 	const char *name;
 	const char *help;
 } common_guides[] = {
-	{ "attributes", "Defining attributes per path" },
-	{ "glossary", "A Git glossary" },
-	{ "ignore", "Specifies intentionally untracked files to ignore" },
-	{ "modules", "Defining submodule properties" },
-	{ "revisions", "Specifying revisions and ranges for Git" },
-	{ "tutorial", "A tutorial introduction to Git (for version 1.5.1 or newer)" },
-	{ "workflows", "An overview of recommended workflows with Git"},
+	{ "attributes", N_("Defining attributes per path") },
+	{ "glossary", N_("A Git glossary") },
+	{ "ignore", N_("Specifies intentionally untracked files to ignore") },
+	{ "modules", N_("Defining submodule properties") },
+	{ "revisions", N_("Specifying revisions and ranges for Git") },
+	{ "tutorial", N_("A tutorial introduction to Git (for version 1.5.1 or newer)") },
+	{ "workflows", N_("An overview of recommended workflows with Git") },
 };
 
 static void list_common_guides_help(void)
-- 
1.8.2.481.g0d034d4

-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
Previous: Eric SunshineNext: Philip Oakley
Message 12 of 16 in “Git help option to list user guides”
  1. 0/5 Git help option to list user guidesPhilip Oakley, Apr 2, 2013
  2. 1/5 Show help: -a and -g option, and 'git help <concept>' usage.Philip Oakley, Apr 2, 2013
  3. Junio C HamanoApr 2, 2013
  4. 2/5 Help.c use OPT_BOOL and refactor logicPhilip Oakley, Apr 2, 2013
  5. Junio C HamanoApr 2, 2013
  6. Junio C HamanoApr 3, 2013
  7. Philip OakleyApr 3, 2013
  8. 3/5 Help.c add --guide optionPhilip Oakley, Apr 2, 2013
  9. 4/5 Help.c: add list_common_guides_help() functionPhilip Oakley, Apr 2, 2013
  10. Junio C HamanoApr 2, 2013
  11. Eric SunshineApr 3, 2013
  12. help: mark common_guides[] as translatableSimon Ruderich, Apr 12, 2013
  13. Philip OakleyApr 12, 2013
  14. 5/5 Help doc: Include --guide option descriptionPhilip Oakley, Apr 2, 2013
  15. Junio C HamanoApr 2, 2013
  16. Eric SunshineApr 3, 2013

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.