[GRASS-SVN] r44588 - grass/branches/develbranch_6/visualization/nviz/scripts

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Dec 12 15:28:12 EST 2010


Author: marisn
Date: 2010-12-12 12:28:12 -0800 (Sun, 12 Dec 2010)
New Revision: 44588

Modified:
   grass/branches/develbranch_6/visualization/nviz/scripts/config.tcl
   grass/branches/develbranch_6/visualization/nviz/scripts/nviz2.2_script
   grass/branches/develbranch_6/visualization/nviz/scripts/panel_rquery.tcl
   grass/branches/develbranch_6/visualization/nviz/scripts/panel_scale.tcl
   grass/branches/develbranch_6/visualization/nviz/scripts/panel_sdiff.tcl
   grass/branches/develbranch_6/visualization/nviz/scripts/panel_site.tcl
   grass/branches/develbranch_6/visualization/nviz/scripts/panel_surf.tcl
   grass/branches/develbranch_6/visualization/nviz/scripts/panel_vquery.tcl
   grass/branches/develbranch_6/visualization/nviz/scripts/script_file_tools
   grass/branches/develbranch_6/visualization/nviz/scripts/script_play
   grass/branches/develbranch_6/visualization/nviz/scripts/site_attr.tcl
Log:
More NVIZ strings for translation; Use new ComboBox labels for translation

Modified: grass/branches/develbranch_6/visualization/nviz/scripts/config.tcl
===================================================================
--- grass/branches/develbranch_6/visualization/nviz/scripts/config.tcl	2010-12-12 16:49:36 UTC (rev 44587)
+++ grass/branches/develbranch_6/visualization/nviz/scripts/config.tcl	2010-12-12 20:28:12 UTC (rev 44588)
@@ -106,3 +106,6 @@
 option add *menubutton.borderwidth 1
 option add *button.borderWidth 1
 
+# All supported point types
+set Nv_(siteshapes) [list {x} {sphere} {diamond} {cube} {box} {gyro} {aster} {histogram} ]
+set Nv_(siteshape_names) [list [G_msg "x"] [G_msg "sphere"] [G_msg "diamond"] [G_msg "cube"] [G_msg "box"] [G_msg "gyro"] [G_msg "aster"] [G_msg "histogram"]]

Modified: grass/branches/develbranch_6/visualization/nviz/scripts/nviz2.2_script
===================================================================
--- grass/branches/develbranch_6/visualization/nviz/scripts/nviz2.2_script	2010-12-12 16:49:36 UTC (rev 44587)
+++ grass/branches/develbranch_6/visualization/nviz/scripts/nviz2.2_script	2010-12-12 20:28:12 UTC (rev 44588)
@@ -36,15 +36,6 @@
 global DEBUG
 set DEBUG 0
 
-#Initialize ProcessName variable
-set env(NV_processname) NVIZ
-
-source $src_boot/etc/nviz2.2/scripts/config.tcl
-
-#append bwidget for tooltip stuff
-lappend auto_path $env(GISBASE)/bwidget
-package require -exact BWidget 1.2.1
-
 # Overloading internationalization procedures
 # gui.tcl is not used to have separate translation file for NVIZ
 if [catch {package require msgcat}] {
@@ -58,6 +49,15 @@
 	}
 }
 
+#Initialize ProcessName variable
+set env(NV_processname) NVIZ
+
+source $src_boot/etc/nviz2.2/scripts/config.tcl
+
+#append bwidget for tooltip stuff
+lappend auto_path $env(GISBASE)/bwidget
+package require -exact BWidget 1.2.1
+
 global Nv_ ScriptState ScriptFile ScriptPlaying NvizLoadState
 
 set ScriptPlaying 0
@@ -881,7 +881,7 @@
 	global Nv_
 
 	if {[catch {set file_hook [open $new_file r]} error_code] != 0} then {
-        display_error [G_msg "Error while opening file: %s" $error_code]
+        display_error [format [G_msg "Error while opening file: %s"] $error_code]
         return
 	}
 
@@ -1035,7 +1035,7 @@
 	}
 
 	if {[catch {set file_hook [open $new_file w]} error_code] != 0} then {
-		display_error [G_msg "Error while opening file: %s", $error_code]
+		display_error [format [G_msg "Error while opening file: %s"] $error_code]
 		return
 	}
 

Modified: grass/branches/develbranch_6/visualization/nviz/scripts/panel_rquery.tcl
===================================================================
--- grass/branches/develbranch_6/visualization/nviz/scripts/panel_rquery.tcl	2010-12-12 16:49:36 UTC (rev 44587)
+++ grass/branches/develbranch_6/visualization/nviz/scripts/panel_rquery.tcl	2010-12-12 20:28:12 UTC (rev 44588)
@@ -38,7 +38,7 @@
 set Nv_(what_surfdist)           1
 set Nv_(what_exagsurfdist)       1
 set Nv_(what_pipe)               0
-set Nv_(what_pipe_text)          "Send results to: (no file selected)"
+set Nv_(what_pipe_text)          [G_msg "Send results to: (no file selected)"]
 
 proc mkqueryPanel { BASE } {
     
@@ -49,23 +49,23 @@
     
     # Initialize panel info
     if [catch {set Nv_($BASE)}] {
-	set panel [St_create {window name size priority} $BASE "Raster Query" 1 5]
+	set panel [St_create {window name size priority} $BASE [G_msg "Raster Query"] 1 5]
     } else {
 	set panel $Nv_($BASE)
     }
     
     frame $BASE  -relief flat -borderwidth 0
-    Nv_mkPanelname $BASE "Raster Query Panel"
+    Nv_mkPanelname $BASE [G_msg "Raster Query Panel"]
     
     # Create frame, buttons, and attributes menu
     frame $BASE.bf -relief flat -borderwidth 0
-    checkbutton $BASE.bf.what -text "query on/off" \
+    checkbutton $BASE.bf.what -text [G_msg "query on/off"] \
 		-command whats_here -variable WhatsHere(on)
-    Button $BASE.bf.separate -text Reset -command do_separate \
-    	-bd 1 -width 6 -helptext "Reset most recent query"
-    Button $BASE.bf.clear -text Clear -command clear_text \
-    	-bd 1 -width 6 -helptext "Clear all queries"
-    menubutton $BASE.bf.atts -text Attributes \
+    Button $BASE.bf.separate -text [G_msg "Reset"] -command do_separate \
+    	-bd 1 -width 6 -helptext [G_msg "Reset most recent query"]
+    Button $BASE.bf.clear -text [G_msg "Clear"] -command clear_text \
+    	-bd 1 -width 6 -helptext [G_msg "Clear all queries"]
+    menubutton $BASE.bf.atts -text [G_msg "Attributes"] \
     	-menu $BASE.bf.atts.m -relief raised \
     	-indicatoron 1 -bd 1
     menu $BASE.bf.atts.m
@@ -75,11 +75,7 @@
     
     # Add menu entries for menu
     set theMenu $BASE.bf.atts.m
-    foreach i {{"Map name" "mapname" 0} {"Easting" "easting" 0} {"Northing" "northing" 0} \
-		   {"Elevation" "elevation" 1} {"Category of color map" "colorcat" 0} \
-		   {"XY dist from prev" "xydiff" 0} \
-		   {"XYZ dist from prev" "xyzdiff" 2} {"Dist along surface" "surfdist" 0} \
-		   {"Dist along exag surface" "exagsurfdist" 5}} {
+    foreach i [list [list [G_msg "Map name"] "mapname" 0] [list [G_msg "Easting"] "easting" 0] [list [G_msg "Northing"] "northing" 0] [list [G_msg "Elevation"] "elevation" 1] [list [G_msg "Category of color map"] "colorcat" 0] [list [G_msg "XY dist from prev"] "xydiff" 0] [list [G_msg "XYZ dist from prev"] "xyzdiff" 2] [list [G_msg "Dist along surface"] "surfdist" 0] [list [G_msg "Dist along exag surface"] "exagsurfdist" 5]] {
 
 		$theMenu add checkbutton -label [lindex $i 0] -underline [lindex $i 2] \
 			-offvalue 0 -onvalue 1 -variable Nv_(what_[lindex $i 1])
@@ -89,12 +85,12 @@
     
     # frrame for close button and saving output to a file
     frame $BASE.cf
-    Button $BASE.cf.close -text Close -command "Nv_closePanel $BASE" \
+    Button $BASE.cf.close -text [G_msg "Close"] -command "Nv_closePanel $BASE" \
     	-bd 1 -width 6
     
     Button $BASE.cf.output -textvariable Nv_(what_pipe_text) \
 		-command "whats_pipe_bind $BASE" -bd 1 \
-		-helptext "Select file to receive all future query results"
+		-helptext [G_msg "Select file to receive all future query results"]
 
     pack $BASE.cf.close $BASE.cf.output -side right -expand 0 -fill none
     pack $BASE.cf.output -side left
@@ -127,7 +123,7 @@
     if {$new_file == -1} then return
 
     set Nv_(what_pipe) $new_file
-    set Nv_(what_pipe_text) "Send results to: $new_file"
+    set Nv_(what_pipe_text) [format [G_msg "Send results to: %s"] $new_file]
 }
 
 proc whats_here {} {
@@ -153,8 +149,8 @@
 
     set list [Nget_point_on_surf $x $y]
     if {[llength $list] < 4} {
-	$text insert end "Point not on surface\n"
-	append tot_out "Point not on surface\n"
+	$text insert end [G_msg "Point not on surface\n"]
+	append tot_out [G_msg "Point not on surface\n"]
 	$text yview -pickplace end
 	return
     }
@@ -165,21 +161,21 @@
     set id [lindex $list 3]
     
     if {$Nv_(what_easting)} then {
-	set str [format "Easting: %15.4f\n" $x]
+	set str [format [G_msg "Easting: %15.4f\n"] $x]
 	$text insert end "$str"
 	append tot_out "$str"
 	$text yview -pickplace end
     }
 
     if {$Nv_(what_northing)} then {
-	set str [format "Northing: %15.4f\n" $y]
+	set str [format [G_msg "Northing: %15.4f\n"] $y]
 	$text insert end "$str"
 	append tot_out "$str"
 	$text yview -pickplace end
     }
 
     if {$Nv_(what_elevation)} then {
-	set str [format "Elevation: %15.4f\n" $z]
+	set str [format [G_msg "Elevation: %15.4f\n"] $z]
 	$text insert end "$str"
 	append tot_out "$str"
 	$text yview -pickplace end
@@ -187,8 +183,8 @@
     
     if {$Nv_(what_mapname)} then {
 	set str [Nget_map_name [string range $id 5 end] surf]
-	$text insert end "Surf map: $str"
-	append tot_out "Surf map: $str"
+	$text insert end [format [G_msg "Surf map: %s"] $str]
+	append tot_out [format [G_msg "Surf map: %s"] $str]
 	set str [Nget_cat_at_xy $id topo $x $y]
 	$text insert end "\t$str\n"
 	append tot_out "\t$str\n"
@@ -203,10 +199,10 @@
 	if {[lindex $map_name 0] == "map"} then {
 	    set str [lindex $map_name 1]
 	} else {
-	    set str "constant"
+	    set str [G_msg "constant"]
 	}
-	$text insert end "Color map: $str"
-	append tot_out "Color map: $str"
+	$text insert end [format [G_msg "Color map: %s"] $str]
+	append tot_out [format [G_msg "Color map: %s"] $str]
 	set str [Nget_cat_at_xy $id color $x $y]
 	$text insert end "\t$str\n"
 	append tot_out "\t$str\n"
@@ -225,7 +221,7 @@
 	
 	if {$Nv_(what_xydiff)} then {
 	    set val [expr sqrt(($px-$x)*($px-$x)+($py-$y)*($py-$y))]
-	    set str [format "XY distance from previous: \t%15.4f\n" $val]
+	    set str [format [G_msg "XY distance from previous: \t%15.4f\n"] $val]
 	    $text insert end "$str"
 	    append tot_out "$str"
 	    $text yview -pickplace end
@@ -233,7 +229,7 @@
 
 	if {$Nv_(what_xyzdiff)} then {
 	    set val [expr sqrt(($px-$x)*($px-$x)+($py-$y)*($py-$y)+($pz-$z)*($pz-$z))]
-	    set str [format "XYZ distance from previous: \t%15.4f\n" $val]
+	    set str [format [G_msg "XYZ distance from previous: \t%15.4f\n"] $val]
 	    $text insert end "$str"
 	    append tot_out "$str"
 	    $text yview -pickplace end
@@ -242,7 +238,7 @@
 	if {$WhatsHere(pid) == $id} {
 	    if {$Nv_(what_surfdist)} then {
 		set dist [Nget_dist_along_surf $id $x $y $px $py 0]
-		set str [format "Distance along surface: \t%15.4f\n" $dist]
+		set str [format [G_msg "Distance along surface: \t%15.4f\n"] $dist]
 		$text insert end "$str"
 		append tot_out "$str"
 		$text yview -pickplace end
@@ -253,7 +249,7 @@
 
 	    if {$Nv_(what_exagsurfdist)} then {
 		set dist [Nget_dist_along_surf $id $x $y $px $py 1]
-		set str [format "Distance along exag. surface:%15.4f\n" $dist]
+		set str [format [G_msg "Distance along exag. surface:%15.4f\n"] $dist]
 		$text insert end "$str"
 		append tot_out "$str"
 		$text yview -pickplace end

Modified: grass/branches/develbranch_6/visualization/nviz/scripts/panel_scale.tcl
===================================================================
--- grass/branches/develbranch_6/visualization/nviz/scripts/panel_scale.tcl	2010-12-12 16:49:36 UTC (rev 44587)
+++ grass/branches/develbranch_6/visualization/nviz/scripts/panel_scale.tcl	2010-12-12 20:28:12 UTC (rev 44588)
@@ -42,22 +42,22 @@
     set bar_text_clr "#DDDDDD"
     set bar_text_size "non funct."
 
-    set panel [St_create {window name size priority} $BASE "Scale bar" 2 5]
+    set panel [St_create {window name size priority} $BASE [G_msg "Scale bar"] 2 5]
     frame $BASE -relief flat -borderwidth 0
-    Nv_mkPanelname $BASE "Scale Bar Panel"
+    Nv_mkPanelname $BASE [G_msg "Scale Bar Panel"]
 
     # This section contains widgets for placing the scale bar
     set rbase1 [frame $BASE.scale]
-    Label $rbase1.scalebar_lbl -text "Scale bar: " -fg black
+    Label $rbase1.scalebar_lbl -text [G_msg "Scale bar: "] -fg black
     LabelEntry $rbase1.scalebar_size -relief sunken -entrybg white \
         -textvariable scalebar_size -width 8 \
-        -label "length (in map units) " -fg black -font $nviztxtfont
+        -label [G_msg "length (in map units) "] -fg black -font $nviztxtfont
     pack $rbase1.scalebar_lbl $rbase1.scalebar_size -side left -expand no -fill none
     
     $rbase1.scalebar_size bind <Key> {if {$Nauto_draw == 1} {Ndraw_all}} 
 
 
-    Button $rbase1.color -text "Color" \
+    Button $rbase1.color -text [G_msg "Color"] \
 		-bg $bar_clr -width 8 -bd 1 \
 		-command "change_scale_color $rbase1.color scale" \
 		-fg "#ffffff"
@@ -68,15 +68,15 @@
 
     # This section contains widgets for scale text
     set rbase2 [frame $BASE.txt]
-    Label $rbase2.txt_lbl -text "Scale text: " -fg black
+    Label $rbase2.txt_lbl -text [G_msg "Scale text: "] -fg black
     LabelEntry $rbase2.txt_size -relief sunken -entrybg grey \
         -textvariable bar_text_size -width 8 -justify right\
-        -label "size " -fg black -labelfont $nviztxtfont
+        -label [G_msg "size "] -fg black -labelfont $nviztxtfont
     pack $rbase2.txt_lbl $rbase2.txt_size -side left -expand no -fill none
     
     $rbase2.txt_size bind <Key> {if {$Nauto_draw == 1} {Ndraw_all}} 
 
-    Button $rbase2.color -text "Color" \
+    Button $rbase2.color -text [G_msg "Color"] \
 		-bg $bar_text_clr -width 8 -bd 1 \
 		-command "change_scale_color $rbase2.color text" \
 		-fg "#ffffff"
@@ -87,11 +87,11 @@
 
     # close panel section
     set rbase3 [frame $BASE.button]
-    Button $rbase3.place -text "Place scale" -bd 1 \
+    Button $rbase3.place -text [G_msg "Place scale"] -bd 1 \
 	 -command "sb_bind_mouse $Nv_(TOP).canvas; $Nv_(TOP) configure -cursor plus"
     pack $rbase3.place -expand yes -side left -expand no -fill none
 
-    button $rbase3.close -text "Close" -command "Nv_closePanel $BASE" \
+    button $rbase3.close -text [G_msg "Close"] -command "Nv_closePanel $BASE" \
 		-anchor se -bd 1
 	pack $rbase3.close -side right -fill none -expand no
 	pack $rbase3 -side top -fill both -expand yes -padx 3 -pady 4

Modified: grass/branches/develbranch_6/visualization/nviz/scripts/panel_sdiff.tcl
===================================================================
--- grass/branches/develbranch_6/visualization/nviz/scripts/panel_sdiff.tcl	2010-12-12 16:49:36 UTC (rev 44587)
+++ grass/branches/develbranch_6/visualization/nviz/scripts/panel_sdiff.tcl	2010-12-12 20:28:12 UTC (rev 44588)
@@ -36,13 +36,13 @@
     #  Initialize panel info
     if [catch {set Nv_($BASE)}] {
 		set panel [St_create {window name size priority} \
-		       $BASE "Scaled Difference" 1 5]
+		       $BASE [G_msg "Scaled Difference"] 1 5]
     } else {
 		set panel $Nv_($BASE)
     }
 
     frame $BASE  -relief flat -borderwidth 0
-    Nv_mkPanelname $BASE "Scaled Difference Panel"
+    Nv_mkPanelname $BASE [G_msg "Scaled Difference Panel"]
 
     frame $BASE.top 
     frame $BASE.bottom 
@@ -51,22 +51,22 @@
     
     set maplist [Nget_map_list surf]
 
-    Label $BASE.top.label -text "Reference surface:"
+    Label $BASE.top.label -text [G_msg "Reference surface:"]
     Nv_mksdiffSurfacelist $BASE.top.list 
     pack $BASE.top.label $BASE.top.list -side left -fill y -pady 4
     
-    Label $BASE.top1.lbl -text "Set difference between reference surface and others"
+    Label $BASE.top1.lbl -text [G_msg "Set difference between reference surface and others"]
     pack $BASE.top1.lbl -side left -pady 4
     Nv_mkScale $BASE.top2.sdscale h "z-exag" 0 2500 100 set_sdexag 2 
     pack $BASE.top2.sdscale -side bottom
     
 
-    Button $BASE.bottom.none -text "Clear" \
+    Button $BASE.bottom.none -text [G_msg "Clear"] \
     	-command "unset_sdsurf" -bd 1 -width 5 \
-    	-helptext "unselect reference surface"
+    	-helptext [G_msg "unselect reference surface"]
     pack $BASE.bottom.none -side left
     
-    button $BASE.bottom.close -text "Close" \
+    button $BASE.bottom.close -text [G_msg "Close"] \
     	-command "Nv_closePanel $BASE" -bd 1 -width 5
     pack $BASE.bottom.close -side right
     
@@ -121,7 +121,7 @@
     set name [Nget_current sdiff]
 
     if {$name == 0} {
-	set name "None selected   "
+	set name [G_msg "None selected"]
     } else {
 	set n [lsearch $list $name]
 	set list [lreplace $list $n $n]

Modified: grass/branches/develbranch_6/visualization/nviz/scripts/panel_site.tcl
===================================================================
--- grass/branches/develbranch_6/visualization/nviz/scripts/panel_site.tcl	2010-12-12 16:49:36 UTC (rev 44587)
+++ grass/branches/develbranch_6/visualization/nviz/scripts/panel_site.tcl	2010-12-12 20:28:12 UTC (rev 44588)
@@ -41,22 +41,22 @@
     
     #  Initialize panel info
     if [catch {set Nv_($BASE)}] {
-		set panel [St_create {window name size priority} $BASE "Vector Points" 1 5]
+		set panel [St_create {window name size priority} $BASE [G_msg "Vector Points"] 1 5]
     } else {
 		set panel $Nv_($BASE)
     }
 
 	########## create panel heading 
     frame $BASE  -relief flat -borderwidth 0
-    Nv_mkPanelname $BASE "Vector Points Panel"
+    Nv_mkPanelname $BASE [G_msg "Vector Points Panel"]
 
   	########## create top frame
     set top [frame $BASE.top]
-	Label $top.current -text "Current:" -anchor w
+	Label $top.current -text [G_msg "Current:"] -anchor w
     mkMapList $top.list site
     
-	button $top.new -text New -anchor center -command "add_map site" -bd 1
-	button $top.delete -text Delete -anchor center -command "delete_map site" -bd 1
+	button $top.new -text [G_msg "New"] -anchor center -command "add_map site" -bd 1
+	button $top.delete -text [G_msg "Delete"] -anchor center -command "delete_map site" -bd 1
     
 	pack $top.current $top.list -side left
 	pack $top.delete $top.new -side right -expand 0
@@ -65,6 +65,7 @@
     # initialize variables and map list   
     set curr [Nget_current site]
     set Nv_(siteshape) sphere
+    set Nv_(siteshapelv) ""
     change_marker
 
     if {0 != $curr}  {
@@ -110,11 +111,11 @@
 
   	########## create bottom frame
     set bottom [frame $BASE.bottom] 
-    button $bottom.close -text Close \
+    button $bottom.close -text [G_msg "Close"] \
 		-command "Nv_closePanel $BASE" -anchor s -bd 1
     pack $bottom.close -side right
 
-    button $bottom.draw_current -text "DRAW CURRENT" -fg darkgreen -anchor s \
+    button $bottom.draw_current -text [G_msg "DRAW CURRENT"] -fg darkgreen -anchor s \
 		-command {Nsite_draw_one [Nget_current site]} -bd 1
 
     pack $bottom.draw_current -side left
@@ -129,7 +130,7 @@
     set row4 [frame $mid1.row4]
     set row5 [frame $mid1.row5]
     
-    set szlabel [label $row1.szlabel -text "icon size" \
+    set szlabel [label $row1.szlabel -text [G_msg "icon size"] \
     	-font $nviztxtfont -fg black]
     
     
@@ -145,23 +146,24 @@
 		
 	$ptsize setvalue @$startindex
 
-    set ptcolor [button $row1.color -text Color \
+    set ptcolor [button $row1.color -text [G_msg "Color"] \
 		-command "change_color site $row1.color"]
     bind $ptcolor <Expose> "$row1.color configure -bg \[get_curr_sv_color site\]"
    
-   	set markerlbl [label $row1.markerlbl -text "  icon type " -fg black -font $nviztxtfont]
+   	set markerlbl [label $row1.markerlbl -text [G_msg "icon type"] -fg black -font $nviztxtfont]
     set markertype [ComboBox $row1.marker -width 8 \
     	-textvariable Nv_(siteshape) -modifycmd change_marker \
-    	-values {"x" "sphere" "diamond" "cube" "box" "gyro" "aster" "histogram"}]
+    	-values $Nv_(siteshapes) -labels $Nv_(siteshape_names) -labelsvariable Nv_(siteshapelv)] 
+    
 
     pack $szlabel $ptsize $markerlbl $markertype -side left 
     pack $ptcolor -side left -padx 10
 
-    set rb1 [radiobutton  $row2.disp3d -text "3D points" \
+    set rb1 [radiobutton  $row2.disp3d -text [G_msg "3D points"] \
 		-anchor nw -variable Nv_(sitedisplay) -value 3d \
 		-command change_site_mode]
 
-    set rb2 [radiobutton  $row3.dispsurf -text "display on surface(s):" \
+    set rb2 [radiobutton  $row3.dispsurf -text [G_msg "display on surface(s):"] \
 		-anchor nw -variable Nv_(sitedisplay) -value surfdisp \
 		-command change_site_mode]
 
@@ -177,7 +179,7 @@
 	
 	set site_attr(FIELD_ATTR_PANEL) 0
     
-	checkbutton $row4.themechk -text "thematic mapping for vector points" \
+	checkbutton $row4.themechk -text [G_msg "thematic mapping for vector points"] \
 		-variable site_attr(FIELD_ATTR_PANEL) -command "if {$curr!=0} {site_attr_gui $row5 $bottom $curr}" \
 		-offvalue 0 -onvalue 1
 	pack $row4.themechk -side left -anchor nw
@@ -363,10 +365,3 @@
 		if {$Nauto_draw == 1} {Ndraw_all}
     }
 }
-
-
-
-
-
-
-

Modified: grass/branches/develbranch_6/visualization/nviz/scripts/panel_surf.tcl
===================================================================
--- grass/branches/develbranch_6/visualization/nviz/scripts/panel_surf.tcl	2010-12-12 16:49:36 UTC (rev 44587)
+++ grass/branches/develbranch_6/visualization/nviz/scripts/panel_surf.tcl	2010-12-12 20:28:12 UTC (rev 44588)
@@ -48,14 +48,14 @@
 
 	#  Initialize panel info
 	if [catch {set Nv_($BASE)}] {
-		set panel [St_create {window name size priority} $BASE "Raster Surfaces" 2 5]
+		set panel [St_create {window name size priority} $BASE [G_msg "Raster Surfaces"] 2 5]
 	} else {
 		set panel $Nv_($BASE)
 	}
 
 	# surface panel frame
 	frame $BASE	 -relief flat -bd 0
-	Nv_mkPanelname $BASE "Surface Panel"
+	Nv_mkPanelname $BASE [G_msg "Surface Panel"]
 
 	# resolution panel frame
 	frame $BASE.bottom -relief flat -bd 0
@@ -65,10 +65,10 @@
 
 	###### make widgets that control which is current surface (menu, new delete)###
 	set tmp [frame $BASE.top.top]
-	Label $tmp.current -text "Current:" -anchor w
+	Label $tmp.current -text [G_msg "Current:"] -anchor w
 	mkMapList $tmp.list surf set_display_from_curr
-	button $tmp.new -text New -anchor center -bd 1 -command new_surf
-	button $tmp.delete -text Delete -anchor center -bd 1 -command delete_surf
+	button $tmp.new -text [G_msg "New"] -anchor center -bd 1 -command new_surf
+	button $tmp.delete -text [G_msg "Delete"] -anchor center -bd 1 -command delete_surf
 
 	pack $tmp.current $tmp.list -side left
 	pack $tmp.delete $tmp.new -side right -expand 0
@@ -76,7 +76,7 @@
 	####### make buttons that control attributes for current surface ########
 	set tmp [frame $BASE.top.bottom -bd 0 -relief flat]
 	set tmp2 [frame $BASE.top.bottom2 -bd 0 -relief flat]
-	menubutton $tmp.menu1 -menu $tmp.menu1.m -text "Surface attributes..." -relief raised \
+	menubutton $tmp.menu1 -menu $tmp.menu1.m -text [G_msg "Surface attributes..."] -relief raised \
 		-indicatoron 1 -bd 1
 
 	menu $tmp.menu1.m
@@ -85,18 +85,18 @@
 		-command "mkAttPopup .pop $i 1"
 	}
 
-	button $tmp.wireclr -text "Wire Color" \
+	button $tmp.wireclr -text [G_msg "Wire Color"] \
 		-command "change_wirecolor $tmp.wireclr" \
 		-bg [get_curr_wire_color] -bd 1
 
-	button $tmp.position -text "Position" -bd 1 -command "mkPositionPanel .pos_surf"
+	button $tmp.position -text [G_msg "Position"] -bd 1 -command "mkPositionPanel .pos_surf"
 
 	pack $tmp.menu1 $tmp.wireclr $tmp.position -side left -fill x -expand 1 -ipadx 3
 
-	Label $tmp2.l1 -text "Mask zeros:" -relief flat
-	checkbutton $tmp2.nozeros1 -text "by elevation" \
+	Label $tmp2.l1 -text [G_msg "Mask zeros:"] -relief flat
+	checkbutton $tmp2.nozeros1 -text [G_msg "by elevation"] \
 		-variable Nv_(TopNoZeros) -command no_zeros
-	checkbutton $tmp2.nozeros2 -text "by color" \
+	checkbutton $tmp2.nozeros2 -text [G_msg "by color"] \
 		-variable Nv_(ColNoZeros) -command no_zeros
 
 	pack $tmp2.l1 $tmp2.nozeros1 $tmp2.nozeros2 \
@@ -106,41 +106,41 @@
 	set tmp [frame $BASE.bottom.t1]
 
 	menubutton $tmp.style -menu $tmp.style.m -relief raised \
-		-text "Draw mode..." -underline 0 -indicatoron 1 \
+		-text [G_msg "Draw mode..."] -underline 0 -indicatoron 1 \
 		-justify center -bd 1
 	menu $tmp.style.m
-	$tmp.style.m add radiobutton -label Coarse -value wire \
+	$tmp.style.m add radiobutton -label [G_msg "Coarse"] -value wire \
 		-variable Nv_(SurfStyle) -command set_drawmode
-	$tmp.style.m add radiobutton -label Fine -value poly \
+	$tmp.style.m add radiobutton -label [G_msg "Fine"] -value poly \
 		-variable Nv_(SurfStyle) -command set_drawmode
-	$tmp.style.m add radiobutton -label Both -value wire_poly \
+	$tmp.style.m add radiobutton -label [G_msg "Both"] -value wire_poly \
 		-variable Nv_(SurfStyle) -command set_drawmode
 
 	menubutton $tmp.gstyle -menu $tmp.gstyle.m -relief raised \
-		-text "Coarse style..." -underline 0 -indicatoron 1 \
+		-text [G_msg "Coarse style..."] -underline 0 -indicatoron 1 \
 		-justify center -bd 1
 	menu $tmp.gstyle.m
-	$tmp.gstyle.m add radiobutton -label Wire -value grid_wire \
+	$tmp.gstyle.m add radiobutton -label [G_msg "Wire"] -value grid_wire \
 		-variable Nv_(GridStyle) -command set_drawmode
-	$tmp.gstyle.m add radiobutton -label "Surface" -value grid_surf \
+	$tmp.gstyle.m add radiobutton -label [G_msg "Surface"] -value grid_surf \
 		-variable Nv_(GridStyle) -command set_drawmode
 
-	menubutton $tmp.shading -text "Shading..." -menu $tmp.shading.m \
+	menubutton $tmp.shading -text [G_msg "Shading..."] -menu $tmp.shading.m \
 		-relief raised -underline 0 -indicatoron 1 \
 		-justify center -bd 1
 	menu $tmp.shading.m
-	$tmp.shading.m add radiobutton -label Flat -value flat \
+	$tmp.shading.m add radiobutton -label [G_msg "Flat"] -value flat \
 		-variable Nv_(ShadeStyle) -command set_drawmode
-	$tmp.shading.m add radiobutton -label Gouraud -value gouraud \
+	$tmp.shading.m add radiobutton -label [G_msg "Gouraud"] -value gouraud \
 		-variable Nv_(ShadeStyle) -command set_drawmode
 
 	 pack $tmp.style $tmp.gstyle $tmp.shading -side left -fill x -expand 1 -pady 3
 
 	########### make controls for setting resolution  ##################
 	set tmp [frame $BASE.bottom.t2]
-	set reslabel [Label $tmp.subsampling -text "Resolution:" -justify left -anchor w]
+	set reslabel [Label $tmp.subsampling -text [G_msg "Resolution:"] -justify left -anchor w]
 
-	set sblabel1 [label $tmp.sblabel1 -text coarse -font $nviztxtfont \
+	set sblabel1 [label $tmp.sblabel1 -text [G_msg "coarse"] -font $nviztxtfont \
 		-fg black -anchor e -justify right]
 	set sbwire [SpinBox $tmp.gridarrows2 -range {1 100 1}\
 		-textvariable wireres \
@@ -150,7 +150,7 @@
 		-entrybg white]
 
 	set sblabel2 [label $tmp.sblabel2 -font $nviztxtfont \
-		-fg black -anchor e -justify right -text "fine" ]
+		-fg black -anchor e -justify right -text [G_msg "fine"] ]
 	set sbpoly [SpinBox $tmp.gridarrows1 -range {1 100 1}\
 		-textvariable polyres \
 		-modifycmd {update_spinres "poly" $polyres} \
@@ -163,10 +163,10 @@
 
 	########### make radiobuttons that control scope of changes made ##################
 	set tmp [frame $BASE.bottom.t3]
-	set rblabel1 [Label $tmp.rblabel1 -anchor w -text "Set resolution for:"]
-	set rbcurrent [radiobutton $tmp.current -text "current surface"\
+	set rblabel1 [Label $tmp.rblabel1 -anchor w -text [G_msg "Set resolution for:"]]
+	set rbcurrent [radiobutton $tmp.current -text [G_msg "current surface"]\
 		-anchor w -value 1 -variable Nv_(CurrOnly)]
-	set rball [radiobutton $tmp.all -text "all surfaces" -justify right \
+	set rball [radiobutton $tmp.all -text [G_msg "all surfaces"] -justify right \
 		-anchor e -value 0 -variable Nv_(CurrOnly) -command set_drawmode]
 
 	pack $rblabel1 $rbcurrent $rball -side left -fill x -ipadx 2
@@ -182,7 +182,7 @@
 
 	########## make button to close panel ########################################
 	button $BASE.close -text Close -bd 1 -command "Nv_closePanel $BASE"
-	button $BASE.draw_current -text "DRAW CURRENT" -bd 1 -fg darkgreen \
+	button $BASE.draw_current -text [G_msg "DRAW CURRENT"] -bd 1 -fg darkgreen \
 	-command {Nsurf_draw_one [Nget_current surf]}
 	pack $BASE.close -side right -fill y
 	pack $BASE.draw_current -side left -fill y -padx 3
@@ -667,8 +667,8 @@
 
 	# Create toplevel widget to hold everything
 	toplevel $w -class Dialog
-	wm title $w "Position Surface"
-	wm iconname $w "Attribute"
+	wm title $w [G_msg "Position Surface"]
+	wm iconname $w [G_msg "Attribute"]
 
 	# Get current surface attributes
 	set curr_surf [Nget_current surf]
@@ -698,9 +698,9 @@
 
 	# Create X, Y, and Z entry widgets along with Reset and Close buttons
 	frame $w.coords
-	label $w.coords.z_lbl -text "Z:"
-	label $w.coords.x_lbl -text "X:"
-	label $w.coords.y_lbl -text "Y:"
+	label $w.coords.z_lbl -text [G_msg "Z:"]
+	label $w.coords.x_lbl -text [G_msg "X:"]
+	label $w.coords.y_lbl -text [G_msg "Y:"]
 	entry $w.coords.z_ent -width 5 -relief sunken -bg white
 	entry $w.coords.x_ent -width 5 -relief sunken -bg white
 	entry $w.coords.y_ent -width 5 -relief sunken -bg white
@@ -722,8 +722,8 @@
 	pack $w.coords -side top -in $w.bottom -fill both
 
 	frame $w.commands
-	button $w.commands.reset	-text "Reset"	-command "$w.zslide set 0; Nv_itemDrag $w.pos $Nv_(SURF_POS) 63 63; Nv_xyCallback $update_routine 126 126 63 63"
-	button $w.commands.close	-text "Close"	-command "destroy $w"
+	button $w.commands.reset	-text [G_msg "Reset"]	-command "$w.zslide set 0; Nv_itemDrag $w.pos $Nv_(SURF_POS) 63 63; Nv_xyCallback $update_routine 126 126 63 63"
+	button $w.commands.close	-text [G_msg "Close"]	-command "destroy $w"
 	pack $w.commands.reset $w.commands.close \
 	-side left -fill both -padx 3 -pady 3 -expand yes
 	pack $w.commands -in $w.bottom -fill both

Modified: grass/branches/develbranch_6/visualization/nviz/scripts/panel_vquery.tcl
===================================================================
--- grass/branches/develbranch_6/visualization/nviz/scripts/panel_vquery.tcl	2010-12-12 16:49:36 UTC (rev 44587)
+++ grass/branches/develbranch_6/visualization/nviz/scripts/panel_vquery.tcl	2010-12-12 20:28:12 UTC (rev 44588)
@@ -407,7 +407,7 @@
 
 	toplevel $win
 	wm resizable $win true true
-	wm title $win "Map: [$_map get_att map]"
+	wm title $win [format [G_msg "Map: %s"] [$_map get_att map]]
 
 	wm geometry $win "820x200+10+250"
 	wm minsize $win 150 100
@@ -609,8 +609,9 @@
 
 proc highlight_set_marker_button {_w} {
 	global highlight
+	global Nv_
 
-	set highlight(MARKERS_NAME) [list {x} [G_msg "sphere"] [G_msg "diamond"] [G_msg "cube"] [G_msg "box"] [G_msg "gyro"] [G_msg "aster"]]
+	set highlight(MARKERS_NAME) $Nv_(siteshape_names)
 	set highlight(MARKERS_INDEX) {"1"  "3"        "5"     "4"    "2"  "9"    "8"}
 
 	set m $_w

Modified: grass/branches/develbranch_6/visualization/nviz/scripts/script_file_tools
===================================================================
--- grass/branches/develbranch_6/visualization/nviz/scripts/script_file_tools	2010-12-12 16:49:36 UTC (rev 44587)
+++ grass/branches/develbranch_6/visualization/nviz/scripts/script_file_tools	2010-12-12 20:28:12 UTC (rev 44588)
@@ -123,7 +123,7 @@
     # Read in each of the file fields one at a time, and create
     # Field_Data as appropriate
     if {[catch {set file_hook [open $new_file r]} error_code] != 0} then {
-	display_error [G_msg "Error while opening file: %s", $error_code]
+	display_error [format [G_msg "Error while opening file: %s"] $error_code]
 	return
     }
 
@@ -132,14 +132,14 @@
 
     # Read in state file
     if {[catch {gets $file_hook state_file} error_code] != 0} then {
-	display_error [G_msg "While reading state_file: %s", $error_code]
+	display_error [format [G_msg "While reading state_file: %s"] $error_code]
 	return
     }
     set_new_state_file $state_file
 
     # Get number of fields
     if {[catch {gets $file_hook num_fields} error_code] != 0} then {
-	display_error [G_msg "While reading number of fields: %s", $error_code]
+	display_error [format [G_msg "While reading number of fields: %s"] $error_code]
 	return
     }
 
@@ -148,13 +148,13 @@
     for {set i 0} {$i < $num_fields} {incr i} {
 	# Input field type
 	if {[catch {gets $file_hook field_type} error_code] != 0} then {
-	    display_error [G_msg "While reading field type: %s", $error_code]
+	    display_error [format [G_msg "While reading field type: %s"] $error_code]
 	    return
 	}
 
 	# Input field attribute
 	if {[catch {gets $file_hook field_att} error_code] != 0} then {
-	    display_error [G_msg "While reading field attribute: %s", $error_code]
+	    display_error [format [G_msg "While reading field attribute: %s"] $error_code]
 	    return
 	}
 

Modified: grass/branches/develbranch_6/visualization/nviz/scripts/script_play
===================================================================
--- grass/branches/develbranch_6/visualization/nviz/scripts/script_play	2010-12-12 16:49:36 UTC (rev 44587)
+++ grass/branches/develbranch_6/visualization/nviz/scripts/script_play	2010-12-12 20:28:12 UTC (rev 44588)
@@ -28,7 +28,7 @@
 		set new_file "$NvizPlayScript"
 	} else {
 		tk_dialog .file_error [G_msg "File Error"] \
-		[G_msg "Script file %s does not exist", $NvizPlayScript] \
+		[format [G_msg "Script file %s does not exist"] $NvizPlayScript] \
 		error 0 [G_msg "Dismiss"]
 		exit
 	}

Modified: grass/branches/develbranch_6/visualization/nviz/scripts/site_attr.tcl
===================================================================
--- grass/branches/develbranch_6/visualization/nviz/scripts/site_attr.tcl	2010-12-12 16:49:36 UTC (rev 44587)
+++ grass/branches/develbranch_6/visualization/nviz/scripts/site_attr.tcl	2010-12-12 20:28:12 UTC (rev 44588)
@@ -425,7 +425,7 @@
 			generate a color table."]
 		}
 		default {
-			puts [G_msg "WARNING: No thematic mapping preferences set for %s!", $site_attr($_idx.ATTR)]
+			puts [format [G_msg "WARNING: No thematic mapping preferences set for %s!"] $site_attr($_idx.ATTR)]
 		}
 	}
 
@@ -444,11 +444,11 @@
 	set site_attr($_idx.WIN_CMD) $w
 
 # Attribute
-		label $w.attr -text [G_msg "Vary point %s", $site_attr($_idx.ATTR)]
+		label $w.attr -text [format [G_msg "Vary point %s"] $site_attr($_idx.ATTR)]
 		pack $w.attr -pady 1 -padx 0 -fill x -side top
 
 # Field
-		label $w.field -text [G_msg "GIS attribute: %s", $site_attr($_idx.NAME)]
+		label $w.field -text [format [G_msg "GIS attribute: %s"] $site_attr($_idx.NAME)]
 		pack $w.field -padx 0 -fill x -side top
 
 # Type
@@ -457,7 +457,7 @@
 		} else { 
 			set type "numeric"
 		}
-		label $w.type -text [G_msg "Attribute type: %s", $type]
+		label $w.type -text [format [G_msg "Attribute type: %s"] $type]
 		pack $w.type -padx 0 -fill x -side top
 
 # Instructions
@@ -1405,7 +1405,7 @@
 			set row_val "label \$w.l\$row -bg \$val -width 3 -borderwidth 1 -relief raised"
 		}
 		default {
-			puts [G_msg "WARNING: No attribute behaviour for %s!", $site_attr($_lut_id.ATTR)]
+			puts [format [G_msg "WARNING: No attribute behaviour for %s!"] $site_attr($_lut_id.ATTR)]
 			return
 		}
 	}
@@ -1415,11 +1415,11 @@
 	catch {destroy $win}
 	toplevel $win
 	wm resizable $win true true
-	wm title $win [G_msg "Thematic prefs file %s", $_lut_id]
+	wm title $win [format [G_msg "Thematic prefs file %s"] $_lut_id]
 	bind $win <Destroy> "site_attr_lut_destroy_win $_lut_id $win %W"
 
 	set w [frame $win.left]
-		label $w.name -text [G_msg "Name: %s", $site_attr($_lut_id.NAME)] -pady 2
+		label $w.name -text [format [G_msg "Name: %s"] $site_attr($_lut_id.NAME)] -pady 2
 		pack $w.name -pady 1 -fill x -side top
 
 		if {$site_attr($_lut_id.TYPE) == "s"} {
@@ -1579,7 +1579,7 @@
 	if {$filename != ""} {
 		if {[file exists $filename]} {
 			file delete -force -- $filename
-			puts [G_msg "Old LUT \"%s\" deleted", $filename]
+			puts [format [G_msg "Old LUT \"%s\" deleted"] $filename]
 		}
 		# file is new
 		site_attr_lut_write $_lut_id [site_attr_lut_file_from_name $filename]
@@ -1604,7 +1604,7 @@
 	close $fileId
 
 	set site_attr($_lut_id.NAME) [site_attr_lut_name_from_file $_filename]
-	puts [G_msg "Thematic preferences file \"%s\" saved", $name]
+	puts [format [G_msg "Thematic preferences file \"%s\" saved"] $name]
 }
 
 
@@ -1619,12 +1619,12 @@
 	if {$filename == ""} {return}
 
 	if {![file exists $filename]} {
-		puts [G_msg "*** WARNING *** File \"%s\" is unavailable", $filename]
+		puts [format [G_msg "*** WARNING *** File \"%s\" is unavailable"] $filename]
 		return ""
 	}
 
 	if {[site_attr_lut_read $filename] < 5} {
-		puts [G_msg "*** ERROR *** Some thematic pref component are missing in file \"%s\"", $filename]
+		puts [format [G_msg "*** ERROR *** Some thematic pref component are missing in file \"%s\""] $filename]
 		return ""
 	}
 
@@ -1697,7 +1697,7 @@
 				}
 			}
 			default {
-				puts [G_msg "WARNING: Unknown Tag \"%s\" in file \"%s\"", $tag_name, $_filename]
+				puts [format [G_msg "WARNING: Unknown Tag \"%s\" in file \"%s\""] $tag_name, $_filename]
 			}
 		}
 #		foreach elt $tag_list {puts "*** $elt ***"}
@@ -1767,7 +1767,7 @@
 		"size" {set st_att [Nsite_attr_get_value "ST_ATT_SIZE"]}
 		"color" {set st_att [Nsite_attr_get_value "ST_ATT_COLOR"]}
 		"marker" {set st_att [Nsite_attr_get_value "ST_ATT_MARKER"]}
-		default {puts [G_msg "WARNING: Unknown attribute %s!", $_attr]; return $ret_list}
+		default {puts [format [G_msg "WARNING: Unknown attribute %s!"] $_attr]; return $ret_list}
 	}
 
 	set max [Nsite_attr_get_value "GPT_MAX_ATTR"]
@@ -1788,14 +1788,14 @@
 			incr index
 		}
 	}
-	if {$not_found} {puts [G_msg "WARNING: field %s NOT FOUND", $_field]; return}
+	if {$not_found} {puts [format [G_msg "WARNING: field %s NOT FOUND"] $_field]; return}
 
 	# verify if lut with this name is already loaded
 	set lut_id [site_attr_lut_id_from_name [site_attr_lut_name_from_file $_lut_name]]
 	if {$lut_id == "NO_LUT"} {
 		# if not, load it!
 		set lut_id [site_attr_lut_load [file join $site_attr(LUT_DIR) [site_attr_lut_file_from_name $_lut_name]]]
-		if {$lut_id == ""} {puts [G_msg "WARNING: lut file %s NOT FOUND", [site_attr_lut_file_from_name $_lut_name]]; return}
+		if {$lut_id == ""} {puts [format [G_msg "WARNING: lut file %s NOT FOUND"] [site_attr_lut_file_from_name $_lut_name]]; return}
 	}
 
 	# FROM HERE ON EVERITHING SHOULD BE OK



More information about the grass-commit mailing list