aUCBLogo Demos and Tests / makedemotranslations
setCaseIgnored false
be makedemotranslations
clearText
language="de
load word language "/startup.lg
startup_de
load "en/startup.lg
; startup_en
setCaseIgnored false
translation_en_de=reverse translation_de
foreach tolist translation_en_de
[ t=translation_en_de.(?.2)
if t != []
[ i=?.1
; (pr i t)
translation_en_de.i=t
i=lowercase ?.1
translation_en_de.i=t
i=uppercase ?.1
translation_en_de.i=t
]
]
translation_en_de=(merge
lowerCase translation_en_de
translation_en_de)
translation_en_de=(merge
upperCase translation_en_de
translation_en_de)
; print translation_en_de
fl=(files [*.lg])
foreach fl
[
; pr ?
translateFile ?
]
be translateFile in
inname=remove ".lg in
out=(word language "/ inname "_ language ".lg )
(print in "=> out)
openRead in
setReader in
openWrite out
setWriter out
l=array readListFlatRaw
repeat count l
[ w=l.repcount
if w==inname [w=(word inname "_ language)]
t=translation_en_de.w
ifelse t != []
[ (type t)
][ (type w)
]
]
setReader []
close in
setWriter []
close out
end
end