diff options
Diffstat (limited to 'library/msgcat/msgcat.tcl')
-rw-r--r-- | library/msgcat/msgcat.tcl | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl index 0f7d6d3..fb1aeb3 100644 --- a/library/msgcat/msgcat.tcl +++ b/library/msgcat/msgcat.tcl @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: msgcat.tcl,v 1.5 2000/06/30 06:28:27 ericm Exp $ +# RCS: @(#) $Id: msgcat.tcl,v 1.6 2000/07/06 21:05:02 ericm Exp $ package provide msgcat 1.1 @@ -67,7 +67,7 @@ proc msgcat::mc {src args} { } # we have not found the translation return [uplevel 1 [list [namespace origin mcunknown] \ - $::msgcat::locale $src]] + $::msgcat::locale $src] $args] } # msgcat::mclocale -- @@ -170,16 +170,23 @@ proc msgcat::mcset {locale src {dest ""}} { # be found for a string. This routine is intended to be replaced # by an application specific routine for error reporting # purposes. The default behavior is to return the source string. +# If additional args are specified, the format command will be used +# to work them into the traslated string. # # Arguments: # locale The current locale. # src The string to be translated. +# args Args to pass to the format command # # Results: # Returns the translated value. -proc msgcat::mcunknown {locale src} { - return $src +proc msgcat::mcunknown {locale src args} { + if {[llength $args]} { + return [eval [list format $src] $args] + } else { + return $src + } } # msgcat::mcmax -- |