Use proper NLS macros and detection (so the message translation works again).

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@145 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
Milan Broz
2009-11-16 20:10:20 +00:00
parent 6c900eea72
commit df389199d0
4 changed files with 35 additions and 23 deletions

View File

@@ -4,6 +4,7 @@
* Check in configure if selinux libraries are required in static version.
* Add temporary debug code to find processes locking internal device.
* Simplify build system, use autopoint and clean gettext processing.
* Use proper NLS macros and detection (so the message translation works again).
2009-09-30 Milan Broz <mbroz@redhat.com>
* Fix exported symbols and versions in libcryptsetup.

View File

@@ -10,9 +10,7 @@
#include <unistd.h>
#include <inttypes.h>
#include <libintl.h>
#include <locale.h>
#define _(String) gettext((String))
#include "nls.h"
#define SECTOR_SHIFT 9
#define SECTOR_SIZE (1 << SECTOR_SHIFT)

32
lib/nls.h Normal file
View File

@@ -0,0 +1,32 @@
#ifndef CRYPTSETUP_NLS_H
#define CRYPTSETUP_NLS_H
#ifndef LOCALEDIR
#define LOCALEDIR "/usr/share/locale"
#endif
#ifdef HAVE_LOCALE_H
# include <locale.h>
#else
# undef setlocale
# define setlocale(Category, Locale) /* empty */
#endif
#ifdef ENABLE_NLS
# include <libintl.h>
# define _(Text) gettext (Text)
# ifdef gettext_noop
# define N_(String) gettext_noop (String)
# else
# define N_(String) (String)
# endif
#else
# undef bindtextdomain
# define bindtextdomain(Domain, Directory) /* empty */
# undef textdomain
# define textdomain(Domain) /* empty */
# define _(Text) (Text)
# define N_(Text) (Text)
#endif
#endif /* CRYPTSETUP_H */

View File

@@ -5,26 +5,7 @@
# include <config.h>
#endif
#if HAVE_LOCALE_H
# include <locale.h>
#endif
#if !HAVE_SETLOCALE
# define setlocale(Category, Locale) do { } while (0)
#endif
#ifdef ENABLE_NLS
# include <libintl.h>
# define _(Text) gettext (Text)
#else
# undef bindtextdomain
# define bindtextdomain(Domain, Directory) do { } while (0)
# undef textdomain
# define textdomain(Domain) do { } while (0)
# undef dcgettext
# define dcgettext(Domainname, Text, Category) Text
# define _(Text) Text
#endif
#define N_(Text) (Text)
#include "lib/nls.h"
#define DEFAULT_CIPHER "aes"
#define DEFAULT_LUKS_CIPHER "aes-cbc-essiv:sha256"