Artifact
8ff1deafbbdcb1fabf00b4030cb1fcf5b1c4e6d9:
Attachment "msgcat.tcl.diff" to
ticket [3544988fff]
added by
oehhar
2012-09-05 19:19:43.
0000: 2d 2d 2d 20 43 3a 2f 74 65 73 74 2f 74 63 6c 38 --- C:/test/tcl8
0010: 2e 36 62 32 2f 6c 69 62 72 61 72 79 2f 6d 73 67 .6b2/library/msg
0020: 63 61 74 2f 6d 73 67 63 61 74 2d 6f 72 69 2e 74 cat/msgcat-ori.t
0030: 63 6c 09 4d 6f 6e 20 41 75 67 20 32 37 20 31 39 cl.Mon Aug 27 19
0040: 3a 32 34 3a 35 35 20 32 30 31 32 0d 0a 2b 2b 2b :24:55 2012..+++
0050: 20 43 3a 2f 74 65 73 74 2f 74 63 6c 38 2e 36 62 C:/test/tcl8.6b
0060: 32 2f 6c 69 62 72 61 72 79 2f 6d 73 67 63 61 74 2/library/msgcat
0070: 2f 6d 73 67 63 61 74 2e 74 63 6c 09 57 65 64 20 /msgcat.tcl.Wed
0080: 53 65 70 20 30 35 20 31 31 3a 34 36 3a 31 36 20 Sep 05 11:46:16
0090: 32 30 31 32 0d 0a 40 40 20 2d 32 35 2c 31 30 20 2012..@@ -25,10
00a0: 2b 32 35 2c 37 20 40 40 0d 0a 20 20 20 20 20 23 +25,7 @@.. #
00b0: 20 52 65 63 6f 72 64 73 20 74 68 65 20 6c 69 73 Records the lis
00c0: 74 20 6f 66 20 6c 6f 63 61 6c 65 73 20 74 6f 20 t of locales to
00d0: 73 65 61 72 63 68 0d 0a 20 20 20 20 20 76 61 72 search.. var
00e0: 69 61 62 6c 65 20 4c 6f 63 6c 69 73 74 20 7b 7d iable Loclist {}
00f0: 0d 0a 20 0d 0a 2d 20 20 20 20 23 20 52 65 63 6f .. ..- # Reco
0100: 72 64 73 20 74 68 65 20 6c 6f 63 61 6c 65 20 6f rds the locale o
0110: 66 20 74 68 65 20 63 75 72 72 65 6e 74 6c 79 20 f the currently
0120: 73 6f 75 72 63 65 64 20 6d 65 73 73 61 67 65 20 sourced message
0130: 63 61 74 61 6c 6f 67 75 65 20 66 69 6c 65 3b 20 catalogue file;
0140: 74 68 69 73 0d 0a 2d 20 20 20 20 23 20 77 6f 75 this..- # wou
0150: 6c 64 20 62 65 20 70 72 6f 62 6c 65 6d 61 74 69 ld be problemati
0160: 63 20 69 66 20 61 6e 79 6f 6e 65 20 77 65 72 65 c if anyone were
0170: 20 74 6f 20 72 65 63 75 72 73 69 76 65 6c 79 20 to recursively
0180: 6c 6f 61 64 20 61 20 6d 65 73 73 61 67 65 0d 0a load a message..
0190: 2d 20 20 20 20 23 20 63 61 74 61 6c 6f 67 20 66 - # catalog f
01a0: 6f 72 20 61 20 64 69 66 66 65 72 65 6e 74 20 6c or a different l
01b0: 6f 63 61 6c 65 20 66 72 6f 6d 20 69 6e 73 69 64 ocale from insid
01c0: 65 20 61 20 63 61 74 61 6c 6f 67 2c 20 62 75 74 e a catalog, but
01d0: 20 74 68 61 74 27 73 20 6e 6f 74 20 61 0d 0a 2d that's not a..-
01e0: 20 20 20 20 23 20 63 61 73 65 20 74 68 61 74 20 # case that
01f0: 77 65 20 72 65 61 6c 6c 79 20 6e 65 65 64 20 74 we really need t
0200: 6f 20 77 6f 72 72 79 20 61 62 6f 75 74 2e 0d 0a o worry about...
0210: 2b 20 20 20 20 23 20 52 65 63 6f 72 64 73 20 74 + # Records t
0220: 68 65 20 6c 6f 63 61 6c 65 20 6f 66 20 74 68 65 he locale of the
0230: 20 63 75 72 72 65 6e 74 6c 79 20 73 6f 75 72 63 currently sourc
0240: 65 64 20 6d 65 73 73 61 67 65 20 63 61 74 61 6c ed message catal
0250: 6f 67 75 65 20 66 69 6c 65 0d 0a 20 20 20 20 20 ogue file..
0260: 76 61 72 69 61 62 6c 65 20 46 69 6c 65 4c 6f 63 variable FileLoc
0270: 61 6c 65 0d 0a 20 0d 0a 20 20 20 20 20 23 20 52 ale.. .. # R
0280: 65 63 6f 72 64 73 20 74 68 65 20 6d 61 70 70 69 ecords the mappi
0290: 6e 67 20 62 65 74 77 65 65 6e 20 73 6f 75 72 63 ng between sourc
02a0: 65 20 73 74 72 69 6e 67 73 20 61 6e 64 20 74 72 e strings and tr
02b0: 61 6e 73 6c 61 74 65 64 20 73 74 72 69 6e 67 73 anslated strings
02c0: 2e 20 20 54 68 65 0d 0a 40 40 20 2d 32 38 34 2c . The..@@ -284,
02d0: 36 20 2b 32 38 31 2c 31 30 20 40 40 0d 0a 20 0d 6 +281,10 @@.. .
02e0: 0a 20 70 72 6f 63 20 6d 73 67 63 61 74 3a 3a 6d . proc msgcat::m
02f0: 63 6c 6f 61 64 20 7b 6c 61 6e 67 64 69 72 7d 20 cload {langdir}
0300: 7b 0d 0a 20 20 20 20 20 76 61 72 69 61 62 6c 65 {.. variable
0310: 20 46 69 6c 65 4c 6f 63 61 6c 65 0d 0a 2b 20 20 FileLocale..+
0320: 20 20 23 20 53 61 76 65 20 74 68 65 20 66 69 6c # Save the fil
0330: 65 20 6c 6f 63 61 6c 65 20 69 66 20 77 65 20 61 e locale if we a
0340: 72 65 20 72 65 63 75 72 73 69 76 65 6c 79 20 63 re recursively c
0350: 61 6c 6c 65 64 0d 0a 2b 20 20 20 20 69 66 20 7b alled..+ if {
0360: 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 46 69 6c [info exists Fil
0370: 65 4c 6f 63 61 6c 65 5d 7d 20 7b 0d 0a 2b 09 73 eLocale]} {..+.s
0380: 65 74 20 6e 65 73 74 65 64 46 69 6c 65 4c 6f 63 et nestedFileLoc
0390: 61 6c 65 20 24 46 69 6c 65 4c 6f 63 61 6c 65 0d ale $FileLocale.
03a0: 0a 2b 20 20 20 20 7d 0d 0a 20 20 20 20 20 73 65 .+ }.. se
03b0: 74 20 78 20 30 0d 0a 20 20 20 20 20 66 6f 72 65 t x 0.. fore
03c0: 61 63 68 20 70 20 5b 6d 63 70 72 65 66 65 72 65 ach p [mcprefere
03d0: 6e 63 65 73 5d 20 7b 0d 0a 20 09 69 66 20 7b 20 nces] {.. .if {
03e0: 24 70 20 65 71 20 7b 7d 20 7d 20 7b 0d 0a 40 40 $p eq {} } {..@@
03f0: 20 2d 32 39 39 2c 36 20 2b 33 30 30 2c 39 20 40 -299,6 +300,9 @
0400: 40 0d 0a 20 09 20 20 20 20 75 70 6c 65 76 65 6c @.. . uplevel
0410: 20 31 20 5b 6c 69 73 74 20 3a 3a 73 6f 75 72 63 1 [list ::sourc
0420: 65 20 2d 65 6e 63 6f 64 69 6e 67 20 75 74 66 2d e -encoding utf-
0430: 38 20 24 6c 61 6e 67 66 69 6c 65 5d 0d 0a 20 09 8 $langfile].. .
0440: 20 20 20 20 75 6e 73 65 74 20 46 69 6c 65 4c 6f unset FileLo
0450: 63 61 6c 65 0d 0a 20 09 7d 0d 0a 2b 20 20 20 20 cale.. .}..+
0460: 7d 0d 0a 2b 20 20 20 20 69 66 20 7b 5b 69 6e 66 }..+ if {[inf
0470: 6f 20 65 78 69 73 74 73 20 6e 65 73 74 65 64 46 o exists nestedF
0480: 69 6c 65 4c 6f 63 61 6c 65 5d 7d 20 7b 0d 0a 2b ileLocale]} {..+
0490: 09 73 65 74 20 46 69 6c 65 4c 6f 63 61 6c 65 20 .set FileLocale
04a0: 24 6e 65 73 74 65 64 46 69 6c 65 4c 6f 63 61 6c $nestedFileLocal
04b0: 65 0d 0a 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 e.. }..
04c0: 72 65 74 75 72 6e 20 24 78 0d 0a 20 7d 0d 0a return $x.. }..