From 03e99ddcb232901f4cc019f28c7c0d3b5c4450ba Mon Sep 17 00:00:00 2001 From: ericm Date: Thu, 3 Aug 2000 21:40:15 +0000 Subject: Backport of mcunknown fixes. FossilOrigin-Name: 58519087fcf48cf754630983f70ee4605dd43f3c --- library/msgcat/msgcat.tcl | 13 ++++++++++--- library/msgcat1.0/msgcat.tcl | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl index 4619ae1..cd78c23 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.4 2000/04/11 21:16:18 ericm Exp $ +# RCS: @(#) $Id: msgcat.tcl,v 1.4.2.1 2000/08/03 21:40:15 ericm Exp $ package provide msgcat 1.0 @@ -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 + } } # Initialize the default locale diff --git a/library/msgcat1.0/msgcat.tcl b/library/msgcat1.0/msgcat.tcl index 4619ae1..cd78c23 100644 --- a/library/msgcat1.0/msgcat.tcl +++ b/library/msgcat1.0/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.4 2000/04/11 21:16:18 ericm Exp $ +# RCS: @(#) $Id: msgcat.tcl,v 1.4.2.1 2000/08/03 21:40:15 ericm Exp $ package provide msgcat 1.0 @@ -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 + } } # Initialize the default locale -- cgit v0.12