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.50 -r1.51 --- openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl 18 Apr 2008 06:48:42 -0000 1.50 +++ openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl 7 Jun 2008 20:28:55 -0000 1.51 @@ -686,7 +686,7 @@ @param default Text to return if there is no message in the message catalog for the given locale. This argument is optional. If this argument is not provided or is the empty string then the text returned will - be TRANSLATION MISSING - $key. + be TRANSLATION MISSING - $key. @param substitution_list A list of values to substitute into the message. This argument should only be given for certain messages that contain place holders (on the syntax @@ -715,6 +715,12 @@ # Make sure messages are in the cache cache + # Make sure that a default of "" is transformed into Translation Missing + # As per discussion on IRC on 2008-03-06 + if { $default eq ""} { + set default "TRANSLATION MISSING" + } + if { $locale eq "" } { # No locale provided @@ -764,14 +770,18 @@ if { [message_exists_p $locale $key] } { set message [nsv_get lang_message_$locale $key] } else { - if {[string match "acs-translations.*" $key]} { - ns_log Debug "lang::message::lookup: Key '$key' does not exist in en_US" - set message "MESSAGE KEY MISSING: '$key'" + if {"TRANSLATION MISSING" != $default} { + set message $default } else { - ns_log Error "lang::message::lookup: Key '$key' does not exist in en_US" - set message "MESSAGE KEY MISSING: '$key'" + if {[string match "acs-translations.*" $key]} { + ns_log Debug "lang::message::lookup: Key '$key' does not exist in en_US" + set message "MESSAGE KEY MISSING: '$key'" + } else { + ns_log Error "lang::message::lookup: Key '$key' does not exist in en_US" + set message "MESSAGE KEY MISSING: '$key'" + } } - } + } } } }