[Tkabber-dev] r722 - in trunk/tkabber: . examples/tools jabberlib-tclxml plugins/filetransfer plugins/general plugins/iq plugins/jidlink plugins/si trans

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Tue Sep 19 01:01:48 MSD 2006


Author: sergei
Date: 2006-09-19 01:01:30 +0400 (Tue, 19 Sep 2006)
New Revision: 722

Added:
   trunk/tkabber/trans.tcl
   trunk/tkabber/trans/
   trunk/tkabber/trans/ru.msg
Modified:
   trunk/tkabber/ChangeLog
   trunk/tkabber/disco.tcl
   trunk/tkabber/examples/tools/jsend.tcl
   trunk/tkabber/examples/tools/rssbot.tcl
   trunk/tkabber/iq.tcl
   trunk/tkabber/jabberlib-tclxml/jabberlib.tcl
   trunk/tkabber/jidlink.tcl
   trunk/tkabber/muc.tcl
   trunk/tkabber/negotiate.tcl
   trunk/tkabber/plugins/filetransfer/http.tcl
   trunk/tkabber/plugins/filetransfer/jidlink.tcl
   trunk/tkabber/plugins/general/avatars.tcl
   trunk/tkabber/plugins/general/remote.tcl
   trunk/tkabber/plugins/iq/browse.tcl
   trunk/tkabber/plugins/iq/last.tcl
   trunk/tkabber/plugins/iq/time.tcl
   trunk/tkabber/plugins/iq/version.tcl
   trunk/tkabber/plugins/jidlink/dtcp.tcl
   trunk/tkabber/plugins/jidlink/ibb.tcl
   trunk/tkabber/plugins/si/ibb.tcl
   trunk/tkabber/plugins/si/socks5.tcl
   trunk/tkabber/privacy.tcl
   trunk/tkabber/si.tcl
   trunk/tkabber/tkabber.tcl
Log:
	* disco.tcl, examples/tools/jsend.tcl, examples/tools/rssbot.tcl,
	  iq.tcl, jabberlib-tclxml/jabberlib.tcl, jidlink.tcl, muc.tcl,
	  negotiate.tcl, plugins/filetransfer/http.tcl,
	  plugins/filetransfer/jidlink.tcl, plugins/general/avatars.tcl,
	  plugins/general/remote.tcl, plugins/iq/browse.tcl,
	  plugins/iq/last.tcl, plugins/iq/time.tcl,
	  plugins/iq/version.tcl, plugins/jidlink/dtcp.tcl,
	  plugins/jidlink/ibb.tcl, plugins/si/ibb.tcl,
	  plugins/si/socks5.tcl, privacy.tcl, si.tcl, tkabber.tcl,
	  trans.tcl, trans/ru.msg: Added xml:lang support in incoming
	  IQ queries. It allows to answer these queries using remote
	  user's locale. Since msgcat is not designed to handle translation
	  to many languages in parallel and it's not very wise to load all
	  translations in msgs/ together new trans.tcl module and new
	  translation files in trans/ subdirectory are added. They
	  currently contain only translations for messages from remote
	  control plugin, so they are relatively short.

	* plugins/general/remote.tcl: Corrected a few typos in the
	  displayed messages.

	* jabberlib-tclxml/jabberlib.tcl: Removed useless -sendto option
	  of jlib::create.


Modified: trunk/tkabber/ChangeLog
===================================================================
--- trunk/tkabber/ChangeLog	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/ChangeLog	2006-09-18 21:01:30 UTC (rev 722)
@@ -1,3 +1,29 @@
+2006-09-18  Sergei Golovan  <sgolovan at nes.ru>
+
+	* disco.tcl, examples/tools/jsend.tcl, examples/tools/rssbot.tcl,
+	  iq.tcl, jabberlib-tclxml/jabberlib.tcl, jidlink.tcl, muc.tcl,
+	  negotiate.tcl, plugins/filetransfer/http.tcl,
+	  plugins/filetransfer/jidlink.tcl, plugins/general/avatars.tcl,
+	  plugins/general/remote.tcl, plugins/iq/browse.tcl,
+	  plugins/iq/last.tcl, plugins/iq/time.tcl,
+	  plugins/iq/version.tcl, plugins/jidlink/dtcp.tcl,
+	  plugins/jidlink/ibb.tcl, plugins/si/ibb.tcl,
+	  plugins/si/socks5.tcl, privacy.tcl, si.tcl, tkabber.tcl,
+	  trans.tcl, trans/ru.msg: Added xml:lang support in incoming
+	  IQ queries. It allows to answer these queries using remote
+	  user's locale. Since msgcat is not designed to handle translation
+	  to many languages in parallel and it's not very wise to load all
+	  translations in msgs/ together new trans.tcl module and new
+	  translation files in trans/ subdirectory are added. They
+	  currently contain only translations for messages from remote
+	  control plugin, so they are relatively short.
+
+	* plugins/general/remote.tcl: Corrected a few typos in the
+	  displayed messages.
+
+	* jabberlib-tclxml/jabberlib.tcl: Removed useless -sendto option
+	  of jlib::create.
+
 2006-09-17  Sergei Golovan  <sgolovan at nes.ru>
 
 	* plugins/iq/version.tcl: Added code for reporting Arch Linux

Modified: trunk/tkabber/disco.tcl
===================================================================
--- trunk/tkabber/disco.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/disco.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -240,7 +240,7 @@
 
 ###############################################################################
 
-proc disco::info_query_get_handler {connid from child} {
+proc disco::info_query_get_handler {connid from lang child} {
     variable supported_nodes
     variable node_handlers
     variable supported_features
@@ -253,7 +253,7 @@
 	if {![info exists supported_nodes($node)]} {
 	    return {error cancel not-allowed}
 	} else {
-	    set restags [$node_handlers($node) info $connid $from $child]
+	    set restags [$node_handlers($node) info $connid $from $lang $child]
 	    if {[cequal [lindex $restags 0] error]} {
 		return $restags
 	    } else {
@@ -291,7 +291,7 @@
 
 ###############################################################################
 
-proc disco::items_query_get_handler {connid from child} {
+proc disco::items_query_get_handler {connid from lang child} {
     variable supported_nodes
     variable node_handlers
     variable root_nodes
@@ -303,7 +303,7 @@
 	if {![info exists supported_nodes($node)]} {
 	    return {error cancel not-allowed}
 	} else {
-	    set restags [$node_handlers($node) items $connid $from $child]
+	    set restags [$node_handlers($node) items $connid $from $lang $child]
 	    if {[cequal [lindex $restags 0] error]} {
 		return $restags
 	    } else {
@@ -326,7 +326,7 @@
 	foreach node $root_nodes {
 	    set vars [list jid $myjid]
 	    if {![cequal $supported_nodes($node) ""]} {
-		lappend vars name $supported_nodes($node)
+		lappend vars name [::trans::trans $lang $supported_nodes($node)]
 	    }
 	    if {![cequal $node ""]} {
 		lappend vars node $node

Modified: trunk/tkabber/examples/tools/jsend.tcl
===================================================================
--- trunk/tkabber/examples/tools/jsend.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/examples/tools/jsend.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -232,10 +232,10 @@
 #    ::LOG "client:presence $args"
 }
 
-proc client:iqreply {connid from userid id type child} {
+proc client:iqreply {connid from userid id type lang child} {
     jlib::wrapper:splitxml $child tag vars isempty chdata children
     set xmlns [jlib::wrapper:getattr $vars xmlns]
-    ::LOG "client:iqreply $from $userid $id $type $xmlns"
+    ::LOG "client:iqreply $from $userid $id $type $lang $xmlns"
 
     set result result
     set now [clock seconds]

Modified: trunk/tkabber/examples/tools/rssbot.tcl
===================================================================
--- trunk/tkabber/examples/tools/rssbot.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/examples/tools/rssbot.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -235,10 +235,10 @@
     rssbot::presence $jid $type
 }
 
-proc client:iqreply {connid from userid id type child} {
+proc client:iqreply {connid from userid id type lang child} {
     jlib::wrapper:splitxml $child tag vars isempty chdata children
     set xmlns [jlib::wrapper:getattr $vars xmlns]
-    ::LOG "client:iqreply $from $userid $id $type $xmlns"
+    ::LOG "client:iqreply $from $userid $id $type $lang $xmlns"
 
     set result result
     set now [clock seconds]

Modified: trunk/tkabber/iq.tcl
===================================================================
--- trunk/tkabber/iq.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/iq.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -23,7 +23,7 @@
     set supported_ns [lrmdups $supported_ns]
 }
 
-proc iq::process_iq {connid from useid id type child} {
+proc iq::process_iq {connid from useid id type lang child} {
     variable handler
     variable options
 
@@ -50,7 +50,7 @@
 	set_status [format [::msgcat::mc "%s request from %s"] $xmlns_short $from]
     }
     if {[info exists h]} {
-	set res [$h $connid $from $child]
+	set res [$h $connid $from $lang $child]
 
 	if {$res != {}} {
 	    switch -- [lindex $res 0] {
@@ -81,10 +81,10 @@
     }
 }
 
-proc client:iqreply {connid from useid id type child} {
-    debugmsg iq "IQREPLY: $from; $useid; $id; $type; $child"
+proc client:iqreply {connid from useid id type lang child} {
+    debugmsg iq "IQREPLY: $from; $useid; $id; $type; $lang; $child"
 
-    iq::process_iq $connid $from $useid $id $type $child
+    iq::process_iq $connid $from $useid $id $type $lang $child
 }
 
 

Modified: trunk/tkabber/jabberlib-tclxml/jabberlib.tcl
===================================================================
--- trunk/tkabber/jabberlib-tclxml/jabberlib.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/jabberlib-tclxml/jabberlib.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -210,7 +210,6 @@
     set cacertstore ""
     set certfile ""
     set keyfile ""
-    set send_to 0
 
     foreach {attr val} $args {
 	switch -- $attr {
@@ -227,7 +226,6 @@
 	    -cacertstore    {set cacertstore $val}
 	    -certfile       {set certfile $val}
 	    -keyfile        {set keyfile $val}
-	    -sendto         {set send_to $val}
 	}
     }
 
@@ -271,7 +269,6 @@
     set lib($connid,cacertstore) $cacertstore
     set lib($connid,certfile) $certfile
     set lib($connid,keyfile) $keyfile
-    set lib($connid,send_to) $send_to
     set lib($connid,disconnecting) 0
     set lib($connid,bytes_counter) 0
 
@@ -833,11 +830,12 @@
 
     wrapper:splitxml $xmldata tag vars isempty chdata children
 
-    set usefrom 0
-    set from ""
     if {[wrapper:isattr $vars from]} {
 	set usefrom 1
 	set from [wrapper:getattr $vars from]
+    } else {
+	set usefrom 0
+	set from ""
     }
 
     set xmlns [wrapper:getattr $vars xmlns]
@@ -852,6 +850,12 @@
 	return
     }
 
+    if {[wrapper:isattr $vars xml:lang]} {
+	set lang [wrapper:getattr $vars xml:lang]
+    } else {
+	set lang en
+    }
+
     switch -- $tag {
 	iq {
 	    set useid 0
@@ -967,13 +971,7 @@
 		    return
 		}
 
-		if ($lib($connid,send_to)) {
-		    set param [list -to [wrapper:getattr $vars to]]
-		} else {
-		    set param {}
-		}
-		eval [list client iqreply $connid $from $useid \
-			   $id $type $child] $param
+		client iqreply $connid $from $useid $id $type $lang $child
 	    }
 	}
 	message {
@@ -1017,13 +1015,8 @@
 		}
 	    }
 
-	    if ($lib($connid,send_to)) {
-		set param [list -to [wrapper:getattr $vars to]]
-	    } else {
-		set param {}
-            }
-	    eval [list client message $connid $from $id $type $is_subject \
-		       $subject $body $err $thread $priority $x] $param
+	    client message $connid $from $id $type $is_subject \
+			   $subject $body $err $thread $priority $x
 	}
 	presence {
 	    set type [wrapper:getattr $vars type]
@@ -1038,9 +1031,6 @@
 	    set x        ""
 
 	    set param    ""
-	    if ($lib($connid,send_to)) {
-		lappend param -to [wrapper:getattr $vars to]
-	    }
 
 	    if {[wrapper:isattr $vars id]} {
 		set id [wrapper:getattr $vars id]
@@ -1182,17 +1172,10 @@
 		add_connection_route $connid $jid
 
 		# ...and call client procedures
-		if ($lib($connid,send_to)) {
-		    set param [list -to [wrapper:getattr $vars to]]
-		} else {
-		    set param {}
-		}
 		if $ispush {
-		    eval [list client roster_push $connid $jid $name $groups \
-			       $subsc $ask] $param
+		    client roster_push $connid $jid $name $groups $subsc $ask
 		} else {
-		    eval [list client roster_item $connid $jid $name $groups \
-			       $subsc $ask] $param
+		    client roster_item $connid $jid $name $groups $subsc $ask
 		}
 	    }
 	}

Modified: trunk/tkabber/jidlink.tcl
===================================================================
--- trunk/tkabber/jidlink.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/jidlink.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -147,7 +147,7 @@
 negotiate::register_handler jabber:iq:jidlink jidlink::negotiate_handler
 
 
-proc jidlink::set_handler {connid from child} {
+proc jidlink::set_handler {connid from lang child} {
     debugmsg jidlink "set: [list $from $child]"
 
     jlib::wrapper:splitxml $child tag vars isempty chdata children

Modified: trunk/tkabber/muc.tcl
===================================================================
--- trunk/tkabber/muc.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/muc.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -1481,17 +1481,12 @@
 
 ###############################################################################
 
-proc muc::iq_reply {connid from child} {
-    set res [jlib::wrapper:createtag query \
-		     -vars [list xmlns $::NS(muc)]]
-    return [list result $res]
-}
 
 iq::register_handler get query $::NS(muc) muc::iq_reply
 
 ###############################################################################
 
-proc muc::disco_reply {type connid from child} {
+proc muc::disco_reply {type connid from lang child} {
     variable options
 
     if {!$options(report_muc_rooms)} {

Modified: trunk/tkabber/negotiate.tcl
===================================================================
--- trunk/tkabber/negotiate.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/negotiate.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -4,7 +4,7 @@
     set seq 0
 }
 
-proc negotiate::get_handler {connid from child} {
+proc negotiate::get_handler {connid from lang child} {
     variable handler
 
     debugmsg negotiate "get: [list $from $child]"

Modified: trunk/tkabber/plugins/filetransfer/http.tcl
===================================================================
--- trunk/tkabber/plugins/filetransfer/http.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/plugins/filetransfer/http.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -424,7 +424,7 @@
 }
 
 
-proc http::iq_handler {connid from child} {
+proc http::iq_handler {connid from lang child} {
     jlib::wrapper:splitxml $child tag vars isempty chdata children
 
     set urls ""

Modified: trunk/tkabber/plugins/filetransfer/jidlink.tcl
===================================================================
--- trunk/tkabber/plugins/filetransfer/jidlink.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/plugins/filetransfer/jidlink.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -490,7 +490,7 @@
 	{error cancel not-allowed -text "File Transfer Refused"}
 }
 
-proc ftjl::iq_set_handler {connid from child} {
+proc ftjl::iq_set_handler {connid from lang child} {
     debugmsg filetransfer "FTJL set: [list $from $child]"
 
     jlib::wrapper:splitxml $child tag vars isempty chdata children

Modified: trunk/tkabber/plugins/general/avatars.tcl
===================================================================
--- trunk/tkabber/plugins/general/avatars.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/plugins/general/avatars.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -245,7 +245,7 @@
 
 ##############################################################################
 
-proc ::avatar::iq_reply {connid from child} {
+proc ::avatar::iq_reply {connid from lang child} {
     variable avatar
     variable options
 

Modified: trunk/tkabber/plugins/general/remote.tcl
===================================================================
--- trunk/tkabber/plugins/general/remote.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/plugins/general/remote.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -59,7 +59,7 @@
 
 proc ::remote::register_command {node command name args} {
     variable commands
-      
+
     set commands(command,$node) $command
     set commands(name,$node) $name
     lappend commands(nodes) $node
@@ -68,7 +68,7 @@
 	[namespace current]::common_command_infoitems_handler $name
 }
 
-proc ::remote::common_command_infoitems_handler {type connid from xmllist} {
+proc ::remote::common_command_infoitems_handler {type connid from lang xmllist} {
     variable commands
 
     if {![allow_remote_control $connid $from]} {
@@ -84,18 +84,19 @@
 		[list [jlib::wrapper:createtag identity \
 			   -vars [list category automation \
 				       type command-node \
-				       name $commands(name,$node)]] \
+				       name [::trans::trans $lang \
+						 $commands(name,$node)]]] \
 		      [jlib::wrapper:createtag feature \
 			   -vars [list var $::NS(commands)]]]
 	} else {
 	    return {}
 	}
-    } else { 
-	return {error modify bad-request} 
+    } else {
+	return {error modify bad-request}
     }
 }
 
-proc ::remote::commands_list_handler {type connid from xmllist} {
+proc ::remote::commands_list_handler {type connid from lang xmllist} {
     variable commands
 
     if {![allow_remote_control $connid $from]} {
@@ -103,15 +104,16 @@
     }
 
     set myjid [jlib::connection_jid $connid]
-    
+
     switch -- $type {
 	items {
-	    set items {}	    
+	    set items {}
 	    foreach node $commands(nodes) {
 		lappend items [jlib::wrapper:createtag item \
 				   -vars [list jid $myjid \
 					       node $node \
-					       name $commands(name,$node)]]
+					       name [::trans::trans $lang \
+							 $commands(name,$node)]]]
 	    }
 	    return $items
 	}
@@ -119,13 +121,14 @@
 	    return [list [jlib::wrapper:createtag identity \
 			      -vars [list category automation \
 					  type command-list \
-					  name "Remote control"]]]
+					  name [::trans::trans $lang \
+						    "Remote control"]]]]
 	}
     }
-    return {} 
+    return {}
 }
 
-::disco::register_feature $::NS(commands) {return ""}
+::disco::register_feature $::NS(commands)
 ::disco::register_node $::NS(commands) \
 		       ::remote::commands_list_handler "Remote control"
 
@@ -133,24 +136,25 @@
 # Base engine.
 
 proc ::remote::clear_session {sid node} {
-    variable commands 
-    variable sessions 
+    variable commands
+    variable sessions
 
     if {![info exists commands(command,$node)]} return
-    
-    $commands(command,$node) $sid cancel {} 
 
+    $commands(command,$node) $sid cancel {}
+
     catch {unset sessions(node,$sid)}
     catch {unset sessions(connid,$sid)}
-    catch {unset sessions(from,$sid)}	                
+    catch {unset sessions(from,$sid)}
+    catch {unset sessions(lang,$sid)}
 }
 
-proc ::remote::create_session {node connid from} {
-    variable commands    
+proc ::remote::create_session {node connid from lang} {
+    variable commands
     variable sessions
-    
+
     if {![info exists commands(command,$node)]} return
-    
+
     set cur_time [clock seconds]
     set rnd [random 1000]
 
@@ -158,18 +162,19 @@
 	set cur_time [clock seconds]
 	set rnd [random 1000]
     }
-    
+
     set sid "$cur_time-$rnd"
 
     set sessions(node,$sid) $node
     set sessions(connid,$sid) $connid
     set sessions(from,$sid) $from
+    set sessions(lang,$sid) $lang
 
     return $sid
 }
 
-proc ::remote::command_set_handler {connid from child} {   
-    variable commands    
+proc ::remote::command_set_handler {connid from lang child} {
+    variable commands
     variable sessions
 
     if {![allow_remote_control $connid $from]} {
@@ -178,18 +183,20 @@
 
     jlib::wrapper:splitxml $child tag vars isempty chdata children
 
-    set node [jlib::wrapper:getattr $vars node] 
-    set action [jlib::wrapper:getattr $vars action] 
-    set sid [jlib::wrapper:getattr $vars sessionid] 
+    set node [jlib::wrapper:getattr $vars node]
+    set action [jlib::wrapper:getattr $vars action]
+    set sid [jlib::wrapper:getattr $vars sessionid]
 
-    if {![info exists commands(command,$node)]} { 
+    if {![info exists commands(command,$node)]} {
 	return {error cancel item-not-found}
     }
-       
+
     if {[cequal $sid ""]} {
-	set sid [create_session $node $connid $from]
+	# We use lang only when create session.
+	# Probably it would be better to use it after every request.
+	set sid [create_session $node $connid $from $lang]
     } else {
-	if { ![info exists sessions(node,$sid)] } {
+	if {![info exists sessions(node,$sid)]} {
 	    return [list error cancel bad-request \
 			 -application-specific \
 			     [jlib::wrapper:createtag session-expired \
@@ -204,7 +211,7 @@
 			     [jlib::wrapper:createtag bad-sessionid \
 				  -vars [list xmlns $::NS(commands)]]]
 	}
-    } 
+    }
 
     if {[cequal $action cancel]} {
 	clear_session $sid $node
@@ -216,10 +223,10 @@
     }
 
     set result [$commands(command,$node) $sid $action $children]
-    
+
     set status [lindex $result 0]
     switch -- $status {
-	error { 
+	error {
 	    clear_session $sid $node
 	    return $result
 	}
@@ -231,7 +238,7 @@
 	    clear_session $sid $node
 	    return {error wait internal-server-error}
 	}
-    }            
+    }
 
     return [list result [jlib::wrapper:createtag command \
 			     -vars [list xmlns $::NS(commands) \
@@ -239,16 +246,17 @@
 					 node $node \
 					 status $status] \
 			     -subtags [lrange $result 1 end]]]
-} 
+}
+
 iq::register_handler set command $::NS(commands) ::remote::command_set_handler
 
-# ##########################################
-# Common functions for command implementations. 
+############################################
+# Common functions for command implementations.
 
 # Scheduler for one-step dialogs and wizards
 proc ::remote::standart_scheduler {steps prefix sid action children} {
     variable sessions
-     
+
     if {[cequal $action cancel]} {
 	catch { unset sessions($prefix,step,$sid) }
 	for {set i 1} {$i <= $steps} {incr i} {
@@ -269,7 +277,7 @@
 
 	set sessions($prefix,step,$sid) 1
 	return [$prefix:get_step$sessions($prefix,step,$sid) $sid]
-	
+
     } elseif {$sessions($prefix,step,$sid) < $steps} {
 	# Inner step
 
@@ -279,34 +287,34 @@
 			     [jlib::wrapper:createtag bad-action \
 				  -vars [list xmlns $::NS(commands)]]]
 	}
-	
+
 	set res [$prefix:set_step$sessions($prefix,step,$sid) $sid $children]
 	if {[cequal [lindex $res 0] error]} {
 	    return $res
 	}
-	
-	incr sessions($prefix,step,$sid) 	
+
+	incr sessions($prefix,step,$sid)
 	return [$prefix:get_step$sessions($prefix,step,$sid) $sid]
-	
+
     } else {
 	# Last step
-	if {![cequal $action complete] && ![cequal $action ""]} {	    
+	if {![cequal $action complete] && ![cequal $action ""]} {
 	    return [list error cancel bad-request \
 			 -application-specific \
 			     [jlib::wrapper:createtag bad-action \
 				  -vars [list xmlns $::NS(commands)]]]
 	}
-	
+
 	set res [$prefix:set_step$sessions($prefix,step,$sid) $sid $children]
 	if {[cequal [lindex $res 0] error]} {
 	    return $res
 	}
-	
+
 	return [$prefix:get_finish $sid]
     }
 }
 
-# Parses form result and returns array with values, check for correct form type
+# Parse form result and returns array with values, check for correct form type
 proc ::remote::standart_parseresult {children_b form_type} {
     set result {}
     foreach child $children_b {
@@ -323,7 +331,7 @@
 			     [jlib::wrapper:createtag bad-payload \
 				  -vars [list xmlns $::NS(commands)]]]
 	}
-	
+
 	foreach field [::data::parse_xdata_results $children -hidden 1] {
 	    lassign $field var label value
 	    if {[cequal $var FORM_TYPE]} {
@@ -331,7 +339,7 @@
 		    return [list error cancel bad-request \
 				 -application-specific \
 				     [jlib::wrapper:createtag bad-payload \
-					  -vars [list xmlns $::NS(commands)]]] 
+					  -vars [list xmlns $::NS(commands)]]]
 		}
 	    } else {
 		lappend result $var $value
@@ -350,13 +358,15 @@
 ::remote::register_command "http://jabber.org/protocol/rc#set-status" \
 			   ::remote::change_status "Change status"
 
-# step1: 
+# step1:
 # send standart form
 proc ::remote::change_status:get_step1 {sid} {
     global userstatus
     global textstatus
     global userpriority
+    variable sessions
 
+    set lang $sessions(lang,$sid)
     set fields {}
 
     lappend fields [data::createfieldtag hidden \
@@ -364,30 +374,37 @@
 			-values "http://jabber.org/protocol/rc"]
 
     lappend fields [data::createfieldtag title \
-			-value "Change Status"]
+			-value [::trans::trans $lang "Change Status"]]
     lappend fields [data::createfieldtag instructions \
-			-value "Choose the status and status message"]
-    
+			-value [::trans::trans $lang \
+				    "Choose status, priority, and\
+				     status message"]]
+
     set options {}
-    foreach status {available chat away xa dnd unavailable} {
-	lappend options [list $status $::statusdesc($status)]
+    foreach {status statusdesc} {available   "Available"
+				 chat        "Free to chat"
+				 away        "Away"
+				 xa          "Extended away"
+				 dnd         "Do not disturb"
+				 unavailable "Unavailable"} {
+	lappend options [list $status [::trans::trans $lang $statusdesc]]
     }
     lappend fields [data::createfieldtag list-single \
 			-var status \
-			-label "Status" \
+			-label [::trans::trans $lang "Status"] \
 			-required 1 \
 			-value $userstatus \
 			-options $options]
     lappend fields [data::createfieldtag text-single \
 			-var status-priority \
-			-label "Priority" \
+			-label [::trans::trans $lang "Priority"] \
 			-value $userpriority \
 			-required 1]
     lappend fields [data::createfieldtag text-multi \
 			-var status-message \
-			-label "Message" \
+			-label [::trans::trans $lang "Message"] \
 			-values [split $textstatus "\n"]]
-    
+
     return [list executing [jlib::wrapper:createtag x \
 				-vars [list xmlns $::NS(data) \
 					    type form] \
@@ -397,7 +414,7 @@
 
 proc ::remote::change_status:set_step1 {sid children} {
     variable sessions
-    
+
     set result [remote::standart_parseresult $children \
 					     "http://jabber.org/protocol/rc"]
 
@@ -405,7 +422,7 @@
 	return $result
     }
     array set params $result
-    
+
     if {![info exists params(status)] || \
 	![info exists params(status-priority)]} {
 	return [list error cancel bad-request \
@@ -413,7 +430,7 @@
 			 [jlib::wrapper:createtag bad-payload \
 			      -vars [list xmlns $::NS(commands)]]]
     }
-    
+
     set sessions(change_status,textstatus,$sid) {}
     catch {
 	set sessions(change_status,textstatus,$sid) \
@@ -423,13 +440,13 @@
 	[lindex $params(status) 0]
     set sessions(change_status,userpriority,$sid) \
 	[lindex $params(status-priority) 0]
-    
+
     return {}
 }
 
 proc ::remote::change_status:clear_step1 {sid} {
-    variable sessions 
-    
+    variable sessions
+
     catch { unset sessions(change_status,textstatus,$sid) }
     catch { unset sessions(change_status,userstatus,$sid) }
     catch { unset sessions(change_status,userpriority,$sid) }
@@ -441,16 +458,19 @@
 proc ::remote::change_status:get_finish {sid} {
     variable sessions
     global userstatus
-    global textstatus 
-    global userpriority 
+    global textstatus
+    global userpriority
 
+    set lang $sessions(lang,$sid)
     set textstatus $sessions(change_status,textstatus,$sid)
     set userpriority $sessions(change_status,userpriority,$sid)
     set userstatus $sessions(change_status,userstatus,$sid)
 
     return [list completed [jlib::wrapper:createtag note \
 				-vars {type info} \
-				-chdata "Status was changed successfully"]]
+				-chdata \
+				    [::trans::trans $lang \
+					 "Status was changed successfully"]]]
 }
 
 
@@ -462,12 +482,13 @@
 ::remote::register_command "http://jabber.org/protocol/rc#leave-groupchats" \
 			   ::remote::leave_groupchats "Leave groupchats"
 
-# step1: 
+# step1:
 # allow users to choose which chats to leave
 proc ::remote::leave_groupchats:get_step1 {sid} {
     variable sessions
 
     set options {}
+    set lang $sessions(lang,$sid)
     set connid $sessions(connid,$sid)
     foreach chatid [chat::opened] {
 	set jid [chat::get_jid $chatid]
@@ -483,31 +504,34 @@
     if {[expr [llength $options] == 0]} {
 	return [list completed [jlib::wrapper:createtag note \
 				    -vars {type info} \
-				    -chdata "No groupchats to leave"]]
+				    -chdata [::trans::trans $lang \
+						 "No groupchats to leave"]]]
     }
-    
+
     set fields {}
 
     lappend fields [data::createfieldtag hidden \
 			-var FORM_TYPE \
 			-values "http://jabber.org/protocol/rc"]
     lappend fields [data::createfieldtag title \
-			-value "Leave Groupchats"]
+			-value [::trans::trans $lang "Leave Groupchats"]]
     lappend fields [data::createfieldtag instructions \
-			-value "Choose the groupchats you want to leave"]
+			-value [::trans::trans $lang \
+				    "Choose groupchats you want to leave"]]
 
     lappend fields [data::createfieldtag boolean \
 			-var x-all \
-			-label "Leave all groupchats" -value 0]
+			-label [::trans::trans $lang "Leave all groupchats"] \
+			-value 0]
     lappend fields [data::createfieldtag list-multi \
 			-var groupchats \
-			-label "Groupchats" \
+			-label [::trans::trans $lang "Groupchats"] \
 			-required 1 \
 			-options $options]
     lappend fields [data::createfieldtag text-single \
 			-var x-reason \
-			-label "Reason"]
-    
+			-label [::trans::trans $lang "Reason"]]
+
     return [list executing [jlib::wrapper:createtag x \
 				-vars [list xmlns $::NS(data) \
 					    type form] \
@@ -523,14 +547,14 @@
 	return $result
     }
     array set params $result
-    
+
     if {![info exists params(groupchats)]} {
 	return [list error cancel bad-request \
 		     -application-specific \
 			 [jlib::wrapper:createtag bad-payload \
 			      -vars [list xmlns $::NS(commands)]]]
     }
-    
+
     set sessions(leave_groupchats,all,$sid) $params(all)
     set sessions(leave_groupchats,groupchats,$sid) $params(groupchats)
     set sessions(leave_groupchats,reason,$sid) ""
@@ -547,13 +571,14 @@
     catch {unset sessions(leave_groupchats,all,$sid)}
 }
 
-# finish step 
+# finish step
 # leave groupchats.
-# report 
+# report
 proc ::remote::leave_groupchats:get_finish {sid} {
     variable sessions
 
-    set args [list  -connection $sessions(connid,$sid)]
+    set args [list -connection $sessions(connid,$sid)]
+    set lang $sessions(lang,$sid)
 
     if {![cequal $sessions(leave_groupchats,reason,$sid) ""]} {
 	lappend args -stat $sessions(leave_groupchats,reason,$sid)
@@ -563,25 +588,27 @@
     if $sessions(leave_groupchats,all,$sid) {
 	set connid $sessions(connid,$sid)
 	set sessions(leave_groupchats,groupchats,$sid) ""
-	
+
 	foreach chatid [chat::opened] {
 	    set jid [chat::get_jid $chatid]
 
 	    if {![cequal [chat::get_connid $chatid] $connid]} continue
 	    if {![chat::is_groupchat $chatid]} continue
 	    if {[cequal [get_jid_presence_info show $connid $jid] ""]} continue
-	    
+
 	    lappend sessions(leave_groupchats,groupchats,$sid) $jid
 	}
     }
-    
+
     foreach jid $sessions(leave_groupchats,groupchats,$sid) {
 	eval [list send_presence unavailable -to $jid] $args
     }
 
     return [list completed [jlib::wrapper:createtag note \
 				-vars {type info} \
-				-chdata "Groupchats was leaved successfully"]]
+				-chdata [::trans::trans $lang \
+					     "Groupchats were leaved\
+					      successfully"]]]
 }
 
 ################################
@@ -593,12 +620,13 @@
 ::remote::register_command "http://jabber.org/protocol/rc#forward" \
 			   ::remote::forward "Forward unread messages"
 
-# step1: 
+# step1:
 # form with list of unreaded correspondence
 proc ::remote::forward:get_step1 {sid} {
     variable sessions
 
     set options {}
+    set lang $sessions(lang,$sid)
     set connid $sessions(connid,$sid)
     foreach id [array names ::remote::forward::unread] {
 	lassign $id type chatid
@@ -616,34 +644,43 @@
 
 	set count [llength $::remote::forward::unread($id)]
 
-	lappend options [list $id \
-			      [format "%s: %s %s message(s)" $name $count $type]]
+	lappend options \
+		[list $id \
+		      [format \
+			   [::trans::trans $lang "%s: %s $type message(s)"]
+			   $name $count]]
     }
     if {[expr [llength $options] == 0]} {
 	return [list completed [jlib::wrapper:createtag note \
 				    -vars {type info} \
-				    -chdata "There is no unread messages"]]
+				    -chdata \
+					[::trans::trans $lang \
+					     "There are no unread messages"]]]
     }
-    
+
     set fields {}
 
     lappend fields [data::createfieldtag hidden \
     			-var FORM_TYPE \
     			-values "tkabber:plugins:remote:forward_form"]
     lappend fields [data::createfieldtag title \
-			-value "Forward Unread Messages"]
+			-value [::trans::trans $lang \
+				    "Forward Unread Messages"]]
     lappend fields [data::createfieldtag instructions \
-			-value "Choose from wich chats or groupchats you want to"]
-    
+			-value [::trans::trans $lang \
+				    "Choose from wich chats or groupchats\
+				     you want to"]]
+
     lappend fields [data::createfieldtag boolean \
 			-var all \
-			-label "Forward all messages" \
+			-label [::trans::trans $lang "Forward all messages"] \
 			-value 0]
     lappend fields [data::createfieldtag list-multi \
-			-var chats -label "Forward messages from" \
+			-var chats \
+			-label [::trans::trans $lang "Forward messages from"] \
 			-required 1 \
 			-options $options]
-    
+
     return [list executing [jlib::wrapper:createtag x \
 				-vars [list xmlns $::NS(data) \
 					    type form] \
@@ -652,14 +689,14 @@
 
 proc ::remote::forward:set_step1 {sid children} {
     variable sessions
-    
+
     set result [remote::standart_parseresult $children \
 					     "plugins:remote:forward_form"]
     if {[cequal [lindex $result 0] error]} {
 	return $result
     }
     array set params $result
-    
+
     if {![info exists params(chats)]} {
 	return [list error cancel bad-request \
 		     -application-specific \
@@ -677,22 +714,23 @@
     catch {unset sessions(forward,all,$sid)}
 }
 
-# finish: 
+# finish:
 # forward selected unread messages
 # report
 proc ::remote::forward:get_finish {sid} {
     variable sessions
 
     set connid $sessions(connid,$sid)
+    set lang $sessions(lang,$sid)
     set oto [jlib::connection_jid $connid]
     set target $sessions(from,$sid)
-    
+
     # "all" workaround, will be removed soon
     if $sessions(forward,all,$sid) {
 	set sessions(forward,chats,$sid) {}
-	
+
 	foreach id [array names forward::unread] {
-	    lassign $id type chatid	    
+	    lassign $id type chatid
 	    if {![cequal [chat::get_connid $chatid] $connid]} continue
 	    lappend sessions(forward,chats,$sid) $id
 	}
@@ -705,7 +743,9 @@
     return [list completed \
 		 [jlib::wrapper:createtag note \
 		      -vars {type info} \
-		      -chdata "Unread messages was forwarded successfully"]]
+		      -chdata [::trans::trans $lang \
+				   "Unread messages were forwarded\
+				    successfully"]]]
 }
 
 #############################
@@ -715,16 +755,16 @@
 }
 
 # forwards messages
-# leaves marks that they was forwarded. 
+# leaves marks that they was forwarded.
 # cleanup arrays
 proc ::remote::forward::forward_messages {id connid oto target} {
     variable unread
     variable msgdata
 
     lassign $id type chatid
-    
+
     foreach elem $unread($id) {
-	
+
 	switch -- $type {
 	    groupchat -
 	    chat {
@@ -734,7 +774,7 @@
 		lassign $msgdata($elem) date ofrom body x
 	    }
 	}
-	
+
 	lappend x [jlib::wrapper:createtag addresses \
 		       -vars [list xmlns $::NS(xaddress)] \
 		       -subtags [list [jlib::wrapper:createtag address \
@@ -743,11 +783,11 @@
 				      [jlib::wrapper:createtag address \
 					   -vars [list type oto \
 						       jid $oto]]]]
-	
+
 	lappend x [jlib::wrapper:createtag x \
 		       -vars [list xmlns "jabber:x:delay" \
 				   stamp $date]]
-	
+
 	jlib::send_msg $target -body $body \
 			       -type $type \
 			       -xlist $x \
@@ -761,7 +801,7 @@
 				      "This message was forwarded to %s" \
 				      $target]]
 		pack $lab -anchor w -fill none -expand no -before $elem.title
-		
+
 		catch {unset msgdata($elem)}
 	    }
 	}
@@ -770,7 +810,7 @@
     catch {unset unread($id)}
     switch -- $type {
 	groupchat -
-	chat {   
+	chat {
 	    after idle \
 		  [list ::chat::add_message $chatid $ofrom info \
 			[::msgcat::mc "All unread messages was forwarded to %s." \
@@ -783,9 +823,9 @@
 # store message into the unread if type == chat
 proc ::remote::forward::draw_message_handler {chatid from type body extras} {
     variable unread
-    
-    if {[ifacetk::chat_window_is_active $chatid]} return 
 
+    if {[ifacetk::chat_window_is_active $chatid]} return
+
     if {![lcontain {chat groupchat} $type]} return
 #    if {![cequal chat $type]} return
 
@@ -803,13 +843,13 @@
 # clear list of unread messages with type == chat
 proc ::remote::forward::trace_number_msg {var1 chatid mode} {
     variable unread
-    
+
     if { $::ifacetk::number_msg($chatid) == 0 } {
 	set type $::chat::chats(type,$chatid)
 	set id [list $type $chatid]
 	catch {unset unread($id)}
     }
-    
+
 }
 
 trace variable ::ifacetk::number_msg r ::remote::forward::trace_number_msg
@@ -821,11 +861,11 @@
     upvar 2 $bodyvar body
     variable unread
     variable msgdata
-   
+
     if {!$replyP || [cequal $type error]} {
 	return
     }
-    
+
     set id [list normal [chat::chatid $connid $from]]
 
     if {![info exists unread($id)]} {
@@ -851,13 +891,13 @@
 proc ::remote::forward::on_msgwin_destroy {msgwin id} {
     variable unread
     variable msgdata
-    
+
     if {![info exists unread($id)]} return
 
     if {[set index [lsearch -exact $unread($id) $msgwin]] >= 0} {
 	set unread($id) [lreplace $unread($id) $index $index]
 	catch {unset msgdata($msgwin)}
-    }    
+    }
 
     if { [llength $unread($id)] == 0 } {
 	catch {unset unread($id)}

Modified: trunk/tkabber/plugins/iq/browse.tcl
===================================================================
--- trunk/tkabber/plugins/iq/browse.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/plugins/iq/browse.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -1,7 +1,6 @@
 # $Id$
 
-
-proc iq_browse {connid from child} {
+proc iq_browse {connid from lang child} {
     browser::parse_items $from $child
 
     return {}
@@ -10,8 +9,7 @@
 iq::register_handler set {} jabber:iq:browse \
     [namespace current]::iq_browse
 
-
-proc iq_browse_reply {connid from child} {
+proc iq_browse_reply {connid from lang child} {
     set restags {}
     foreach ns $::iq::supported_ns {
 	lappend restags [jlib::wrapper:createtag ns \
@@ -19,10 +17,10 @@
     }
     
     set res [jlib::wrapper:createtag query \
-		 -vars {xmlns jabber:iq:browse \
+		 -vars {xmlns    jabber:iq:browse \
 			category user \
-			type client \
-			name Tkabber} \
+			type     client \
+			name     Tkabber} \
 		 -subtags $restags]
     
     return [list result $res]
@@ -31,4 +29,3 @@
 iq::register_handler get {} jabber:iq:browse \
     [namespace current]::iq_browse_reply
 
-

Modified: trunk/tkabber/plugins/iq/last.tcl
===================================================================
--- trunk/tkabber/plugins/iq/last.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/plugins/iq/last.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -4,7 +4,7 @@
     [::msgcat::mc "Reply to idle time (jabber:iq:last) requests."] \
     -group IQ -type boolean
 
-proc iq_last {connid from child} {
+proc iq_last {connid from lang child} {
     global idle_command
     global userstatus statusdesc textstatus
     variable options

Modified: trunk/tkabber/plugins/iq/time.tcl
===================================================================
--- trunk/tkabber/plugins/iq/time.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/plugins/iq/time.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -4,7 +4,7 @@
     [::msgcat::mc "Reply to current time (jabber:iq:time) requests."] \
     -group IQ -type boolean
 
-proc iq_time {connid from child} {
+proc iq_time {connid from lang child} {
     variable options
 
     if {!$options(reply_iq_time)} {

Modified: trunk/tkabber/plugins/iq/version.tcl
===================================================================
--- trunk/tkabber/plugins/iq/version.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/plugins/iq/version.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -62,7 +62,7 @@
     return $linux_distribution
 }
 
-proc iq_version {connid from child} {
+proc iq_version {connid from lang child} {
     global version toolkit_version tcl_platform
     variable options
 

Modified: trunk/tkabber/plugins/jidlink/dtcp.tcl
===================================================================
--- trunk/tkabber/plugins/jidlink/dtcp.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/plugins/jidlink/dtcp.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -297,7 +297,7 @@
     }
 }
 
-proc ::dtcp::iq_set_handler {connid from child} {
+proc ::dtcp::iq_set_handler {connid from lang child} {
     jlib::wrapper:splitxml $child tag vars isempty chdata children
 
     if {$tag == "query"} {

Modified: trunk/tkabber/plugins/jidlink/ibb.tcl
===================================================================
--- trunk/tkabber/plugins/jidlink/ibb.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/plugins/jidlink/ibb.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -108,7 +108,7 @@
 
 }
 
-proc ::ibb::iq_set_handler {connid from child} {
+proc ::ibb::iq_set_handler {connid from lang child} {
     jlib::wrapper:splitxml $child tag vars isempty chdata children
 
     if {$tag == "query"} {
@@ -149,7 +149,7 @@
 
 iq::register_handler set query jabber:iq:ibb ibb::iq_set_handler
 
-proc ::ibb::iq_inband_set_handler {connid from child} {
+proc ::ibb::iq_inband_set_handler {connid from lang child} {
     variable stream_key
 
     jlib::wrapper:splitxml $child tag vars isempty chdata children

Modified: trunk/tkabber/plugins/si/ibb.tcl
===================================================================
--- trunk/tkabber/plugins/si/ibb.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/plugins/si/ibb.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -68,7 +68,7 @@
 	-connection $connection(connid,$sid)
 }
 
-proc ibb::iq_set_handler {connid from child} {
+proc ibb::iq_set_handler {connid from lang child} {
     jlib::wrapper:splitxml $child tag vars isempty chdata children
 
     set sid [jlib::wrapper:getattr $vars sid]
@@ -82,7 +82,6 @@
 	}
     }
 
-
     return [list result ""]
 }
 

Modified: trunk/tkabber/plugins/si/socks5.tcl
===================================================================
--- trunk/tkabber/plugins/si/socks5.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/plugins/si/socks5.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -268,7 +268,7 @@
     }
 }
 
-proc socks5::iq_set_handler {connid from child} {
+proc socks5::iq_set_handler {connid from lang child} {
     jlib::wrapper:splitxml $child tag vars isempty chdata children
 
     if {$tag == "query"} {

Modified: trunk/tkabber/privacy.tcl
===================================================================
--- trunk/tkabber/privacy.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/privacy.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -1286,7 +1286,7 @@
 
 ###############################################################################
 
-proc privacy::process_iq {connid from child} {
+proc privacy::process_iq {connid from lang child} {
     if {$from != "" && \
 	    !([string equal -nocase $from [jlib::connection_server $connid]] || \
 	      [string equal -nocase $from [jlib::connection_bare_jid $connid]] || \

Modified: trunk/tkabber/si.tcl
===================================================================
--- trunk/tkabber/si.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/si.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -239,7 +239,7 @@
 negotiate::register_handler jabber:iq:si si::negotiate_handler
 
 
-proc si::set_handler {connid from child} {
+proc si::set_handler {connid from lang child} {
     variable profiledata
     variable transport
 

Modified: trunk/tkabber/tkabber.tcl
===================================================================
--- trunk/tkabber/tkabber.tcl	2006-09-17 20:27:20 UTC (rev 721)
+++ trunk/tkabber/tkabber.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -151,6 +151,8 @@
 
 set sysenc [encoding system]
 encoding system utf-8
+source [file join $rootdir trans.tcl]
+::trans::load [file join $rootdir trans]
 ::msgcat::mcload [file join $rootdir msgs]
 foreach pr [::msgcat::mcpreferences] {
     set f [file join $rootdir msgs "$pr.rc"]

Added: trunk/tkabber/trans/ru.msg
===================================================================
--- trunk/tkabber/trans/ru.msg	                        (rev 0)
+++ trunk/tkabber/trans/ru.msg	2006-09-18 21:01:30 UTC (rev 722)
@@ -0,0 +1,39 @@
+# $Id$
+# Russian translation file for replying to other client queries
+
+::trans::trset ru "Change status" "Изменить статус"
+::trans::trset ru "Change Status" "Изменение статуса"
+::trans::trset ru "Choose from wich chats or groupchats you want to" "Выберите, из каких разговоров или конференций Вы хотите"
+::trans::trset ru "Choose groupchats you want to leave" "Выберите конференции, из которых Вы хотите выйти"
+::trans::trset ru "Choose status, priority, and status message" "Выберите статус, приоритет и статусное сообщение"
+::trans::trset ru "Forward all messages" "Переслать все сообщения"
+::trans::trset ru "Forward messages from" "Переслать сообщения из"
+::trans::trset ru "Forward unread messages" "Переслать непрочитанные сообщения"
+::trans::trset ru "Forward Unread Messages" "Пересылка непрочитанных сообщений"
+::trans::trset ru "Groupchats" "Конференции"
+::trans::trset ru "Groupchats were leaved successfully" "Вы успешно вышли из конференций"
+::trans::trset ru "Leave all groupchats" "Выйти из всех конференций"
+::trans::trset ru "Leave groupchats" "Выйти из конференций"
+::trans::trset ru "Leave Groupchats" "Выход из конференций"
+::trans::trset ru "Message" "Сообщение"
+::trans::trset ru "No groupchats to leave" "Конференций, из которых можно выйти, нет"
+::trans::trset ru "Priority" "Приоритет"
+::trans::trset ru "Reason" "Причина"
+::trans::trset ru "Remote control" "Удалённое управление"
+::trans::trset ru "%s at %s" "%s в %s"
+::trans::trset ru "%s (%s)"
+::trans::trset ru "%s: %s chat message(s)" "%s: %s сообщений в разговоре"
+::trans::trset ru "%s: %s groupchat message(s)" "%s: %s сообщений в конференции"
+::trans::trset ru "%s: %s headline message(s)" "%s: %s новостей"
+::trans::trset ru "%s: %s normal message(s)" "%s: %s обычных сообщений"
+::trans::trset ru "Status" "Статус"
+::trans::trset ru "Status was changed successfully" "Статус изменен успешно"
+::trans::trset ru "There are no unread messages" "Непрочитанных сообщений нет"
+::trans::trset ru "Unread messages were forwarded successfully" "Непрочитанные сообщения пересланы успешно"
+::trans::trset ru "Available" "Доступен"
+::trans::trset ru "Free to chat" "Свободен для разговора"
+::trans::trset ru "Away" "Отошёл"
+::trans::trset ru "Extended away" "Отошёл давно"
+::trans::trset ru "Do not disturb" "Не беспокоить"
+::trans::trset ru "Unavailable" "Недоступен"
+


Property changes on: trunk/tkabber/trans/ru.msg
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: trunk/tkabber/trans.tcl
===================================================================
--- trunk/tkabber/trans.tcl	                        (rev 0)
+++ trunk/tkabber/trans.tcl	2006-09-18 21:01:30 UTC (rev 722)
@@ -0,0 +1,45 @@
+# $Id$
+# Message translation
+
+namespace eval ::trans {
+    variable trans
+    array set trans {}
+}
+
+proc ::trans::loadfile {filepath} {
+    set saved_encoding [encoding system]
+    encoding system utf-8
+    uplevel #0 [list source $filepath]
+    encoding system $saved_encoding
+}
+
+proc ::trans::load {dirpath} {
+    foreach filepath [glob -nocomplain -directory $dirpath *.msg] {
+	loadfile $filepath
+    }
+}
+
+proc ::trans::trset {lang msgfrom {msgto ""}} {
+    variable trans
+
+    if {$msgto != ""} {
+	set trans($lang,$msgfrom) $msgto
+    }
+}
+
+proc ::trans::trans {lang msg} {
+    variable trans
+
+    set langlist [split [string tolower $lang] -]
+    set shortlang [lindex $langlist 0]
+    set longlang [join $langlist _]
+
+    if {[info exists trans($longlang,$msg)]} {
+	return $trans($longlang,$msg)
+    } elseif {[info exists trans($shortlang,$msg)]} {
+	return $trans($shortlang,$msg)
+    } else {
+	return $msg
+    }
+}
+


Property changes on: trunk/tkabber/trans.tcl
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native



More information about the Tkabber-dev mailing list