Subject: Re: [PATCH 04/72] gettextize: git-init basic messages

From: Jonathan Nieder <[email-masked]>
Date: Sat, 19 Feb 2011 20:21:24 -0600

One more comment.  (The gettextization so far looks good to me.)

Ævar Arnfjörð Bjarmason wrote:

> --- a/builtin/init-db.c
> +++ b/builtin/init-db.c
> @@ -31,7 +31,7 @@ static void safe_create_dir(const char *dir, int share)
>  		}
>  	}
>  	else if (share && adjust_shared_perm(dir))
> -		die("Could not make %s writable by group", dir);
> +		die(_("Could not make %s writable by group"), dir);

Hmm, forgot to include something like the following in the reply to
patch 1.

> @@ -346,7 +346,7 @@ int init_db(const char *template_dir, unsigned int flags)
>  		else if (shared_repository == PERM_EVERYBODY)
>  			sprintf(buf, "%d", OLD_PERM_EVERYBODY);
>  		else
> -			die("oops");
> +			die(_("oops"));

(Not related to this series, but that seems like a pretty unhelpful
error message.)
---
 gettext.h |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/gettext.h b/gettext.h
index 2f806cb..2bd70d4 100644
--- a/gettext.h
+++ b/gettext.h
@@ -5,6 +5,8 @@
 #error "namespace conflict: _ is pre-defined?"
 #endif
 
+#define FORMAT_PRESERVING(n) __attribute__((format_arg(n)))
+
 /*
  * Copyright (c) 2010 Ævar Arnfjörð Bjarmason
  *
@@ -13,7 +15,7 @@
  * a future patch series.
  */
 
-static inline const char *_(const char *msgid)
+static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
 {
 	return msgid;
 }
-- 
1.7.4.1