summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pacman/pacman.c5
-rw-r--r--src/pacman/util.h10
2 files changed, 9 insertions, 6 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 2f6f9280..705edafa 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -30,7 +30,6 @@
#include <unistd.h>
#include <sys/types.h>
#include <sys/utsname.h> /* uname */
-#include <libintl.h> /* bindtextdomain, textdomain */
#include <locale.h> /* setlocale */
#include <time.h> /* time_t */
#if defined(PACMAN_DEBUG) && defined(HAVE_MTRACE)
@@ -168,6 +167,7 @@ static void version(void)
/** Sets up gettext localization. Safe to call multiple times.
*/
/* Inspired by the monotone function localize_monotone. */
+#if defined(ENABLE_NLS)
static void localize(void)
{
static int init = 0;
@@ -178,6 +178,7 @@ static void localize(void)
init = 1;
}
}
+#endif
/** Set user agent environment variable.
*/
@@ -730,7 +731,9 @@ int main(int argc, char *argv[])
signal(SIGSEGV, cleanup);
/* i18n init */
+#if defined(ENABLE_NLS)
localize();
+#endif
/* set user agent for downloading */
setuseragent();
diff --git a/src/pacman/util.h b/src/pacman/util.h
index 876f8175..2814a780 100644
--- a/src/pacman/util.h
+++ b/src/pacman/util.h
@@ -24,20 +24,20 @@
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
-#include <libintl.h> /* here so it doesn't need to be included elsewhere */
#include <alpm_list.h>
-/* update speed for the fill_progress based functions */
-#define UPDATE_SPEED_SEC 0.2f
-
-/* define _() as shortcut for gettext() */
#ifdef ENABLE_NLS
+#include <libintl.h> /* here so it doesn't need to be included elsewhere */
+/* define _() as shortcut for gettext() */
#define _(str) gettext(str)
#else
#define _(str) str
#endif
+/* update speed for the fill_progress based functions */
+#define UPDATE_SPEED_SEC 0.2f
+
int needs_transaction();
int getcols();
int makepath(const char *path);