started a script and format for updating a set of gf files

This commit is contained in:
aarne
2010-04-08 11:52:44 +00:00
parent bade68406e
commit 6aa9363b53
2 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import System
main = do
file:_ <- getArgs
updates <- readFile file >= return . readUpdates
mapM_ (doUpdate file) updates
return ()
type Update = (FilePath, [String])
readUpdates :: String -> [Update]
readUpdates s = []
doUpdate :: FilePath -> Update -> IO ()
doUpdate src (target,ls) = do
s <- readFile target
let beg = dropLastBracket s
let tmp = tmpFile target
writeFile tmp beg
appendFile tmp $ unlines [(line ++ "-- UPDATE FROM " ++ src) | line <- ls]
appendFile tmp "\n}\n"
dropLastBracket s = s

View File

@@ -0,0 +1,12 @@
abstract Greetings
fun GCongratulations : Greeting ;
lin
Eng = ss "congratulations" ;
Fin = ss "onneksi olkoon" ;
Fre = ss "félicitations" ;
Ita = ss "auguri" ;
Swe = ss "grattis" ;