Artifacts Associated With Ticket 219105ffffffffffffffffffffffffffffffffff
Ticket change [5911675de0] (rid 117913) by nobody on 2000-10-26 01:10:52:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 5984 Bug Version: 8.4a1 SubmitDate: '2000-07-06' LastModified: '2000-07-06' Severity: MED Status: Released Submitter: techsupp ChangedBy: ericm OS: Linux-SuSE FixedDate: '2000-07-06' FixedInVersion: 8.4a2 ClosedDate: '2000-10-25' Name: Christian Krone Comments: The comment in msgcat.tcl above the mcunknown command suggests, that users of the msgcat package can write their own mcunknown proc. So calling this function with additional arguments can generate errors, if someone really created an own version with the old interface. But I think, this should be no problem, since the additional arguments are only given to mcunknown if they are specified for mc. And only user who knows about the additional argument will do so. DesiredBehavior: It's great, that the msgcat::mc command has got an additional args argument. This way I don't need no longer do the format one layer above by myself. But it is essential for me, that the msgcat::mcunknown proc gets the additional argument, too. Otherwise I have to make a msgfile for the C locale, which contains only translations from the format strings into itself. Patch: *** msgcat.tcl.orgTue Apr 11 23:16:18 2000 --- msgcat.tclWed Jul 5 17:57:46 2000 *************** *** 67,73 **** } # we have not found the translation return [uplevel 1 [list [namespace origin mcunknown] \ ! $::msgcat::locale $src]] } # msgcat::mclocale -- --- 67,73 ---- } # we have not found the translation return [uplevel 1 [list [namespace origin mcunknown] \ ! $::msgcat::locale $src] $args] } # msgcat::mclocale -- *************** *** 170,185 **** #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. # # Arguments: #localeThe current locale. #srcThe string to be translated. # # Results: #Returns the translated value. ! proc msgcat::mcunknown {locale src} { ! return $src } # Initialize the default locale --- 170,192 ---- #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: #localeThe current locale. #srcThe string to be translated. + #argsArgs to pass to the format command # # Results: #Returns the translated value. ! proc msgcat::mcunknown {locale src args} { ! if {[llength $args]} { ! return [eval {format $src} $args] ! } else { ! return $src ! } } # Initialize the default locale *** msgcat.test.orgWed Jul 5 18:11:21 2000 --- msgcat.testWed Jul 5 12:58:43 2000 *************** *** 401,406 **** --- 401,409 ---- test msgcat-7.3 {::msgcat::mc, errors from format are propagated} { catch {::msgcat::mc format3 "good test"} } 1 + test msgcat-7.4 {::msgcat::mc, extra args are given to unknown} { + ::msgcat::mc "this is a %s" "good test" + } "this is a good test" # Reset the locale ::msgcat::mclocale $oldlocale PatchFiles: msgcat.tcl msgcat.test Thanks for the great patch; I've applied it to the sources in CVS, and this fix will go out with Tcl/Tk 8.4a2. Eric Melski The Other Tcl Guy ericm at ajubasolutions.com Ajuba Solutions -- 07/06/2000 ericm - foundin initialized to: "obsolete: 8.4a1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "msgcat::unknown should have args, too"
- type initialized to: "RFE"
Ticket change [a62c6b20c2] (rid 98552) by welch on 2000-10-26 08:34:56:
- closedate changed to: "2000-10-26T01:34:56"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [fc6f4e2090] (rid 108239) by dgp on 2001-04-20 02:48:59:
- foundin changed to: "None"
- status changed to: "Open"
- subsystem changed to: "None"
Ticket change [3b2f1ac601] (rid 112690) by dgp on 2001-04-20 02:49:41:
- closedate changed to: "2001-04-19T19:49:41"
- closer changed to: "dgp"
- status changed to: "Closed"
- subsystem changed to: "30. msgcat Package"