diff --git a/lib/src/api/libraryBrowser/MkLang.hs b/lib/src/api/libraryBrowser/MkLang.hs index 94b5fde49..5a255f0b8 100644 --- a/lib/src/api/libraryBrowser/MkLang.hs +++ b/lib/src/api/libraryBrowser/MkLang.hs @@ -1,16 +1,18 @@ - import System.Environment (getArgs) import Data.List.Utils (replace) -name = "LibraryBrowserEng.gf" - main = do a <- getArgs case a of - lang:_ -> do - contents <- readFile name - let name' = replace "Eng" lang name - let contents' = replace "Eng" lang contents - writeFile name' contents' - putStrLn $ "Wrote " ++ name' - _ -> print "You need to provide a language code" + [] -> print "You need to provide a language code" + langs -> mapM_ makeOne langs + +name = "LibraryBrowserEng.gf" + +makeOne "Eng" = putStrLn "Skipping Eng" +makeOne lang = do + contents <- readFile name + let name' = replace "Eng" lang name + let contents' = replace "Eng" lang contents + writeFile name' contents' + putStrLn $ "Wrote " ++ name'