Index: openacs-4/packages/xowiki/tcl/link-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/link-procs.tcl,v diff -u -r1.52 -r1.53 --- openacs-4/packages/xowiki/tcl/link-procs.tcl 3 Oct 2008 11:28:16 -0000 1.52 +++ openacs-4/packages/xowiki/tcl/link-procs.tcl 10 Oct 2008 23:49:42 -0000 1.53 @@ -97,14 +97,19 @@ my render_found $href [my label] } else { $page incr unresolved_references - set object_type [[$page info class] set object_type] - if {$object_type ne "::xowiki::Page" && $object_type ne "::xowiki::PlainPage"} { - # TODO: this is a temporary solution. we should find a way to - # pass similar to file or image entries the type of this - # entry. Maybe we can get the type as well from a kind of - # blackboard, where the type of the "edit" wiki-menu-entry is - # stored as well. - set object_type ::xowiki::Page + if {[$page exists __unresolved_object_type]} { + # get the desired object_type for unresoved entries + set object_type [$page set __unresolved_object_type] + } else { + set object_type [[$page info class] set object_type] + if {$object_type ne "::xowiki::Page" && $object_type ne "::xowiki::PlainPage"} { + # TODO: this is a temporary solution. we should find a way to + # pass similar to file or image entries the type of this + # entry. Maybe we can get the type as well from a kind of + # blackboard, where the type of the "edit" wiki-menu-entry is + # stored as well. + set object_type ::xowiki::Page + } } set name [my name] set title [my label] Index: openacs-4/packages/xowiki/tcl/package-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v diff -u -r1.142 -r1.143 --- openacs-4/packages/xowiki/tcl/package-procs.tcl 9 Oct 2008 11:01:44 -0000 1.142 +++ openacs-4/packages/xowiki/tcl/package-procs.tcl 10 Oct 2008 23:49:42 -0000 1.143 @@ -553,7 +553,7 @@ # second, resolve object level methods # #my log "--o try '$object'" - set page [my resolve_request -default_lang [::xo::cc lang] -simple $simple -path $object method] + set page [my resolve_request -default_lang [my default_language] -simple $simple -path $object method] #my log "--o page is '$page' simple=$simple" if {$simple || $page ne ""} { if {$page ne ""} { @@ -570,14 +570,14 @@ # for two different cases: (a) complete an non-fully specified # entry, and (b) search whether such an entry exists. Not # undoable, but this should wait for the next release. - if {[::xo::cc lang] ne [my default_language]} { - set page [my resolve_request -default_lang [my default_language] -simple $simple -path $object method] - if {$simple || $page ne ""} { - if {$page ne ""} { - } - return $page - } - } +# if {[::xo::cc lang] ne [my default_language]} { +# set page [my resolve_request -default_lang [my default_language] -simple $simple -path $object method] +# if {$simple || $page ne ""} { +# if {$page ne ""} { +# } +# return $page +# } +# } # stripped object is the object without a language prefix set stripped_object $object Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.300 -r1.301 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 10 Oct 2008 16:05:28 -0000 1.300 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 10 Oct 2008 23:49:42 -0000 1.301 @@ -1070,8 +1070,6 @@ # (typed) file links set lang "" set name file:$stripped_name - } elseif {[regexp {^:(..):(.*)$} $link _ lang stripped_name]} { - set link_type language } else { # do we have a typed link? more than two chars... if {[regexp {^([^:][^:][^:]+):((..):)?(.+)$} $link _ \ @@ -1418,6 +1416,30 @@ } + + Page instproc translate {-from -to text} { + set langpair $from|$to + set ie UTF8 + #set url [export_vars -base http://translate.google.com/translate_t {langpair text}] + #set r [xo::HttpRequest new -url $url] + set r [xo::HttpRequest new -url http://translate.google.com/translate_t \ + -post_data [export_vars {langpair text ie}] \ + -content_type application/x-www-form-urlencoded] + #my msg status=[$r set status] + if {[$r set status] eq "finished"} { + set data [$r set data] + dom parse -simple -html $data doc + $doc documentElement root + set n [$root selectNodes {//div[@id="result_box"]}] + #my msg "$text $from=>$to [$n asText]" + return [$n asText] + } else { + util_user_message -message "Could not translate text, \ + status=[$r set status] reason=[$r set cancel_message]" + } + } + + # # Methods of ::xowiki::PlainPage # Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.188 -r1.189 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 8 Oct 2008 17:48:29 -0000 1.188 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 10 Oct 2008 23:49:42 -0000 1.189 @@ -1188,11 +1188,18 @@ #my msg "after save refs=[expr {[my exists references]?[my set references] : {NONE}}]" set redirect_method [my form_parameter __form_redirect_method "view"] +#my msg "__form_redir=$redirect_method" +#my msg "__form params= [::xo::cc array get form_parameter]" if {$redirect_method eq "__none"} { return } else { - set url [$package_id pretty_link [my name]]?m=$redirect_method - $package_id returnredirect [my query_parameter "return_url" $url] + set url [$package_id pretty_link -lang en [my name]]?m=$redirect_method + set return_url [$package_id get_parameter return_url $url] + # we had query_parameter here. however, to be able to + # process the output of ::xo::cc set_parameter ...., we + # changed it to "parameter". + #my msg "return_url=$return_url" + $package_id returnredirect $return_url return } }