hgettext 0.1.8 → 0.1.9
raw patch · 2 files changed
+8/−5 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- hgettext.cabal +1/−1
- src/hgettext.hs +7/−4
hgettext.cabal view
@@ -1,5 +1,5 @@ Name: hgettext-Version: 0.1.8+Version: 0.1.9 Cabal-Version: >= 1.6 License: BSD3
src/hgettext.hs view
@@ -10,6 +10,8 @@ import Distribution.Simple.PreProcess.Unlit import Data.List+import Data.Char+import System.FilePath data Options = Options { outputFile :: String,@@ -78,12 +80,13 @@ process opts fl = do t <- mapM read' fl writeFile (outputFile opts) $ writePOTFile $ map (\(n,c) -> formatMessages n $ toTranslate (keyword opts) $ parseModule c) t- where read' "-" = do - s <- getContents- return ("-", either id (\_ -> "") (unlit "-" s))+ where read' "-" = getContents >>= \c -> return ("-", c) read' s = do c <- readFile s- return (s, either id (\_ -> "") (unlit s c))+ -- test for literate haskell file+ if map toLower (takeExtension s) == ".lhs" + then return (s, either id (\_ -> "") (unlit s c))+ else return (s, c) main = getArgs >>= parseArgs >>= uncurry process