linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Ext4 Developers List <linux-ext4@vger.kernel.org>
Cc: Aditya Kali <adityakali@google.com>, Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH 5/5] libquota: remove NLS support
Date: Tue,  4 Oct 2011 12:16:38 -0400	[thread overview]
Message-ID: <1317744998-8238-5-git-send-email-tytso@mit.edu> (raw)
In-Reply-To: <1317744998-8238-1-git-send-email-tytso@mit.edu>

In general libraries should never (a) call exit() or (b) print output
directly to the stdout (they might be used by GUI programs.  From (b)
follows (c), should never call internationalization functions
directly.

Also, since po/POTFILES.in wasn't edited, these strings weren't
getting included in e2fsprogs.pot for translation, so the _()
indirection didn't actually buy us anything.

We eventually need to nuke all of the log_fatal() and log_err() from
libquota, so best thing to do for now is remove NLS support
completely; no point whipsawing the translators with strings to
translate that will be disappearing soon anyway!

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 lib/quota/common.h |   30 ++++--------------------------
 1 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/lib/quota/common.h b/lib/quota/common.h
index 48f191f..7b88003 100644
--- a/lib/quota/common.h
+++ b/lib/quota/common.h
@@ -13,41 +13,19 @@
 # endif
 #endif
 
-#ifdef ENABLE_NLS
-#include <libintl.h>
-#include <locale.h>
-#define _(a) (gettext (a))
-#ifdef gettext_noop
-#define N_(a) gettext_noop (a)
-#else
-#define N_(a) (a)
-#endif
-#define P_(singular, plural, n) (ngettext (singular, plural, n))
-#ifndef NLS_CAT_NAME
-#define NLS_CAT_NAME "e2fsprogs"
-#endif
-#ifndef LOCALEDIR
-#define LOCALEDIR "/usr/share/locale"
-#endif
-#else
-#define _(a) (a)
-#define N_(a) a
-#define P_(singular, plural, n) ((n) == 1 ? (singular) : (plural))
-#endif
-
 #define log_fatal(exit_code, format, ...)	do { \
-		fprintf(stderr, _("[FATAL] %s:%d:%s:: " format "\n"), \
+		fprintf(stderr, "[FATAL] %s:%d:%s:: " format "\n", \
 			__FILE__, __LINE__, __func__, __VA_ARGS__); \
 		exit(exit_code); \
 	} while (0)
 
 #define log_err(format, ...)	fprintf(stderr, \
-				_("[ERROR] %s:%d:%s:: " format "\n"), \
+				"[ERROR] %s:%d:%s:: " format "\n", \
 				__FILE__, __LINE__, __func__, __VA_ARGS__)
 
 #ifdef DEBUG_QUOTA
 # define log_debug(format, ...)	fprintf(stderr, \
-				_("[DEBUG] %s:%d:%s:: " format "\n"), \
+				"[DEBUG] %s:%d:%s:: " format "\n", \
 				__FILE__, __LINE__, __func__, __VA_ARGS__)
 #else
 # define log_debug(format, ...)
@@ -55,7 +33,7 @@
 
 #define BUG_ON(x)		do { if ((x)) { \
 					fprintf(stderr, \
-						_("BUG_ON: %s:%d:: ##x"), \
+						"BUG_ON: %s:%d:: ##x", \
 						__FILE__, __LINE__); \
 					exit(2); \
 				} } while (0)
-- 
1.7.4.1.22.gec8e1.dirty


  parent reply	other threads:[~2011-10-04 16:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-04 16:16 [PATCH 1/5] libquota: remove get_qf_path() Theodore Ts'o
2011-10-04 16:16 ` [PATCH 2/5] libquota: clean up some gcc -Wall warnings Theodore Ts'o
2011-10-04 16:16 ` [PATCH 3/5] libquota: remove get_qf_name() Theodore Ts'o
2011-10-04 16:16 ` [PATCH 4/5] libquota: use ext2_loff_t instead of loff_t Theodore Ts'o
2011-10-04 16:16 ` Theodore Ts'o [this message]
2011-10-04 16:24   ` [PATCH 5/5] libquota: remove NLS support Aditya Kali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317744998-8238-5-git-send-email-tytso@mit.edu \
    --to=tytso@mit.edu \
    --cc=adityakali@google.com \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).