summaryrefslogtreecommitdiffstats
path: root/scripts/edmail.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/edmail.in')
-rw-r--r--scripts/edmail.in21
1 files changed, 19 insertions, 2 deletions
diff --git a/scripts/edmail.in b/scripts/edmail.in
index 5413f0c..84b192b 100644
--- a/scripts/edmail.in
+++ b/scripts/edmail.in
@@ -1,10 +1,27 @@
#! @PERL@ -w
use Getopt::Long;
-use POSIX qw(setlocale);
-use Locale::gettext;
use strict;
+# This ugly trick lets the script work even if gettext support is missing.
+# We did so because Locale::gettext doesn't ship with the standard perl
+# distribution.
+BEGIN {
+ if (eval { require Locale::gettext }) {
+ import Locale::gettext;
+ require POSIX;
+ import POSIX, qw(setlocale);
+ } else {
+ eval '
+ use constant LC_MESSAGES => 0;
+ sub setlocale($$) { }
+ sub bindtextdomain($$) { }
+ sub textdomain($) { }
+ sub gettext($) { shift }
+ '
+ }
+}
+
setlocale(LC_MESSAGES, "");
bindtextdomain("quilt", "@LOCALEDIR@");
textdomain("quilt");