set language(default) 1
set language(french) 0
set language(english) 1
proc lang_regsuball {what by arg} {
regsub -all $what $arg $by arg
return $arg
}
proc lang_text {tabdata lang index argslist } {
global ${tabdata}
array set lang_data [array get ${tabdata}]
set result $lang_data($lang$index)
set argidx 0
foreach arg $argslist {
set result [lang_regsuball "%$argidx" "$arg" $result]
incr argidx
}
return $result
}
proc getlang { hand } {
global language
if {![validuser $hand]} { return $language(default) }
if {[info exists language([getuser $hand XTRA LANG])]} {
return $language([getuser $hand XTRA LANG])
} {
return $language(default)
}
}
bind msg - lang msg_lang
bind dcc - lang dcc_lang
proc msg_lang {nick host hand arg} {
global botnick language
if {![validuser $hand]} { return 0 }
set arg [strlwr [charfilter $arg]]
if {![info exists language($arg)]} {
puthelp "PRIVMSG $nick :The available languages are : french english, choose one of them using /msg $botnick lang <your choice>"
return 0
}
putserv "PRIVMSG $nick :Your language is now : $arg"
setuser $hand XTRA LANG $arg
return 0
}
proc dcc_lang {hand idx arg} {
global language
set arg [strlwr [charfilter $arg]]
if {![info exists language($arg)]} {
putdcc $idx "The available languages are : french english, choose one of them using .lang <your choice>"
return 0
}
putdcc $idx "Your language is now : $arg"
setuser $hand XTRA LANG $arg
return 0
}
putlog "lang.tcl v1.3 by Thor & Tst - Date : 31-08-02 - Command : .lang | /msg $botnick lang"
Sorry for my website/email it's down, cause i could not renew by reasons for work.
now I am Spanish military, and that clears long time and I cannot already dedicate me to tcl's.
Hello, can you put it on some link else? This one is not working anymore. Thank you . Or if somebody else have it (i mean the full archive) please put it on some link and reply.