Index: openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl,v diff -u -r1.42 -r1.42.2.1 --- openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl 26 Feb 2004 15:28:46 -0000 1.42 +++ openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl 18 Mar 2004 09:07:46 -0000 1.42.2.1 @@ -626,7 +626,7 @@ @author Peter Marklund (peter@collaboraid.biz) @creation-date 12 November 2002 } { - return {^(.*?)(%%|%[-a-zA-Z0-9_:\.]+%)(.*)$} + return {^(.*?)(%%|%[-a-zA-Z0-9_:\.]+(?:;noquote)?%)(.*)$} } ad_proc -public lang::message::message_exists_p { locale key } { Index: openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl,v diff -u -r1.32 -r1.32.2.1 --- openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl 12 Mar 2004 13:45:04 -0000 1.32 +++ openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl 18 Mar 2004 09:07:46 -0000 1.32.2.1 @@ -445,20 +445,40 @@ Convert ADP variables to percentage_signs - the notation used to interpolate variable values into acs-lang messages. -
- We don't currently support having noquote vars in messages (i.e. we don't - substitute @var_name;noquote@). -
- @author Peter Marklund } { # substitute array variable references # loop to handle the case of adjacent variable references, like @a@@b@ while {[regsub -all [template::adp_array_variable_regexp] $text {\1%\2.\3%} text]} {} + while {[regsub -all [template::adp_array_variable_regexp_noquote] $text {\1%\2.\3;noquote%} text]} {} # substitute simple variable references while {[regsub -all [template::adp_variable_regexp] $text {\1%\2%} text]} {} + while {[regsub -all [template::adp_variable_regexp_noquote] $text {\1%\2;noquote%} text]} {} + return $text +} + +ad_proc -private lang::util::convert_percentage_signs_to_adp_variables { text } { + Convert percentage_signs message vars to adp var syntax. + + @see lang::util::convert_adp_variables_to_percentage_signs + + @author Peter Marklund +} { + # substitute array variable references + # loop to handle the case of adjacent variable references, like @a@@b@ + regsub -all {@} [template::adp_array_variable_regexp] {%} pattern + while {[regsub -all $pattern $text {\1@\2.\3@} text]} {} + regsub -all {@} [template::adp_array_variable_regexp_noquote] {%} pattern + while {[regsub -all $pattern $text {\1@\2.\3;noquote@} text]} {} + + # substitute simple variable references + regsub -all {@} [template::adp_variable_regexp] {%} pattern + while {[regsub -all $pattern $text {\1@\2@} text]} {} + regsub -all {@} [template::adp_variable_regexp_noquote] {%} pattern + while {[regsub -all $pattern $text {\1@\2;noquote@} text]} {} + return $text } Index: openacs-4/packages/acs-lang/tcl/test/acs-lang-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/test/acs-lang-test-procs.tcl,v diff -u -r1.15 -r1.15.2.1 --- openacs-4/packages/acs-lang/tcl/test/acs-lang-test-procs.tcl 12 Mar 2004 15:27:15 -0000 1.15 +++ openacs-4/packages/acs-lang/tcl/test/acs-lang-test-procs.tcl 18 Mar 2004 09:07:46 -0000 1.15.2.1 @@ -598,25 +598,31 @@ aa_register_case \ -procs { lang::util::convert_adp_variables_to_percentage_signs + lang::util::convert_percentage_signs_to_adp_variables } util__convert_adp_variables_to_percentage_signs { @author Peter Marklund (peter@collaboraid.biz) @creation-date 25 October 2002 } { - set adp_chunk "