From 7d83850738441adde636e99227ef127f83489652 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sat, 22 Dec 2012 02:44:35 +0000 Subject: make all text localizable svn path=/trunk/scripts/guiplugins/search-plugin/; revision=16736 --- search-plugin.tcl | 176 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 111 insertions(+), 65 deletions(-) diff --git a/search-plugin.tcl b/search-plugin.tcl index 68a903f..8cf5e31 100644 --- a/search-plugin.tcl +++ b/search-plugin.tcl @@ -418,18 +418,21 @@ proc ::dialog_helpbrowser2::error { fid error_type } { $widget configure -state normal $widget delete 0.0 end print_navbar $widget - $widget insert end [_ "Error\n"] homepage_title + $widget insert end [_ "Error"] homepage_title + $widget insert end "\n" $widget insert end [_ "The\ Pd Search Tool can't use the search\ - term you entered\nThe tcl interpreter gave\ - the following error:\n\n$fid\n\n"] description + term you entered. The tcl interpreter gave\ + the following error:"] description + $widget insert end "\n\n$fid\n\n" description if { $error_type eq "badlist" } { $widget insert end [_ "The search\ term you enter must be formatted as a proper\ tcl list. This usually isn't an issue unless\ you use some special characters like brackets\ or unmatched quotes in your search. For more\ - info on tcl lists, see:\n\n"] description + info on tcl lists, see:"] description + $widget insert end "\n\n" description $widget insert end \ "http://www.tcl.tk/man/tcl/tutorial/Tcl14.html" description } elseif { $error_type eq "badregex" } { @@ -438,7 +441,8 @@ proc ::dialog_helpbrowser2::error { fid error_type } { regular expression in Tcl. This usually isn't an\ issue unless you use special characters to create\ a complex regular expression. For more info on\ - regular expressions in Tcl, see:\n\n"] description + regular expressions in Tcl, see:"] description + $widget insert end "\n\n" description $widget insert end \ "http://www.tcl.tk/man/tcl8.5/TclCmd/re_syntax.htm" } @@ -737,24 +741,29 @@ proc ::dialog_helpbrowser2::intro { t } { variable navbar {} .helpbrowser2.navtext configure -state normal .helpbrowser2.navtext delete 0.0 end - .helpbrowser2.navtext insert end "Search" "navbar homepage_title" + .helpbrowser2.navtext insert end [_ "Search"] "navbar homepage_title" .helpbrowser2.navtext configure -state disabled $t configure -state normal $t delete 0.0 end - $t insert end [_ "Enter terms above. Use the dropdown "] homepage_description - $t insert end [_ "menu to filter by category.\n"] homepage_description - $t insert end [_ "Browse the Documentation\n"] homepage_title + $t insert end \ + [_ "Enter terms above. Use the dropdown menu to filter by category."] \ + homepage_description + $t insert end "\n" + $t insert end [_ "Browse the Documentation"] homepage_title + $t insert end "\n" $t insert end [_ "The \"doc\" directory"] "link clickable_dir intro_link0" $t insert end [file join $::sys_libdir doc] basedir $t insert end "0" is_libdir - $t insert end "\n" description - $t insert end [_ "External Pd libraries\n"] "link libdirs intro_libdirs" - $t insert end [_ "Browse Introductory Topics\n"] homepage_title - set intro_docs { \ - "Pd Manual" 1.manual "HTML manual for Pure Data" \ - "Control Structure" 2.control.examples "tutorials for control objects" \ - "Audio Signals" 3.audio.examples "tutorials for audio signals" \ - } + $t insert end "\n" + $t insert end [_ "External Pd libraries"] "link libdirs intro_libdirs" + $t insert end "\n" + $t insert end [_ "Browse Introductory Topics"] homepage_title + $t insert end "\n" + set intro_docs [list \ + [_ "Pd Manual"] 1.manual [_ "HTML manual for Pure Data"] \ + [_ "Control Structure"] 2.control.examples [_ "tutorials for control objects"] \ + [_ "Audio Signals"] 3.audio.examples [_ "tutorials for audio signals"] \ + ] set i 1 foreach {title dir desc} $intro_docs { $t insert end "$title" "link clickable_dir intro_link$i" @@ -767,9 +776,12 @@ proc ::dialog_helpbrowser2::intro { t } { $t insert end [_ "All About Pd"] "link homepage_file" $t insert end [file join $::sys_libdir doc 5.reference] basedir $t insert end all_about.pd filename - $t insert end [_ " reference patches for key concepts and settings\ - in Pd\n"] description - $t insert end [_ "Browse Advanced Topics\n"] homepage_title + $t insert end \ + [_ " reference patches for key concepts and settings in Pd"] \ + description + $t insert end "\n" + $t insert end [_ "Browse Advanced Topics"] homepage_title + $t insert end "\n" set advanced_docs [list \ [_ "Networking"] [file join manuals 3.Networking] [_ "sending data over networks with Pd"] \ [_ "Writing Externals"] 6.externs [_ "how to code control and signal objects in C"] \ @@ -788,52 +800,81 @@ proc ::dialog_helpbrowser2::intro { t } { $t insert end " $desc\n" description set i [expr {($i+1)%30}] } - $t insert end [_ "Keyword Search\n"] homepage_title - $t insert end [_ "Many of the help documents are categorized by keyword. Click\ + $t insert end [_ "Search by Tag"] homepage_title + $t insert end "\n" + $t insert end [_ "Many of the help documents are categorized by keyword tags. Click\ a link below to search for documents that have been tagged with that\ - keyword.\n"] \ + keyword."] \ homepage_description - set keywords { \ - {abstraction "object itself is written in Pure Data"} \ - {abstraction_op "object's behavior only makes sense inside an abstraction"} \ - {analysis "performance some sort of analysis on the incoming signal or value"} \ - {anything_op "store or manipulate an anything"} \ - {array "create or manipulate an array"} \ - {bandlimited "object describes itself as being bandlimited"} \ - {block_oriented "signal object that performs block-wide operations (as opposed to\ - repeating the same operation for each sample of the block)"} \ - {canvas_op "object's behavior only makes sense in context of a canvas"} \ - {control "control rate objects"} \ - {conversion "convert from one set of units to another"} \ - {data_structure "create or manage data structures"} \ - {dynamic_patching "dynamic instantiation/deletion\ - of objects or patches"} \ - {filesystem "object that reads from and/or writes to the\ - file system"} \ - {filter "object that filters incoming data"} \ - {GUI "graphical user interface"} \ - {list_op "object that manipulates, outputs, or stores a list"} \ - {MIDI "object that provides MIDI functionality"} \ - {needs_work "help patches that are still under construction or\ - otherwise are incomplete"} \ - {network "provides access to or sends/receives data over a network"} \ - {nonlocal "pass messages or data without patch wires"} \ - {orphan "help patches that cannot be accessed by right-clicking \"help\"\ - for the corresponding object"} \ - {patchfile_op "object whose behavior only makes sense in terms of a Pure\ - Data patch"} \ - {pd_op "object that can report on or manipulate global data associated with\ - the running instance of Pd"} \ - {ramp "create a ramp between a starting and ending value"} \ - {random "output a random value, list, signal, or other random data"} \ - {signal "audiorate object (so called \"tilde\" object"} \ - {soundfile "object that can play, manipulate, and/or save a sound file\ - (wav, ogg, flac, mp3, etc.)"} \ - {storage "object whose main function is to store data"} \ - {symbol_op "manipulate or store a symbol"} \ - {time "measure and/or manipulate time"} \ - {trigonometry "provide trogonometric functionality"} \ - } + $t insert end "\n" + + set keywords \ + [list \ + [list "abstraction" \ + [_ "object itself is written in Pure Data"]] \ + [list "abstraction_op" \ + [_ "object's behavior only makes sense inside an abstraction"]] \ + [list "analysis" \ + [_ "performance some sort of analysis on the incoming signal or value"]] \ + [list "anything_op" \ + [_ "store or manipulate an anything"]] \ + [list "array" \ + [_ "create or manipulate an array"]] \ + [list "bandlimited" \ + [_ "object describes itself as being bandlimited"]] \ + [list "block_oriented" \ + [_ "signal object that performs block-wide operations (as opposed to\ + repeating the same operation for each sample of the block)"]] \ + [list "canvas_op" \ + [_ "object's behavior only makes sense in context of a canvas"]] \ + [list "control" \ + [_ "control rate objects"]] \ + [list "conversion" \ + [_ "convert from one set of units to another"]] \ + [list "data_structure" \ + [_ "create or manage data structures"]] \ + [list "dynamic_patching" \ + [_ "dynamic instantiation/deletion of objects or patches"]] \ + [list "filesystem" \ + [_ "object that reads from and/or writes to the file system"]] \ + [list "filter" \ + [_ "object that filters incoming data"]] \ + [list "GUI" \ + [_ "graphical user interface"]] \ + [list "list_op" \ + [_ "object that manipulates, outputs, or stores a list"]] \ + [list "MIDI" \ + [_ "object that provides MIDI functionality"]] \ + [list "needs_work" \ + [_ "help patches that are still under construction or otherwise are incomplete"]] \ + [list "network" \ + [_ "provides access to or sends/receives data over a network"]] \ + [list "nonlocal" \ + [_ "pass messages or data without patch wires"]] \ + [list "orphan" \ + [_ "help patches that cannot be accessed by right-clicking \"help\" for the corresponding object"]] \ + [list "patchfile_op" \ + [_ "object whose behavior only makes sense in terms of a Pure Data patch"]] \ + [list "pd_op" \ + [_ "object that can report on or manipulate global data associated with the running instance of Pd"]] \ + [list "ramp" \ + [_ "create a ramp between a starting and ending value"]] \ + [list "random" \ + [_ "output a random value, list, signal, or other random data"]] \ + [list "signal" \ + [_ "audiorate object (so called \"tilde\" object)"]] \ + [list "soundfile" \ + [_ "object that can play, manipulate, and/or save a sound file (wav, ogg, flac, mp3, etc.)"]] \ + [list "storage" \ + [_ "object whose main function is to store data"]] \ + [list "symbol_op" \ + [_ "manipulate or store a symbol"]] \ + [list "time" \ + [_ "measure and/or manipulate time"]] \ + [list "trigonometry" \ + [_ "provide trogonometric functionality"]] \ + ] + set i 0 foreach keyword $keywords { $t insert end "keywords" "metakey hide" @@ -936,7 +977,8 @@ proc ::dialog_helpbrowser2::print_libdirs {textwidget libdirs} { regsub -all { \\,} $description {,} description $textwidget insert end "$description\n" description } else { - $textwidget insert end [_ "no DESCRIPTION tag or values.\n"] description + $textwidget insert end [_ "no DESCRIPTION tag or values."] description + $textwidget insert end "\n" } foreach tag {Author License Version} { if {[regexp -nocase -- "#X text \[0-9\]+ \[0-9\]+ $tag (.*?);.*" [join $file_contents] -> values]} { @@ -1116,3 +1158,7 @@ image create photo ::dialog_helpbrowser2::help -data { LiBBbGwgcmlnaHRzIHJlc2VydmVkLg0KaHR0cDovL3d3dy5kZXZlbGNvci5j b20AOw== } + + + +::dialog_helpbrowser2::open_helpbrowser .helpbrowser2 -- cgit v1.2.1