faru

global i

catch {set i [lindex $argv 0]}
if {$i == ""} {set i 0}

proc traduku {vico teksto} {
set h [open 82 r]
while {[eof $h] != 1} {
set z [gets $h]
if {$vico == "de_Esperanto"} {
set t1 [lindex $z 0]
set t2 ""
catch {set t2 [lindex $z 1]}
}
if {$vico == "al_Esperanto"} {
set t1 [lindex $z 1]
set t2 ""
catch {set t2 [lindex $z 0]}
}
set laenge [string length $t1]
incr laenge -1
set ind 0
while {$ind != -1} {
set ind [string first $t1 $teksto]
set ind2 $ind
incr ind2 $laenge
if {$ind > -1} {
if {$t2 != ""} {set teksto [string replace $teksto $ind $ind2 $t2]}
if {$t2 == ""} {set teksto [string replace $teksto $ind $ind2]}}}}
close $h
return $teksto}

proc prilaboru_fontotekston {nombro} {
set h [open $nombro r]
set enhavo [read $h]
close $h
set enhavo [traduku de_Esperanto $enhavo]
eval $enhavo}

proc faru_kio_staras_en_la_tekstofenestro {} {
set teksto ""
catch {set teksto [.t get sel.first sel.last]}
if {$teksto == ""} {set teksto [.t get 0.0 end]}
set teksto [traduku de_Esperanto $teksto]
eval $teksto}

proc bgerror { mes } {
global errorInfo
toplevel .top3
wm title .top3 Aplikoeraro
button .top3.b1 -text "                ERARO!!!             " -command {destroy .top3}
pack .top3.b1
set h [open 25 w+]
puts $h "$mes 

$errorInfo"
close $h
}

# por uzo de unikodo
encoding system utf-8

# dosierujo, kie troviĝas la skriptoj
cd /home/knoppix/Esperanto-tcl

# fontoteksto, kiu estas prilaborata
prilaboru_fontotekston $i