From 2adb58166d5d87703d0279a9c84ce3f5f5e5ad69 Mon Sep 17 00:00:00 2001 From: stanton Date: Thu, 10 Dec 1998 01:40:54 +0000 Subject: * library/msgcat1.0/msgcat.tcl: Fixed bad export list, fixed so all locale strings are converted to lower case, including file names. --- ChangeLog | 4 ++++ doc/msgcat.n | 6 +++--- library/msgcat/msgcat.tcl | 7 ++++--- library/msgcat1.0/msgcat.tcl | 7 ++++--- tests/msgcat.test | 18 +++++++++--------- unix/Makefile.in | 12 ++---------- 6 files changed, 26 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c54f12..753abc8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 1998-12-09 + * library/msgcat1.0/msgcat.tcl: Fixed bad export list, fixed so + all locale strings are converted to lower case, including file + names. + * generic/regcomp.c (makescan): Fixed bug in longest match case that caused anchored patterns to fail. [Bug: 897] diff --git a/doc/msgcat.n b/doc/msgcat.n index 1732678..e04d2a6 100644 --- a/doc/msgcat.n +++ b/doc/msgcat.n @@ -164,15 +164,15 @@ If a package is installed into a subdirectory of the following procedure is recommended. .IP [1] During package installation, create a subdirectory -\fBlang\fR under your package directory. +\fBmsgs\fR under your package directory. .IP [2] Copy your *.msg files into that directory. .IP [3] Add the following command to your package initialization script: .CS -# load language files, stored in lang subdirectory -::msgcat::mcload [file join [file dirname [info script]] lang] +# load language files, stored in msgs subdirectory +::msgcat::mcload [file join [file dirname [info script]] msgs] .CE .SH "POSTITIONAL CODES FOR FORMAT AND SCAN COMMANDS" diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl index c112718..3208749 100644 --- a/library/msgcat/msgcat.tcl +++ b/library/msgcat/msgcat.tcl @@ -10,12 +10,12 @@ # 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.1.2.4 1998/12/09 01:13:51 stanton Exp $ +# RCS: @(#) $Id: msgcat.tcl,v 1.1.2.5 1998/12/10 01:40:55 stanton Exp $ package provide msgcat 1.0 namespace eval msgcat { - namespace export mc mcset mclocale mclocales mcunknown + namespace export mc mcset mclocale mcpreferences mcunknown # Records the current locale as passed to mclocale variable locale "" @@ -71,6 +71,7 @@ proc msgcat::mclocale {args} { error {wrong # args: should be "mclocale ?newLocale?"} } + set args [string tolower $args] if {$len == 1} { set ::msgcat::locale $args set ::msgcat::loclist {} @@ -78,7 +79,7 @@ proc msgcat::mclocale {args} { foreach part [split $args _] { set word [string trimleft "${word}_${part}" _] set ::msgcat::loclist \ - [linsert $::msgcat::loclist 0 [string tolower $word]] + [linsert $::msgcat::loclist 0 $word] } } return $::msgcat::locale diff --git a/library/msgcat1.0/msgcat.tcl b/library/msgcat1.0/msgcat.tcl index c112718..3208749 100644 --- a/library/msgcat1.0/msgcat.tcl +++ b/library/msgcat1.0/msgcat.tcl @@ -10,12 +10,12 @@ # 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.1.2.4 1998/12/09 01:13:51 stanton Exp $ +# RCS: @(#) $Id: msgcat.tcl,v 1.1.2.5 1998/12/10 01:40:55 stanton Exp $ package provide msgcat 1.0 namespace eval msgcat { - namespace export mc mcset mclocale mclocales mcunknown + namespace export mc mcset mclocale mcpreferences mcunknown # Records the current locale as passed to mclocale variable locale "" @@ -71,6 +71,7 @@ proc msgcat::mclocale {args} { error {wrong # args: should be "mclocale ?newLocale?"} } + set args [string tolower $args] if {$len == 1} { set ::msgcat::locale $args set ::msgcat::loclist {} @@ -78,7 +79,7 @@ proc msgcat::mclocale {args} { foreach part [split $args _] { set word [string trimleft "${word}_${part}" _] set ::msgcat::loclist \ - [linsert $::msgcat::loclist 0 [string tolower $word]] + [linsert $::msgcat::loclist 0 $word] } } return $::msgcat::locale diff --git a/tests/msgcat.test b/tests/msgcat.test index a207878..dbffd97 100644 --- a/tests/msgcat.test +++ b/tests/msgcat.test @@ -12,7 +12,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.test,v 1.1.2.2 1998/12/09 01:13:52 stanton Exp $ +# RCS: @(#) $Id: msgcat.test,v 1.1.2.3 1998/12/10 01:40:56 stanton Exp $ if {[string compare test [info procs test]] == 1} then {source defs} @@ -39,7 +39,7 @@ set oldlocale [::msgcat::mclocale] test msgcat-1.1 {::msgcat::mclocale default} { ::msgcat::mclocale -} {C} +} {c} test msgcat-1.2 {::msgcat::mcpreferences, single element} { ::msgcat::mcpreferences } {c} @@ -54,20 +54,20 @@ test msgcat-1.5 {::msgcat::mcpreferences, single element} { } {en} test msgcat-1.6 {::msgcat::mclocale, two elements} { ::msgcat::mclocale en_US -} {en_US} +} {en_us} test msgcat-1.7 {::msgcat::mclocale, two elements} { ::msgcat::mclocale en_US ::msgcat::mclocale -} {en_US} +} {en_us} test msgcat-1.8 {::msgcat::mcpreferences, two elements} { ::msgcat::mcpreferences } {en_us en} test msgcat-1.9 {::msgcat::mclocale, three elements} { ::msgcat::mclocale en_US_funky -} {en_US_funky} +} {en_us_funky} test msgcat-1.10 {::msgcat::mclocale, three elements} { ::msgcat::mclocale -} {en_US_funky} +} {en_us_funky} test msgcat-1.11 {::msgcat::mcpreferences, three elements} { ::msgcat::mcpreferences } {en_us_funky en_us en} @@ -238,7 +238,7 @@ set locales {en en_US en_US_funky} catch {file mkdir msgdir} foreach l $locales { - set fd [open [file join msgdir $l.msg] w] + set fd [open [string tolower [file join msgdir $l.msg]] w] puts $fd "::msgcat::mcset $l abc abc-$l" close $fd } @@ -289,14 +289,14 @@ test msgcat-5.9 {::msgcat::mcload} { rename ::msgcat::mcunknown {} rename oldproc ::msgcat::mcunknown set result -} {unknown:no_FI_notexist:abc} +} {unknown:no_fi_notexist:abc} # # Clean up the test files # foreach l $locales { - file delete [file join msgdir $l.msg] + file delete [string tolower [file join msgdir $l.msg]] } # Clean out the msg catalogs diff --git a/unix/Makefile.in b/unix/Makefile.in index 967f521..28870e3 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -5,7 +5,7 @@ # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.1.2.10 1998/12/10 00:49:46 stanton Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.1.2.11 1998/12/10 01:40:56 stanton Exp $ # Current Tcl version; used in various names. @@ -998,14 +998,6 @@ dist: $(UNIX_DIR)/configure $(DISTDIR)/unix/dltest cp -p $(UNIX_DIR)/dltest/configure.in $(UNIX_DIR)/dltest/configure \ $(UNIX_DIR)/dltest/README $(DISTDIR)/unix/dltest - mkdir $(DISTDIR)/tools - cp -p $(TOP_DIR)/tools/*.in $(TOP_DIR)/tools/*.c \ - $(TOP_DIR)/tools/*.tcl $(TOP_DIR)/tools/*.hpj \ - $(TOP_DIR)/tools/*.wse $(TOP_DIR)/tools/str2c \ - $(TOP_DIR)/tools/README $(DISTDIR)/tools - cp -p $(TOP_DIR)/license.terms $(DISTDIR)/tools - mkdir $(DISTDIR)/tools/encoding - cp `ls -d1 $(TOP_DIR)/tools/encoding/*|egrep -i -v "(CVS|SCCS|TAGS|~|,|#|%|core|\.l?o)"` $(DISTDIR)/tools/encoding # # The following target can only be used for non-patch releases. Use @@ -1018,7 +1010,7 @@ alldist: dist $(DISTROOT)/$(ZIPNAME) cd $(DISTROOT); tar cf $(DISTNAME).tar $(DISTNAME); \ gzip -9 -c $(DISTNAME).tar > $(DISTNAME).tar.gz; \ - compress $(DISTNAME).tar; zip -r8 $(ZIPNAME) $(DISTNAME) + compress $(DISTNAME).tar; zip -qr8 $(ZIPNAME) $(DISTNAME) # # The target below is similar to "alldist" except it works for patch -- cgit v0.12