Index: openacs-4/packages/xowiki/tcl/folder-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/folder-procs.tcl,v diff -u -N -r1.55.2.35 -r1.55.2.36 --- openacs-4/packages/xowiki/tcl/folder-procs.tcl 16 Jul 2020 17:11:19 -0000 1.55.2.35 +++ openacs-4/packages/xowiki/tcl/folder-procs.tcl 17 Jul 2020 13:49:19 -0000 1.55.2.36 @@ -661,7 +661,7 @@ if {[info exists regexp]} { set extra_where_clause "(bt.title ~ '$regexp' OR ci.name ~ '$regexp' )" } - + if {$language_specific} { # # Setting the property language_specific does two things: @@ -670,28 +670,19 @@ # set lang [string range [:locale] 0 1] set extra_where_clause "ci.name like '${lang}:%'" - + # - # If the folder has a property "ml_title" assume that every line - # is a title in a different language and starts with a lang - # prefix. If no matching title is found stick to the title of - # the folder object. + # If the folder has a property "langstring" assume that the + # content is a dict containing multiple attributes in multiple + # languages. # - # One should define a form-field to make it easy for a true end - # user to provide ml titles. + # One should define a form-field for langstrings that convert + # some user-friendly format into the intrep of the dict, which + # can be efficiently processed. # - set ml_title [$current_folder property ml_title] - if {$ml_title ne ""} { - foreach line [split $ml_title \n] { - set line [string trim $line] - if {[string range $line 0 1] eq $lang} { - $current_folder title [string range $line 2 end] - break - } - } - } + $current_folder update_langstring_property _title $lang } - + :log "child-resources of folder_id ${:current_folder_id}" set items [::xowiki::FormPage get_all_children \ -folder_id ${:current_folder_id} \ 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 -N -r1.542.2.76 -r1.542.2.77 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 1 Jul 2020 19:31:58 -0000 1.542.2.76 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 17 Jul 2020 13:49:19 -0000 1.542.2.77 @@ -609,7 +609,7 @@ Page set markupmap(unescape) [list \03\01 "\[\[" \03\02 "\{\{" \03\03 ">>" ] # - # templating and CSS + # Templating and CSS # Page proc quoted_html_content text { @@ -4668,6 +4668,20 @@ return [expr $wc(tcl)] } + FormPage instproc langstring {attname lang {default ""}} { + set result $default + if {[:exists_property langstring]} { + set d [:property langstring] + if {[dict exists $d $attname $lang]} { + set result [dict get $d $attname $lang] + } + } + return $result + } + FormPage instproc update_langstring_property {attname lang} { + :set_property $attname [:langstring $attname $lang [:property $attname]] + } + # # end property management #