diff options
author | Theodore Ts'o <tytso@mit.edu> | 2011-10-04 11:57:53 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-10-04 19:18:15 -0400 |
commit | c93c1bc24becd643ea8948b33cbfd5cedacb215e (patch) | |
tree | df0ca179023e10b3c77b66d1bf32f55a60aa56a2 /lib | |
parent | d6120a2a5e9825557fb36cddb028fe5d4b00afec (diff) | |
download | e2fsprogs-c93c1bc24becd643ea8948b33cbfd5cedacb215e.tar.gz |
libquota: remove NLS support
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>
Diffstat (limited to 'lib')
-rw-r--r-- | 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 48f191f6..7b880033 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) |