Revision: 10468 http://pure-data.svn.sourceforge.net/pure-data/?rev=10468&view=rev Author: chunlee Date: 2008-12-29 14:34:50 +0000 (Mon, 29 Dec 2008)
Log Message: ----------- init_locale
Modified Paths: -------------- branches/pd-devel/0.41.4/src/pd.tk branches/pd-devel/0.41.4/src/pd_menus.tcl branches/pd-devel/0.41.4/src/pd_say.tcl
Modified: branches/pd-devel/0.41.4/src/pd.tk =================================================================== --- branches/pd-devel/0.41.4/src/pd.tk 2008-12-28 08:37:30 UTC (rev 10467) +++ branches/pd-devel/0.41.4/src/pd.tk 2008-12-29 14:34:50 UTC (rev 10468) @@ -30,8 +30,8 @@ } } if {![info exists cmd_ops(lang)]} {set cmd_ops(lang) "en"} +init_locale
-puts $cmd_ops(lang) # ------------------------------------------------------------------------------ # init functions
Modified: branches/pd-devel/0.41.4/src/pd_menus.tcl =================================================================== --- branches/pd-devel/0.41.4/src/pd_menus.tcl 2008-12-28 08:37:30 UTC (rev 10467) +++ branches/pd-devel/0.41.4/src/pd_menus.tcl 2008-12-29 14:34:50 UTC (rev 10468) @@ -36,7 +36,7 @@
proc ::pd_menus::create_file_menu_aqua {rootmenu} { variable accelerator - $rootmenu add command -label [say "New"] -accelerator "$accelerator+N" + $rootmenu add command -label [say "new_file"] -accelerator "$accelerator+N" $rootmenu add command -label [say "Open"] -accelerator "$accelerator+O" $rootmenu add cascade -label [say "Open Recent"] $rootmenu add separator @@ -66,7 +66,7 @@
proc ::pd_menus::create_file_menu_x11 {rootmenu} { variable accelerator - $rootmenu add command -label [say "New"] -accelerator "$accelerator+N" + $rootmenu add command -label [say "new_file"] -accelerator "$accelerator+N" $rootmenu add command -label [say "Open"] -accelerator "$accelerator+O" $rootmenu add separator $rootmenu add command -label [say "Save"] -accelerator "$accelerator+S" @@ -96,7 +96,7 @@
proc ::pd_menus::create_file_menu_win32 {rootmenu} { variable accelerator - $rootmenu add command -label [say "New"] -accelerator "$accelerator+N" + $rootmenu add command -label [say "new_file"] -accelerator "$accelerator+N" $rootmenu add command -label [say "Open"] -accelerator "$accelerator+O" $rootmenu add separator $rootmenu add command -label [say "Save"] -accelerator "$accelerator+S" @@ -126,7 +126,7 @@ # menu building functions proc ::pd_menus::create_file_menu {rootmenu name} { [format create_file_menu_%s [tk windowingsystem]] $rootmenu - $rootmenu entryconfigure [say "New"] -command {menu_new} + $rootmenu entryconfigure [say "new_file"] -command {menu_new} $rootmenu entryconfigure [say "Open"] -command {menu_open} $rootmenu entryconfigure [say "Save"] -command {menu_save $name} $rootmenu entryconfigure [say "Save As..."] -command {menu_saveas $name}
Modified: branches/pd-devel/0.41.4/src/pd_say.tcl =================================================================== --- branches/pd-devel/0.41.4/src/pd_say.tcl 2008-12-28 08:37:30 UTC (rev 10467) +++ branches/pd-devel/0.41.4/src/pd_say.tcl 2008-12-29 14:34:50 UTC (rev 10468) @@ -7,6 +7,39 @@
package provide pd_say 0.1
-proc say {name} { - return "$name" +proc init_locale {} { + global cmd_ops + set encoding "" + switch $cmd_ops(lang) { + en {set langfile "english"} + ch {set langfile "chinese"; set encoding utf-8} + defalut {set langfile "english"} + } + #hardcoded the path for now + set langfile locale/${langfile}.tcl + if {$encoding != ""} {source -encoding $encoding $langfile} else {source $langfile} + puts "$cmd_ops(lang) | $langfile" +} + +proc say2 {name args} { + return $name +} + +proc say {name args} { + global text + if {[llength $args]} { + set text($name) [lindex $args 0] + } else { + if {[info exist text($name)]} { + return $text($name) + } else {return $name} + } +} + +proc say_category {text} { + #can't remember what this is for..... +} + +proc say_namespace {text code} { + #later.. } \ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.