Index: openacs-4/packages/acs-templating/tcl/parse-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/parse-procs.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/acs-templating/tcl/parse-procs.tcl	15 Sep 2002 22:10:53 -0000	1.6
+++ openacs-4/packages/acs-templating/tcl/parse-procs.tcl	7 Oct 2002 15:08:47 -0000	1.7
@@ -355,6 +355,9 @@
   # the parse list now contains the code
   set code [join $parse_list "\n"]
 
+  # Substitute #foo# message keys with values from the message catalog
+  while {[regsub -all {([^\\])\#([-a-zA-Z0-9_:\.]+)\#} $code {\1[_ [ad_conn locale] {\2}]} code]} {}
+
   # substitute array variable references
   set pattern {([^\\])@([a-zA-Z0-9_]+)\.([a-zA-Z0-9_]+)@}
   # loop to handle the case of adjacent variable references, like @a@@b@
@@ -366,6 +369,9 @@
   # unescape protected @ references
   set code [string map { \\@ @ } $code]
 
+  # unescape protected # references
+  set code [string map { \\# # } $code]
+
   return $code
 }