summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will@willthompson.co.uk>2018-05-23 06:54:39 +0100
committerWill Thompson <will@willthompson.co.uk>2018-05-23 07:06:01 +0100
commit5606783f01ce331488cebff182d7d85eb085d089 (patch)
treec96d8c65cb4015a7d0a09082424922cb029ee378
parente3a518ac057320b82d5ccae8476c47f3a77674ee (diff)
Resurrect flag to enable/disable translations
-rw-r--r--bustle.cabal27
-rw-r--r--src-hgettext/Bustle/Translation.hs (renamed from Bustle/Translation.hs)2
-rw-r--r--src-no-hgettext/Bustle/Translation.hs12
3 files changed, 34 insertions, 7 deletions
diff --git a/bustle.cabal b/bustle.cabal
index 4b68e74..3d3db16 100644
--- a/bustle.cabal
+++ b/bustle.cabal
@@ -65,6 +65,10 @@ Source-Repository head
Type: git
Location: git://anongit.freedesktop.org/bustle
+Flag hgettext
+ Description: Enable translations. Since there are no translations this is currently rather pointless.
+ Default: True
+
Flag InteractiveTests
Description: Build interactive test programs
Default: False
@@ -117,14 +121,20 @@ Executable bustle
, glib
, gio
, gtk3
- , hgettext >= 0.1.5
, mtl >= 2.2.1
, pango
, pcap
, process
- , setlocale
, text
, time
+ if flag(hgettext)
+ Build-Depends: hgettext >= 0.1.5
+ , setlocale
+ hs-source-dirs: .
+ , src-hgettext
+ else
+ hs-source-dirs: .
+ , src-no-hgettext
Executable test-monitor
if flag(InteractiveTests)
@@ -150,13 +160,12 @@ Executable test-monitor
-- 0.13.6 doesn't compile with GCC 5: https://github.com/gtk2hs/gtk2hs/issues/104
, gtk3 >= 0.13.7
, glib
- , hgettext
, mtl
, pango
, pcap
- , setlocale
, text
+
Executable dump-messages
if flag(InteractiveTests)
buildable: True
@@ -219,8 +228,14 @@ Test-suite test-renderer
, mtl
, text
, pango
- , hgettext
- , setlocale
, test-framework
, test-framework-hunit
, HUnit
+ if flag(hgettext)
+ Build-Depends: hgettext >= 0.1.5
+ , setlocale
+ hs-source-dirs: .
+ , src-hgettext
+ else
+ hs-source-dirs: .
+ , src-no-hgettext
diff --git a/Bustle/Translation.hs b/src-hgettext/Bustle/Translation.hs
index dadc6e6..a2cd24f 100644
--- a/Bustle/Translation.hs
+++ b/src-hgettext/Bustle/Translation.hs
@@ -20,6 +20,6 @@ initTranslation = do
textDomain (Just domain)
return ()
--- FIXME: I do not like this unsafePerformIO one little bit.
__ :: String -> String
+-- FIXME: I do not like this unsafePerformIO one little bit.
__ = unsafePerformIO . getText
diff --git a/src-no-hgettext/Bustle/Translation.hs b/src-no-hgettext/Bustle/Translation.hs
new file mode 100644
index 0000000..5defaca
--- /dev/null
+++ b/src-no-hgettext/Bustle/Translation.hs
@@ -0,0 +1,12 @@
+module Bustle.Translation
+ (
+ initTranslation
+ , __
+ )
+where
+
+initTranslation :: IO ()
+initTranslation = return ()
+
+__ :: String -> String
+__ = id