gt-tools 0.1.4.4 → 0.2.1
raw patch · 7 files changed
+25/−39 lines, 7 filesdep +textdep ~basedep ~gtksetup-changed
Dependencies added: text
Dependency ranges changed: base, gtk
Files
- .gitignore +0/−5
- Gtc/gtc.hs +0/−7
- Gtg/gtg.hs +7/−11
- README +6/−4
- Setup.hs +5/−0
- Setup.lhs +0/−6
- gt-tools.cabal +7/−6
− .gitignore
@@ -1,5 +0,0 @@-dist-*.o-*.hi-Gtc/gtc-Gtg/gtg
Gtc/gtc.hs view
@@ -11,7 +11,6 @@ import System.Environment import System.Exit import System.Posix.Terminal-import qualified System.Environment.UTF8 as U import qualified Control.Exception.Extensible as E usage :: IO()@@ -35,13 +34,7 @@ main :: IO() main = do-#if MIN_VERSION_base(4,4,0)- -- returns proper String args <- getArgs-#else- -- TODO: Need to detecet terminal encoding and make convertion- args <- U.getArgs-#endif case args of "-i":rest -> interactiveLoop rest
Gtg/gtg.hs view
@@ -9,21 +9,15 @@ import Graphics.UI.Gtk.Glade import Paths_gt_tools(getDataDir) import Data.List (elemIndex)-import System.Environment.UTF8-import qualified System.Environment.UTF8 as U+import qualified Data.Text as T+import qualified System.Environment as E comboIndex :: [String] -> String -> Int comboIndex xs x = maybe (-1) (id) (x `elemIndex` xs) main :: IO() main = do-#if MIN_VERSION_base(4,4,0)- -- returns proper String- args <- getArgs-#else- -- TODO: Need to detecet terminal encoding and make convertion- args <- U.getArgs-#endif+ args <- E.getArgs let fromL = if (length args) >= 1 then comboIndex langs (args !! 0) else -1 let toL = if (length args) >= 2 then comboIndex (tail langs) (args !! 1) else -1 @@ -44,8 +38,10 @@ _ <- comboBoxSetModelText cmb_dest_lang _ <- comboBoxSetModelText cmb_source_lang - mapM_ (comboBoxAppendText cmb_dest_lang ) (tail langs_descrs)- mapM_ (comboBoxAppendText cmb_source_lang) langs_descrs+ let text_langs_descrs = map T.pack langs_descrs++ mapM_ (comboBoxAppendText cmb_dest_lang ) (tail text_langs_descrs)+ mapM_ (comboBoxAppendText cmb_source_lang) text_langs_descrs -- Set active lang from command line comboBoxSetActive cmb_source_lang fromL
README view
@@ -3,15 +3,17 @@ This program translates a single word or a sentence through http://translate.google.com. To use program you need to specify fromLang, toLang and text for translation.-Lang is 2 sumbols code, i.e. en, ru, be.+Lang is 2 symbol code, i.e. 'en', 'ru', 'be'. How to install: 1) cabal install Usage example:- 1) gtc en ru test- 2) gtc en ru This is test+ $ gtc en ru test+ $ gtc en ru This is test+ $ gtc en ru+ <interactive line-based mode> (You may want crete aliases in your .bashrc) -For current time GTC supports only UTF-8 console.+For ghc versions 7.2 and older 'gtc' tool supports only UTF-8 consoles.
+ Setup.hs view
@@ -0,0 +1,5 @@+#!/usr/bin/runhaskell+import Distribution.Simple++main :: IO ()+main = defaultMain
− Setup.lhs
@@ -1,6 +0,0 @@-#!/usr/bin/runhaskell -> module Main where-> import Distribution.Simple-> main :: IO ()-> main = defaultMain-
gt-tools.cabal view
@@ -1,5 +1,5 @@ name: gt-tools-version: 0.1.4.4+version: 0.2.1 cabal-version: >= 1.8 build-type: Simple license: GPL@@ -16,10 +16,10 @@ category: Tools author: Mikhail S. Pobolovets stability: stable-tested-with: GHC==6.12.1, GHC==7.6.1+tested-with: GHC==7.6.1 data-files: LICENSE README Gtg/main.glade data-dir: ""-extra-source-files: Setup.lhs+extra-source-files: Setup.hs flag gui description: Use this flag if you wish to build GUI version@@ -32,7 +32,7 @@ hs-source-dirs: ., Gtc other-modules: Gt.Core, Gt.Helpers, Gt.Langs, Gt.Net, Gt.Translation build-depends:- base >= 4.2 && < 5,+ base >= 4.4 && < 5, containers, extensible-exceptions, haskeline,@@ -56,9 +56,10 @@ containers, HTTP, json,- url,- gtk, glade,+ gtk >= 0.13,+ text,+ url, utf8-string >= 0.3.6 else buildable: False