summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorericm <ericm@noemail.net>2000-08-03 21:40:15 (GMT)
committerericm <ericm@noemail.net>2000-08-03 21:40:15 (GMT)
commit03e99ddcb232901f4cc019f28c7c0d3b5c4450ba (patch)
tree3df8409f098e3e732e9572c2dda5ad8f31fb838b /library
parent9b73c9752ce3ae05d9f43528819dfdf37230acdb (diff)
downloadtcl-03e99ddcb232901f4cc019f28c7c0d3b5c4450ba.zip
tcl-03e99ddcb232901f4cc019f28c7c0d3b5c4450ba.tar.gz
tcl-03e99ddcb232901f4cc019f28c7c0d3b5c4450ba.tar.bz2
Backport of mcunknown fixes.
FossilOrigin-Name: 58519087fcf48cf754630983f70ee4605dd43f3c
Diffstat (limited to 'library')
-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