Skip to content

Commit

Permalink
Resurrect flag to enable/disable translations
Browse files Browse the repository at this point in the history
  • Loading branch information
wjt committed May 23, 2018
1 parent e3a518a commit 5606783
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
27 changes: 21 additions & 6 deletions bustle.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 12 additions & 0 deletions src-no-hgettext/Bustle/Translation.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module Bustle.Translation
(
initTranslation
, __
)
where

initTranslation :: IO ()
initTranslation = return ()

__ :: String -> String
__ = id

0 comments on commit 5606783

Please sign in to comment.