summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorericm <ericm>2000-08-03 21:40:15 (GMT)
committerericm <ericm>2000-08-03 21:40:15 (GMT)
commit6a77788f92d7a412be626c90c49e92a99f45264a (patch)
tree3df8409f098e3e732e9572c2dda5ad8f31fb838b
parent49b4e7289d871c7861e20f1081dc9582bc0a34d5 (diff)
downloadtcl-6a77788f92d7a412be626c90c49e92a99f45264a.zip
tcl-6a77788f92d7a412be626c90c49e92a99f45264a.tar.gz
tcl-6a77788f92d7a412be626c90c49e92a99f45264a.tar.bz2
Backport of mcunknown fixes.
-rw-r--r--library/msgcat/msgcat.tcl13
-rw-r--r--library/msgcat1.0/msgcat.tcl13
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