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.2.4 -r1.32.2.5 --- openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl 23 Aug 2004 13:45:49 -0000 1.32.2.4 +++ openacs-4/packages/acs-lang/tcl/lang-util-procs.tcl 27 Aug 2004 06:17:35 -0000 1.32.2.5 @@ -309,7 +309,8 @@ return $number_of_replacements } -ad_proc -public lang::util::localize { +ad_proc -public lang::util::localize { + {-locale ""} string_with_hashes } { Takes a string with embedded message keys on the format #message_key_name# @@ -325,6 +326,10 @@ return $string_with_hashes } + if {[string equal "" $locale]} { + set locale [ad_conn locale] + } + set indices_list [get_hash_indices $string_with_hashes] set subst_string "" @@ -336,7 +341,7 @@ set message_key [string range $replacement_string 1 [expr [string length $replacement_string] - 2]] # Attempt a message lookup - set message_value [lang::message::lookup [ad_conn locale] $message_key "" "" 2] + set message_value [lang::message::lookup $locale $message_key "" "" 2] # Replace the string # LARS: We don't use regsub here, because regsub interprets certain characters