Thread (113 messages) flat view 113 messages, 3 authors, 2016-06-15

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

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:50:37
Subsystem: the rest · Maintainer: Linus Torvalds

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

Ævar Arnfjörð Bjarmason wrote:
quoted hunk ↗ jump to hunk
--- 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.
quoted hunk ↗ jump to hunk
@@ -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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help