This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

translating "idletime"

Help for those learning Tcl or writing their own scripts.
Post Reply
T
Torrevado
Op
Posts: 101
Joined: Wed Aug 02, 2006 6:29 pm

translating "idletime"

Post by Torrevado »

I'd like to translate "$idletime", would it be possible?

Code: Select all

proc whois:idle { from keyword arguments } {
		set channel $::whoischannel
		set target $::whoistarget
		set idletime [lindex [split $arguments] 2]
		set signon [lindex [split $arguments] 3]
		whois:putmsg $channel "$target idle: [duration $idletime]. Signed on [ctime $signon]"
		unbind RAW - 317 whois:idle
	}
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Re: translating "unixtime"

Post by speechles »

Code: Select all

whois:putmsg $channel "$target idle: [string map {"years" "tyears"
"weeks" "tweeks" "days" "tdays" "hours" "thours" "minutes" "tminutes" "seconds" "tseconds"} [duration $idletime]]. Sined on [ctime $signon]"
Pretend the above is all on one line, the string map delineated by spaces. In the string map, change each reference starting with T to your translated word for each. String map can also be used for translating the signed on time.
T
Torrevado
Op
Posts: 101
Joined: Wed Aug 02, 2006 6:29 pm

translating "unixtime"

Post by Torrevado »

Thanks speechles :wink:
Post Reply