author | Claus Gittinger <cg@exept.de> |
Thu, 03 Mar 2011 19:17:42 +0100 | |
changeset 5719 | 014212ef8765 |
parent 5653 | 0e2dd1102337 |
child 5781 | fc35ed4fd223 |
permissions | -rw-r--r-- |
5 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
72 | 3 |
All Rights Reserved |
5 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
3263 | 12 |
"{ Package: 'stx:libview' }" |
13 |
||
0 | 14 |
Dictionary subclass:#ResourcePack |
4085 | 15 |
instanceVariableNames:'packsClassName fileReadFailed superPack projectPack' |
5483 | 16 |
classVariableNames:'Packs DebugModifications' |
308
54fa63d274fa
also allow "/ for comment lines
Claus Gittinger <cg@exept.de>
parents:
292
diff
changeset
|
17 |
poolDictionaries:'' |
3484 | 18 |
category:'Interface-Internationalization' |
0 | 19 |
! |
20 |
||
1173
86a212598655
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
1078
diff
changeset
|
21 |
!ResourcePack class methodsFor:'documentation'! |
46 | 22 |
|
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
72 | 26 |
All Rights Reserved |
5 | 27 |
|
46 | 28 |
This software is furnished under a license and may be used |
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
! |
|
5 | 36 |
|
46 | 37 |
documentation |
38 |
" |
|
1942 | 39 |
This class supports easy customization of smalltalk code (i.e. internationalization |
40 |
and viewStyle adaption). |
|
145 | 41 |
ResourcePacks are class specific, meaning that every subclass of View |
1942 | 42 |
and ApplicationModel has an instance of ResourcePack (instVar called 'resources') |
43 |
which is created when the first instance of the view/app is created, |
|
44 |
and cached in a class-instVar (so the file is only read once). |
|
54 | 45 |
|
50 | 46 |
The resourcePack consists of a mapping from strings to values, which are |
47 |
then used in labels, buttons, menus etc. |
|
48 |
The resourcePack initializes itself from a file found in 'resources/<className>.rs', |
|
49 |
where 'className' is built by the usual abbreviation mechanism (see abbrev-files). |
|
1942 | 50 |
|
50 | 51 |
Conditional mappings are possible, by including lines as: |
5483 | 52 |
#if <expression> |
53 |
#endif |
|
50 | 54 |
in the resourcefile. Example: |
55 |
file 'foo.rs': |
|
5483 | 56 |
#if Language == #de |
57 |
'abort' 'Abbruch' |
|
58 |
#endif |
|
59 |
#if Language == #fr |
|
60 |
'abort' 'canceller' |
|
61 |
#endif |
|
145 | 62 |
|
63 |
the corresponding resource-strings are accessed (from methods within the class) |
|
64 |
using: |
|
5483 | 65 |
resources string:'abort' |
145 | 66 |
|
54 | 67 |
returning the mapped string (i.e. 'Abbruch' if the global Language is set |
3422 | 68 |
to #de).. |
145 | 69 |
|
1942 | 70 |
If no corresponding entry is found in the resources, the key is returned; |
71 |
alternatively, use: |
|
5483 | 72 |
resources string:'foo' default:'bar' |
1942 | 73 |
which returns 'bar', if no resource definition for 'foo' is found. |
74 |
||
54 | 75 |
Translations can also include arguments, such as: |
5483 | 76 |
resources string:'really delete %1' with:fileName |
145 | 77 |
|
78 |
This scheme has the advantage, that you can write your programs using your |
|
79 |
native language strings. Later, when new languages are to be supported, |
|
80 |
simply create a resource file for the class and add translations for |
|
81 |
all those strings. (find the keys by looking at users of resource or senders |
|
1942 | 82 |
of 'string:*'). |
83 |
Notice, that the grammar of different languages may imply a reordering, |
|
84 |
so the above string becomes the german 'wollen Sie %1 wirklich löschen'; |
|
85 |
so using percent-placeholders is much better than simple concatenations of |
|
86 |
arguments to the question. |
|
145 | 87 |
|
5653 | 88 |
More languages can be added later without any change in the code, or recompilation |
89 |
or the like. Even by people without access to the source code (i.e. which only have the |
|
90 |
applications binary). |
|
145 | 91 |
|
92 |
Also, unsupported languages' strings are simply left unchanged - if you |
|
93 |
write your application in (say) english, and only plan to use it in english, |
|
5653 | 94 |
no additional work is required (i.e you don't even need a resource file then). |
145 | 95 |
Strings for unknown languages will come in english |
96 |
(which is better than nothing or empty button labels ;-) |
|
97 |
||
5653 | 98 |
Notice, that you can also translate engish to english, by providing an en.rs file. |
99 |
This is sometimes useful to fix typing errors or bad syntax in the english, |
|
100 |
as sometimes made by the programmer, without a need to recompile or to also adjust other |
|
101 |
language translations. |
|
102 |
||
103 |
Finally, this scheme is also compatible to a pure enum-key based translation mechanism, |
|
104 |
as typically used in the C-world. |
|
105 |
Simple use keys as argument, and provide translations for all languages (incl. english). |
|
106 |
For example: |
|
107 |
Button label:(resources string:#BTN_FOO_LABEL) |
|
108 |
||
109 |
||
145 | 110 |
Summary: |
5653 | 111 |
in subclasses of View and ApplicationModel, instead of writing: |
145 | 112 |
|
5483 | 113 |
... |
114 |
b := Button label:'press me' |
|
115 |
... |
|
145 | 116 |
|
5483 | 117 |
always write: |
612 | 118 |
|
5483 | 119 |
... |
120 |
b := Button label:(resources string:'press me') |
|
121 |
... |
|
145 | 122 |
|
5483 | 123 |
if your class is not a subclass of one of the above, AND you need |
5653 | 124 |
resource translations, you won't inherit the resources variable |
5483 | 125 |
(which is automatically initialized). |
126 |
In this case, you have to ask the ResourcePack class explicitely for |
|
127 |
a corresponding package: |
|
128 |
||
129 |
ResourcePack for:aClassName |
|
5653 | 130 |
or (even better): |
131 |
ResourcePack forPackage:aPackageID |
|
145 | 132 |
|
5483 | 133 |
as an example, see how the Date class gets the national names of |
134 |
week & monthnames. |
|
145 | 135 |
|
5483 | 136 |
Debugging: |
137 |
in the past, it happened that strings as returned by me were modified by someone else |
|
138 |
(replaceAll:with:) and then lead to invalid presentation in the future. |
|
139 |
To detect any bad guy which writes into one of my returned strings, set the DebugModifications |
|
140 |
classVar to true. Then I will return ImmutableStrings which trap on writes. |
|
141 |
||
612 | 142 |
[author:] |
5483 | 143 |
Claus Gittinger |
145 | 144 |
" |
145 |
! |
|
146 |
||
147 |
examples |
|
148 |
" |
|
149 |
normally, resources are found in files named after their classes sourcefile |
|
150 |
For example, the FileBrowsers resources are found in 'FBrowser.rs'. |
|
151 |
For the examples below, we process resources from a constant string; |
|
3762 | 152 |
this is NOT representative. |
153 |
[exBegin] |
|
154 |
|stream res| |
|
145 | 155 |
|
3762 | 156 |
stream := ReadStream on:' |
145 | 157 |
foo ''the translation for foo'' |
3422 | 158 |
#if Language == #de |
145 | 159 |
bar ''die deutsche uebersetzung von bar'' |
160 |
baz ''baz hat den Wert %1'' |
|
161 |
#endif |
|
3422 | 162 |
#if Language == #fr |
145 | 163 |
bar ''bar en francaise'' |
164 |
baz ''%1, c''''est baz'' |
|
165 |
#endif |
|
166 |
||
167 |
'. |
|
168 |
||
3762 | 169 |
res := ResourcePack new readFromResourceStream:stream in:nil. |
145 | 170 |
|
3762 | 171 |
Transcript showCR:'baz is translated to: ' , (res string:'baz' with:'1234'). |
172 |
Transcript showCR:'bar is translated to: ' , (res string:'bar'). |
|
173 |
Transcript showCR:'foo is translated to: ' , (res string:'foo'). |
|
174 |
Transcript showCR:'fooBar is translated to: ' , (res string:'fooBar'). |
|
175 |
[exEnd] |
|
145 | 176 |
set the Language to french: |
3762 | 177 |
[exBegin] |
178 |
Language := #fr |
|
179 |
[exEnd] |
|
145 | 180 |
and repeat the above. |
620 | 181 |
back to english: |
3762 | 182 |
[exBegin] |
183 |
Language := #en |
|
184 |
[exEnd] |
|
620 | 185 |
back to german: |
3762 | 186 |
[exBegin] |
187 |
Language := #de |
|
188 |
[exEnd] |
|
46 | 189 |
" |
190 |
! ! |
|
5 | 191 |
|
1173
86a212598655
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
1078
diff
changeset
|
192 |
!ResourcePack class methodsFor:'initialization'! |
0 | 193 |
|
72 | 194 |
flushCachedResourcePacks |
24 | 195 |
"forget all cached resources - needed after a style change" |
196 |
||
197 |
Packs := nil. |
|
198 |
self initialize |
|
199 |
||
4093 | 200 |
" |
201 |
ResourcePack flushCachedResourcePacks |
|
202 |
" |
|
244 | 203 |
! |
204 |
||
205 |
initialize |
|
206 |
Packs isNil ifTrue:[ |
|
4623 | 207 |
Packs := WeakArray new:100 |
244 | 208 |
]. |
209 |
||
4093 | 210 |
" |
211 |
ResourcePack initialize |
|
212 |
" |
|
4623 | 213 |
|
214 |
"Modified: / 18-09-2006 / 20:37:38 / cg" |
|
244 | 215 |
! ! |
216 |
||
1173
86a212598655
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
1078
diff
changeset
|
217 |
!ResourcePack class methodsFor:'instance creation'! |
244 | 218 |
|
219 |
for:aClass |
|
220 |
"get the full resource definitions for aClass (i.e. with super packs). |
|
221 |
Also leave the resulting pack in the cache for faster access next time." |
|
222 |
||
4619 | 223 |
^ self for:aClass cached:false |
4030 | 224 |
|
225 |
" |
|
226 |
ResourcePack for:TextView |
|
227 |
ResourcePack for:CodeView |
|
228 |
ResourcePack for:Workspace |
|
229 |
ResourcePack for:View |
|
230 |
ResourcePack for:ErrorLogger |
|
231 |
ResourcePack for:NewLauncher |
|
232 |
Workspace classResources |
|
233 |
" |
|
4619 | 234 |
|
235 |
"Modified: / 18-09-2006 / 19:02:57 / cg" |
|
4030 | 236 |
! |
237 |
||
238 |
for:aClass cached:cached |
|
239 |
"get the full resource definitions for aClass (i.e. with super packs). |
|
240 |
Also leave the resulting pack in the cache for faster access next time." |
|
241 |
||
3980
443283639aed
resourceDirectory asked from class
Claus Gittinger <cg@exept.de>
parents:
3979
diff
changeset
|
242 |
|nm pack rsrcDir baseName| |
244 | 243 |
|
2033
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
244 |
nm := aClass resourcePackName. |
4030 | 245 |
cached ifTrue:[ |
246 |
pack := self searchCacheFor:nm. |
|
247 |
pack notNil ifTrue:[^ pack]. |
|
248 |
]. |
|
244 | 249 |
|
3049
d5f2b3f66e37
load resources from package directory, if present
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
250 |
baseName := (Smalltalk fileNameForClass:nm) , '.rs'. |
3980
443283639aed
resourceDirectory asked from class
Claus Gittinger <cg@exept.de>
parents:
3979
diff
changeset
|
251 |
rsrcDir := aClass resourceDirectory. |
2970
928387584c9c
for non-base system classes (i.e. package not stx:),
Claus Gittinger <cg@exept.de>
parents:
2608
diff
changeset
|
252 |
|
4148 | 253 |
"/ CHECK this |
254 |
"/ (rsrcDir notNil and:[rsrcDir suffix = 'rs']) ifTrue:[ |
|
255 |
"/ baseName := (Smalltalk fileNameForClass: rsrcDir tail asFilename withoutSuffix pathName),'.rs'. |
|
256 |
"/ rsrcDir := rsrcDir head asFilename. |
|
257 |
"/ ]. |
|
258 |
||
4643 | 259 |
rsrcDir notNil ifTrue:[ |
260 |
pack := self new. |
|
261 |
rsrcDir exists ifTrue:[ |
|
262 |
(rsrcDir construct:baseName) exists ifTrue:[ |
|
263 |
pack := self fromFile:baseName directory:(rsrcDir name) cached:true. |
|
264 |
]. |
|
265 |
] |
|
2970
928387584c9c
for non-base system classes (i.e. package not stx:),
Claus Gittinger <cg@exept.de>
parents:
2608
diff
changeset
|
266 |
] ifFalse:[ |
4643 | 267 |
pack := self fromFile:baseName directory:'resources' cached:true. |
2970
928387584c9c
for non-base system classes (i.e. package not stx:),
Claus Gittinger <cg@exept.de>
parents:
2608
diff
changeset
|
268 |
]. |
4619 | 269 |
aClass superclass notNil ifTrue:[ |
3808 | 270 |
pack superPack:(self for:(aClass superclass)). |
244 | 271 |
]. |
4093 | 272 |
pack packsClassOrFileName:nm. |
4030 | 273 |
cached ifTrue:[ |
274 |
self addToCache:pack. |
|
275 |
]. |
|
4617 | 276 |
pack projectPack:(self forPackage:(aClass resourcePackage) cached:true). |
244 | 277 |
^ pack |
278 |
||
4656 | 279 |
" |
280 |
ResourcePack forPackage:'bosch:dapasx' cached:true |
|
281 |
||
3046 | 282 |
ResourcePack for:TextView |
244 | 283 |
ResourcePack for:CodeView |
3046 | 284 |
ResourcePack for:Workspace |
3049
d5f2b3f66e37
load resources from package directory, if present
Claus Gittinger <cg@exept.de>
parents:
3047
diff
changeset
|
285 |
ResourcePack for:View |
2970
928387584c9c
for non-base system classes (i.e. package not stx:),
Claus Gittinger <cg@exept.de>
parents:
2608
diff
changeset
|
286 |
ResourcePack for:ErrorLogger |
3101
38cc69894380
fix to avoid loosing the directory with #includes
Claus Gittinger <cg@exept.de>
parents:
3097
diff
changeset
|
287 |
ResourcePack for:NewLauncher |
244 | 288 |
Workspace classResources |
289 |
" |
|
4617 | 290 |
|
5642
494cea2296dc
comment/format in: #for:cached:
Claus Gittinger <cg@exept.de>
parents:
5603
diff
changeset
|
291 |
"Modified: / 01-11-2010 / 09:09:43 / cg" |
244 | 292 |
! |
293 |
||
4078 | 294 |
forPackage:package |
295 |
"get the full resource definitions given a package id (such as stx:libbasic'). |
|
296 |
Also leave the resulting pack in the cache for faster access next time." |
|
297 |
||
298 |
^ self forPackage:package cached:true |
|
299 |
||
300 |
" |
|
301 |
ResourcePack forPackage:'stx:libbasic' |
|
4618 | 302 |
ResourcePack forPackage:'stx:libtool' |
4078 | 303 |
" |
4618 | 304 |
|
305 |
"Modified: / 18-09-2006 / 18:45:31 / cg" |
|
4078 | 306 |
! |
307 |
||
308 |
forPackage:package cached:cached |
|
309 |
"get the full resource definitions given a package id (such as stx:libbasic'). |
|
310 |
Also optionally leave the resulting pack in the cache for faster access next time." |
|
311 |
||
4673 | 312 |
^ self forPackage:package resourceFileName:'resources.rs' cached:cached |
313 |
||
314 |
" |
|
315 |
ResourcePack forPackage:'stx:libbasic' cached:false |
|
316 |
" |
|
317 |
||
318 |
"Modified: / 19-10-2006 / 23:18:28 / cg" |
|
319 |
! |
|
320 |
||
321 |
forPackage:package resourceFileName:resourceFileName cached:cached |
|
322 |
"get the full resource definitions given a package id (such as stx:libbasic'). |
|
323 |
Also optionally leave the resulting pack in the cache for faster access next time." |
|
324 |
||
4428 | 325 |
|fullName pack rsrcDir file| |
4078 | 326 |
|
4673 | 327 |
fullName := package , '/resources/',resourceFileName. |
4078 | 328 |
|
329 |
cached ifTrue:[ |
|
330 |
pack := self searchCacheFor:fullName. |
|
331 |
pack notNil ifTrue:[^ pack]. |
|
332 |
]. |
|
333 |
||
334 |
rsrcDir := Smalltalk projectDirectoryForPackage:package. |
|
4428 | 335 |
rsrcDir isNil ifTrue:[ |
4673 | 336 |
file := Smalltalk getResourceFileName:resourceFileName forPackage:package. |
4428 | 337 |
file isNil ifTrue:[^ nil]. |
338 |
rsrcDir := file asFilename directory. |
|
339 |
] ifFalse:[ |
|
340 |
rsrcDir := rsrcDir asFilename construct:'resources'. |
|
341 |
rsrcDir exists ifFalse:[^ nil]. |
|
342 |
]. |
|
4078 | 343 |
|
4673 | 344 |
pack := self fromFile:resourceFileName directory:rsrcDir cached:cached. |
4093 | 345 |
pack packsClassOrFileName:fullName. |
4078 | 346 |
^ pack |
347 |
||
348 |
" |
|
4673 | 349 |
ResourcePack forPackage:'stx:libbasic' resourceFileName:'resources.rs' cached:false |
4078 | 350 |
" |
4656 | 351 |
|
352 |
"Modified: / 19-10-2006 / 23:18:28 / cg" |
|
4078 | 353 |
! |
354 |
||
244 | 355 |
fromFile:aFileName |
4611 | 356 |
"get the resource definitions from a file in the default directory." |
244 | 357 |
|
358 |
^ self fromFile:aFileName directory:'resources' |
|
359 |
||
360 |
" |
|
361 |
ResourcePack fromFile:'SBrowser.rs' |
|
362 |
ResourcePack fromFile:'FBrowser.rs' |
|
363 |
ResourcePack fromFile:'Smalltalk.rs' |
|
3678 | 364 |
ResourcePack fromFile:'Smalltalk.rs' asFilename |
3983 | 365 |
ResourcePack fromFile:'../../libtool/resources/AboutBox_ru.rs' asFilename |
244 | 366 |
" |
367 |
! |
|
368 |
||
369 |
fromFile:aFileName directory:dirName |
|
4611 | 370 |
"get the resource definitions from a file in a directory." |
371 |
||
372 |
^ self fromFile:aFileName directory:dirName cached:false |
|
373 |
! |
|
374 |
||
375 |
fromFile:aFileName directory:dirName cached:cached |
|
244 | 376 |
"get the resource definitions from a file in a directory. |
377 |
Uncached low-level entry." |
|
378 |
||
379 |
|newPack| |
|
380 |
||
381 |
newPack := self new. |
|
382 |
newPack readFromFile:aFileName directory:dirName. |
|
4611 | 383 |
cached ifTrue:[ |
384 |
self addToCache:newPack. |
|
385 |
]. |
|
244 | 386 |
^ newPack |
0 | 387 |
! ! |
388 |
||
1173
86a212598655
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
1078
diff
changeset
|
389 |
!ResourcePack class methodsFor:'private'! |
54 | 390 |
|
391 |
addToCache:aPack |
|
392 |
|idx| |
|
0 | 393 |
|
4084 | 394 |
Packs isNil ifTrue:[ |
395 |
self initialize. |
|
396 |
]. |
|
397 |
||
54 | 398 |
idx := Packs identityIndexOf:nil. |
399 |
idx == 0 ifTrue:[ |
|
4084 | 400 |
idx := Packs identityIndexOf:0 |
1078
f7b6f15899ab
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
401 |
]. |
f7b6f15899ab
changed WeakArray to set emptied slots to zero
Claus Gittinger <cg@exept.de>
parents:
1042
diff
changeset
|
402 |
idx == 0 ifTrue:[ |
4084 | 403 |
" |
404 |
throw away oldest |
|
405 |
" |
|
406 |
idx := Packs size. |
|
407 |
Packs replaceFrom:1 to:idx-1 with:Packs startingAt:2. |
|
54 | 408 |
]. |
5357 | 409 |
aPack at:'__language__' put:(UserPreferences current language,'_',UserPreferences current languageTerritory). |
4619 | 410 |
Packs at:idx put:aPack. |
411 |
||
412 |
"Modified: / 18-09-2006 / 19:12:12 / cg" |
|
54 | 413 |
! |
0 | 414 |
|
4093 | 415 |
searchCacheFor:aClassOrFileName |
4619 | 416 |
|sz "{ Class: SmallInteger }" lang| |
0 | 417 |
|
24 | 418 |
Packs isNil ifTrue:[ |
4093 | 419 |
self initialize. |
420 |
^ nil |
|
0 | 421 |
]. |
54 | 422 |
|
5357 | 423 |
lang := (UserPreferences current language,'_',UserPreferences current languageTerritory). |
4619 | 424 |
|
54 | 425 |
sz := Packs size. |
426 |
1 to:sz do:[:idx | |
|
4093 | 427 |
|aPack| |
54 | 428 |
|
4093 | 429 |
aPack := Packs at:idx. |
430 |
(aPack notNil and:[aPack ~~ 0]) ifTrue:[ |
|
4619 | 431 |
(aPack at:'__language__' ifAbsent:nil) = lang ifTrue:[ |
432 |
aClassOrFileName = aPack packsClassOrFileName ifTrue:[ |
|
433 |
" |
|
434 |
bring to front for LRU |
|
435 |
" |
|
436 |
idx ~~ 1 ifTrue:[ |
|
437 |
Packs replaceFrom:2 to:idx with:Packs startingAt:1. |
|
438 |
Packs at:1 put:aPack. |
|
439 |
]. |
|
440 |
^ aPack |
|
441 |
] |
|
4093 | 442 |
] |
443 |
] |
|
0 | 444 |
]. |
54 | 445 |
^ nil |
123 | 446 |
|
447 |
" |
|
448 |
ResourcePack searchCacheFor:'TextView' |
|
449 |
" |
|
4619 | 450 |
|
451 |
"Modified: / 18-09-2006 / 19:13:13 / cg" |
|
54 | 452 |
! ! |
453 |
||
4509 | 454 |
!ResourcePack class methodsFor:'utilities'! |
455 |
||
456 |
extractEncodingFromLine:lineString |
|
457 |
|rest encoding| |
|
458 |
||
459 |
(lineString startsWith:'encoding') ifFalse:[^ nil]. |
|
460 |
||
461 |
rest := lineString copyFrom:9. |
|
462 |
rest := rest withoutSeparators. |
|
463 |
(rest startsWith:'#') ifTrue:[ |
|
464 |
rest := rest copyFrom:2. |
|
465 |
]. |
|
466 |
(rest startsWith:'''') ifTrue:[ |
|
467 |
rest := rest copyFrom:2. |
|
468 |
(rest endsWith:'''') ifTrue:[ |
|
469 |
rest := rest copyWithoutLast:1. |
|
470 |
]. |
|
471 |
]. |
|
472 |
encoding := rest asSymbol. |
|
473 |
^ encoding. |
|
474 |
! |
|
475 |
||
476 |
processResourceLine:lineString encoding:encodingSymbolOrEncoder file:fileName printErrorWith:printError for:aResourcePack |
|
477 |
"process a single valid line (i.e. #ifdef & #include has already been processed)" |
|
478 |
||
4510 | 479 |
self |
480 |
processResourceLine:lineString encoding:encodingSymbolOrEncoder file:fileName printErrorWith:printError for:aResourcePack |
|
481 |
keepUselessTranslations:false. |
|
482 |
! |
|
483 |
||
484 |
processResourceLine:lineString encoding:encodingSymbolOrEncoder file:fileName printErrorWith:printError for:aResourcePack keepUselessTranslations:keepUselessTranslations |
|
485 |
"process a single valid line (i.e. #ifdef & #include has already been processed)" |
|
486 |
||
5080 | 487 |
|name lineStream idx rest macroName value |
4670 | 488 |
conditional hasError decoder oldValue ignoreTranslation indirect| |
4509 | 489 |
|
4531 | 490 |
encodingSymbolOrEncoder notNil ifTrue:[ |
491 |
encodingSymbolOrEncoder isSymbol ifTrue:[ |
|
492 |
decoder := CharacterEncoder encoderFor:encodingSymbolOrEncoder ifAbsent:nil. |
|
5080 | 493 |
decoder isNil ifTrue:[ decoder := CharacterEncoder nullEncoderInstance ]. |
4531 | 494 |
] ifFalse:[ |
495 |
decoder := encodingSymbolOrEncoder |
|
496 |
]. |
|
497 |
]. |
|
498 |
||
499 |
decoder notNil ifTrue:[ |
|
5080 | 500 |
lineStream := (decoder decodeString:lineString) readStream. |
4531 | 501 |
] ifFalse:[ |
5080 | 502 |
lineStream := lineString readStream. |
4531 | 503 |
]. |
4509 | 504 |
lineStream signalAtEnd:false. |
505 |
lineStream skipSeparators. |
|
5080 | 506 |
|
4509 | 507 |
lineStream peek == $# ifTrue:[ |
508 |
name := Array |
|
509 |
readFrom:lineStream |
|
510 |
onError:[ |
|
511 |
printError value:('invalid line <' , lineString , '>'). |
|
512 |
nil |
|
513 |
]. |
|
514 |
] ifFalse:[ |
|
515 |
lineStream peek == $' ifTrue:[ |
|
5080 | 516 |
name := String |
4534
d71ca6ac7cbe
handle unicode string-keys and values
Claus Gittinger <cg@exept.de>
parents:
4531
diff
changeset
|
517 |
readSmalltalkStringFrom:lineStream |
4509 | 518 |
onError:[ |
519 |
printError value:('invalid line <' , lineString , '>'). |
|
520 |
nil |
|
521 |
]. |
|
522 |
] ifFalse:[ |
|
523 |
name := lineStream upToSeparator. |
|
524 |
]. |
|
525 |
]. |
|
526 |
||
4510 | 527 |
name isNil ifTrue:[^ self ]. |
528 |
||
529 |
ignoreTranslation := false. |
|
530 |
hasError := false. |
|
4509 | 531 |
|
4510 | 532 |
lineStream skipSeparators. |
533 |
idx := lineStream position1Based + 1. |
|
534 |
||
535 |
lineStream peek == $< ifTrue:[ |
|
536 |
" |
|
537 |
skip <type> if present |
|
538 |
" |
|
539 |
lineStream skipThrough:$>. |
|
4509 | 540 |
lineStream skipSeparators. |
541 |
idx := lineStream position1Based + 1. |
|
4510 | 542 |
]. |
4509 | 543 |
|
4670 | 544 |
conditional := indirect := false. |
4510 | 545 |
lineStream peek == $? ifTrue:[ |
4670 | 546 |
conditional := true. |
4510 | 547 |
lineStream next. |
548 |
lineStream skipSeparators. |
|
4670 | 549 |
]. |
550 |
||
551 |
lineStream peek == $@ ifTrue:[ |
|
552 |
indirect := true. |
|
553 |
lineStream next. |
|
554 |
lineStream skipSeparators. |
|
4510 | 555 |
]. |
4509 | 556 |
|
4510 | 557 |
lineStream peek == $= ifTrue:[ |
558 |
lineStream next. |
|
559 |
||
560 |
macroName := lineStream nextAlphaNumericWord. |
|
561 |
[lineStream peek == $.] whileTrue:[ |
|
4509 | 562 |
lineStream next. |
4510 | 563 |
lineStream peek notNil ifTrue:[ |
564 |
macroName := macroName , '.' , (lineStream nextAlphaNumericWord) |
|
565 |
] |
|
566 |
]. |
|
567 |
rest := lineStream upToEnd. |
|
568 |
value := aResourcePack at:macroName ifAbsent:nil. |
|
569 |
(value isNil) ifTrue:[ |
|
570 |
hasError := true. |
|
571 |
printError value:('bad (nil-valued) macro: ' , macroName). |
|
572 |
]. |
|
4678
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
573 |
"/ value isBlock ifTrue:[ |
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
574 |
"/ value := value value |
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
575 |
"/ ]. |
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
576 |
rest isBlank ifFalse:[ |
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
577 |
value := Compiler evaluate:('self ' , rest) |
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
578 |
receiver:value |
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
579 |
notifying:nil |
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
580 |
compile:false. |
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
581 |
(value == #Error) ifTrue:[ |
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
582 |
hasError := true. |
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
583 |
printError value:('error in: "self ' , rest , '"'). |
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
584 |
] |
4510 | 585 |
] |
586 |
] ifFalse:[ |
|
587 |
lineStream peek == $' ifTrue:[ |
|
5080 | 588 |
value := String |
4534
d71ca6ac7cbe
handle unicode string-keys and values
Claus Gittinger <cg@exept.de>
parents:
4531
diff
changeset
|
589 |
readSmalltalkStringFrom:lineStream |
4510 | 590 |
onError:[ |
591 |
printError value:('invalid line <' , lineString , '>'). |
|
592 |
nil |
|
593 |
]. |
|
594 |
] ifFalse:[ |
|
4509 | 595 |
rest := lineStream upToEnd. |
5189 | 596 |
value := Compiler evaluate:rest compile:"true" false. |
4510 | 597 |
]. |
598 |
(value == #Error) ifTrue:[ |
|
599 |
hasError := true. |
|
600 |
printError value:('error in: "' , rest , '"'). |
|
4509 | 601 |
] ifFalse:[ |
4531 | 602 |
"/ value isString ifTrue:[ |
603 |
"/ decoder notNil ifTrue:[ |
|
604 |
"/ value := decoder decodeString:value |
|
605 |
"/ ] |
|
606 |
"/ ] |
|
4510 | 607 |
] |
608 |
]. |
|
609 |
||
5430
128e9b37fd8a
comment/format in: #processResourceLine:encoding:file:printErrorWith:for:
sr
parents:
5370
diff
changeset
|
610 |
"/ Transcript show:name; show:' -> '; showCR:value. |
128e9b37fd8a
comment/format in: #processResourceLine:encoding:file:printErrorWith:for:
sr
parents:
5370
diff
changeset
|
611 |
|
4510 | 612 |
hasError ifFalse:[ |
613 |
(conditional not |
|
614 |
or:[(aResourcePack includesKey:name) not]) ifTrue:[ |
|
615 |
name = value ifTrue:[ |
|
616 |
keepUselessTranslations ifFalse:[ |
|
4509 | 617 |
printError value:('useless resource: "' , name , '"'). |
4510 | 618 |
ignoreTranslation := true |
619 |
]. |
|
620 |
]. |
|
621 |
ignoreTranslation ifFalse:[ |
|
622 |
oldValue := aResourcePack at:name ifAbsent:nil. |
|
623 |
oldValue notNil ifTrue:[ |
|
624 |
oldValue ~= value ifTrue:[ |
|
625 |
printError value:('conflicting resource: "' , name , '"'). |
|
626 |
printError value:('oldValue: ' , oldValue printString). |
|
627 |
printError value:('newValue: ' , value printString). |
|
628 |
] ifFalse:[ |
|
629 |
printError value:('duplicate resource: "' , name , '"'). |
|
4509 | 630 |
]. |
4510 | 631 |
]. |
4670 | 632 |
indirect ifTrue:[ |
633 |
value := aResourcePack string:value. |
|
634 |
]. |
|
5431 | 635 |
|
5483 | 636 |
DebugModifications == true ifTrue:[ |
637 |
"/ for debugging only !! (not all primitive code is ready for immutableStrings) |
|
638 |
value class == String ifTrue:[ |
|
639 |
value := value asImmutableString. |
|
640 |
]. |
|
641 |
]. |
|
5431 | 642 |
|
4510 | 643 |
aResourcePack at:name put:value. |
4509 | 644 |
] |
645 |
] |
|
646 |
] |
|
4534
d71ca6ac7cbe
handle unicode string-keys and values
Claus Gittinger <cg@exept.de>
parents:
4531
diff
changeset
|
647 |
|
4678
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
648 |
"Modified: / 09-11-2006 / 13:17:48 / cg" |
4509 | 649 |
! ! |
650 |
||
0 | 651 |
!ResourcePack methodsFor:'accessing'! |
652 |
||
244 | 653 |
array:anArray |
654 |
"translate a collection of strings" |
|
0 | 655 |
|
244 | 656 |
^ anArray collect:[:r | self at:r default:r] |
2033
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
657 |
|
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
658 |
" |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
659 |
Launcher classResources array:#('file' 'classes') |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
660 |
" |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
661 |
|
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
662 |
"Modified: / 29.1.1998 / 22:44:22 / cg" |
0 | 663 |
! |
664 |
||
2 | 665 |
at:aKey |
123 | 666 |
"translate a string" |
667 |
||
72 | 668 |
^ self at:aKey ifAbsent:aKey |
0 | 669 |
! |
670 |
||
671 |
at:aKey default:default |
|
123 | 672 |
"translate a string" |
673 |
||
72 | 674 |
^ self at:aKey ifAbsent:default |
0 | 675 |
! |
676 |
||
2033
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
677 |
at:aKey ifAbsent:defaultValue |
4617 | 678 |
"translate a string; search here, in my projects pack and in my superpack(s)" |
679 |
||
680 |
|val pack projectPack alreadySearched| |
|
681 |
||
682 |
aKey isNil ifTrue:[ ^ defaultValue value ]. |
|
683 |
||
684 |
val := self localAt:aKey. |
|
685 |
val notNil ifTrue:[^ val]. |
|
686 |
||
687 |
(projectPack := self projectPack) notNil ifTrue:[ |
|
688 |
val := projectPack localAt:aKey. |
|
689 |
val notNil ifTrue:[^ val]. |
|
690 |
]. |
|
691 |
alreadySearched := Set new. |
|
692 |
projectPack notNil ifTrue:[ alreadySearched add:projectPack ]. |
|
693 |
||
694 |
pack := self superPack. |
|
695 |
[ pack notNil ] whileTrue:[ |
|
696 |
val := pack localAt:aKey. |
|
697 |
val notNil ifTrue:[^ val]. |
|
698 |
||
699 |
(projectPack := pack projectPack) notNil ifTrue:[ |
|
700 |
(alreadySearched includes:projectPack) ifFalse:[ |
|
701 |
val := projectPack localAt:aKey. |
|
702 |
val notNil ifTrue:[^ val]. |
|
703 |
alreadySearched add:projectPack. |
|
704 |
]. |
|
705 |
]. |
|
706 |
pack := pack superPack |
|
707 |
]. |
|
708 |
||
4618 | 709 |
alreadySearched copy do:[:projectPack | |
710 |
|p| |
|
711 |
||
712 |
p := projectPack superPack. |
|
713 |
[p notNil and:[(alreadySearched includes:p) not]] whileTrue:[ |
|
714 |
val := p localAt:aKey. |
|
715 |
val notNil ifTrue:[^ val]. |
|
716 |
alreadySearched add:p. |
|
717 |
p := p superPack. |
|
718 |
]. |
|
719 |
]. |
|
720 |
||
4617 | 721 |
^ defaultValue value |
722 |
||
4618 | 723 |
"Modified: / 18-09-2006 / 18:50:52 / cg" |
4617 | 724 |
! |
725 |
||
726 |
localAt:aKey |
|
4035 | 727 |
"translate a string. |
728 |
Some special 'intelligence' has been added: |
|
729 |
if no value for aKey is found, |
|
4036 | 730 |
lookup aKey with first character caseChanged and change the results first characters case. |
5593 | 731 |
or aKey is '(...)', then lookup ... wrap () around the result. |
732 |
or aKey is '[...]', then lookup ... wrap [] around the result. |
|
733 |
or aKey is '{...}', then lookup ... wrap {} around the result. |
|
4967
978b4be7c3b7
keay lookup - allow for initial and trailing '\'s
Claus Gittinger <cg@exept.de>
parents:
4963
diff
changeset
|
734 |
or aKey starts with a '\', then lookup aKey without '\' and prepend '\' to the result. |
978b4be7c3b7
keay lookup - allow for initial and trailing '\'s
Claus Gittinger <cg@exept.de>
parents:
4963
diff
changeset
|
735 |
or aKey ends with a '\', then lookup aKey without '\' and append '\' to the result. |
4036 | 736 |
or aKey ends with a ':', then lookup aKey without ':' and append ':' to the result. |
737 |
or aKey ends with a '=', then lookup aKey without '=' and append '=' to the result. |
|
4037 | 738 |
or aKey ends with a '.', then lookup aKey without '.' and append '.' to the result. |
4796 | 739 |
or aKey ends with a ',', then lookup aKey without ',' and append ',' to the result. |
4844 | 740 |
or aKey ends with a '?', then lookup aKey without '?' and append '?' to the result. |
741 |
or aKey ends with a '!!', then lookup aKey without '!!' and append '!!' to the result. |
|
5573 | 742 |
or aKey ends with a ' ', then lookup aKey without ' ' and append ' ' to the result. |
4036 | 743 |
or aKey ends with a ' ...', then lookup aKey without ' ...' and append '...' to the result. |
744 |
or aKey ends with a '...', then lookup aKey without '...' and append '...' to the result. |
|
745 |
or aKey includes '&', then lookup aKey without '&'. |
|
4035 | 746 |
|
747 |
This means, that only a single translation is required to provide local translations for |
|
748 |
things like |
|
749 |
'search' |
|
750 |
'search:' |
|
751 |
'search...' |
|
752 |
" |
|
123 | 753 |
|
5573 | 754 |
|val alternativeKey usedKey idx first last| |
2033
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
755 |
|
4617 | 756 |
val := super at:aKey ifAbsent:nil. |
4678
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
757 |
val notNil ifTrue:[ |
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
758 |
^ val value |
0d83cc874dc3
block value handling changed
Claus Gittinger <cg@exept.de>
parents:
4673
diff
changeset
|
759 |
]. |
3549
8c924bf310ed
lower case first <-> upper case first
Claus Gittinger <cg@exept.de>
parents:
3484
diff
changeset
|
760 |
|
4848 | 761 |
(aKey isString and:[aKey notEmpty]) ifTrue:[ |
5573 | 762 |
first := aKey first. |
763 |
last := aKey last. |
|
764 |
||
4617 | 765 |
"/ try with case-first swapped... |
5573 | 766 |
first isLetter ifTrue:[ |
767 |
alternativeKey := first isUppercase |
|
4617 | 768 |
ifTrue:[aKey asLowercaseFirst] |
769 |
ifFalse:[aKey asUppercaseFirst]. |
|
770 |
val := super at:alternativeKey ifAbsent:nil. |
|
771 |
val notNil ifTrue:[ |
|
5573 | 772 |
first isUppercase ifTrue:[ |
4617 | 773 |
^ val asUppercaseFirst |
3979
75850ede052c
if no xlation is found, look for string folowed by ':' or '='
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
774 |
]. |
4617 | 775 |
^ val asLowercaseFirst. |
4028 | 776 |
]. |
4617 | 777 |
]. |
778 |
||
5593 | 779 |
((first == $( and:[last == $) ]) |
780 |
or:[ (first == $[ and:[last == $] ]) |
|
781 |
or:[ (first == ${ and:[last == $} ]) ]]) ifTrue:[ |
|
782 |
usedKey := aKey copyFrom:2 to:aKey size-1. |
|
783 |
||
784 |
val := self localAt:usedKey. "/ recursion |
|
785 |
val notNil ifTrue:[^ first asString,val,last asString]. |
|
786 |
]. |
|
787 |
||
5573 | 788 |
last = $. ifTrue:[ |
789 |
(aKey endsWith:' ...') ifTrue:[ |
|
790 |
usedKey := aKey copyWithoutLast:4. |
|
791 |
||
792 |
val := self localAt:usedKey. "/ recursion |
|
793 |
val notNil ifTrue:[^ val , ' ...']. |
|
794 |
]. |
|
795 |
(aKey endsWith:'...') ifTrue:[ |
|
796 |
usedKey := aKey copyWithoutLast:3. |
|
797 |
||
798 |
val := self localAt:usedKey. "/ recursion |
|
799 |
val notNil ifTrue:[^ val , '...']. |
|
800 |
]. |
|
801 |
]. |
|
802 |
||
803 |
first isSeparator ifTrue:[ |
|
804 |
usedKey := aKey withoutLeadingSeparators. |
|
4634 | 805 |
|
806 |
val := self localAt:usedKey. "/ recursion |
|
5573 | 807 |
val notNil ifTrue:[^ (aKey copyTo:(aKey size - usedKey size)), val]. "/ prepend the stripped separators |
4634 | 808 |
]. |
5573 | 809 |
last isSeparator ifTrue:[ |
810 |
usedKey := aKey withoutTrailingSeparators. |
|
4634 | 811 |
|
812 |
val := self localAt:usedKey. "/ recursion |
|
5573 | 813 |
val notNil ifTrue:[^ val, (aKey copyFrom:usedKey size + 1)]. "/ append the stripped separators |
4634 | 814 |
]. |
815 |
||
5573 | 816 |
(':=.?!!,-><\' includes:last) ifTrue:[ |
817 |
aKey size >= 2 ifTrue:[ |
|
4634 | 818 |
usedKey := aKey copyWithoutLast:1. |
4617 | 819 |
|
4634 | 820 |
val := self localAt:usedKey. "/ recursion |
5573 | 821 |
val notNil ifTrue:[^ val copyWith:last]. |
4634 | 822 |
]. |
823 |
]. |
|
5573 | 824 |
(':=.?!!-><\' includes:first) ifTrue:[ |
825 |
aKey size >= 2 ifTrue:[ |
|
4634 | 826 |
usedKey := aKey copyFrom:2. |
827 |
||
828 |
val := self localAt:usedKey. "/ recursion |
|
5573 | 829 |
val notNil ifTrue:[^ first asString , val]. |
4634 | 830 |
]. |
4617 | 831 |
]. |
4028 | 832 |
|
5573 | 833 |
(first = $( and:[last = $)]) ifTrue:[ |
4617 | 834 |
usedKey := aKey copyFrom:2 to:(aKey size - 1). |
4028 | 835 |
|
4634 | 836 |
val := self localAt:usedKey. "/ recursion |
4617 | 837 |
val notNil ifTrue:[^ '(' , val , ')']. |
838 |
]. |
|
4017 | 839 |
|
4617 | 840 |
(idx := aKey indexOf:$&) ~~ 0 ifTrue:[ |
841 |
(aKey at:idx+1 ifAbsent:nil) ~~ $& ifTrue:[ |
|
842 |
usedKey := (aKey copyTo:idx-1) , (aKey copyFrom:idx+1). |
|
4848 | 843 |
val := self localAt:usedKey. "/ recursion |
4028 | 844 |
val notNil ifTrue:[^ val]. |
845 |
]. |
|
3979
75850ede052c
if no xlation is found, look for string folowed by ':' or '='
Claus Gittinger <cg@exept.de>
parents:
3854
diff
changeset
|
846 |
]. |
2033
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
847 |
]. |
4617 | 848 |
^ nil. |
4580 | 849 |
|
4617 | 850 |
"Created: / 18-09-2006 / 17:33:27 / cg" |
4796 | 851 |
"Modified: / 21-08-2007 / 21:18:12 / cg" |
5593 | 852 |
"Modified: / 05-08-2010 / 16:52:32 / sr" |
2 | 853 |
! |
854 |
||
855 |
name:aKey default:default |
|
2461
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
856 |
"translate a string. |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
857 |
Obsolete - use #string:default:" |
123 | 858 |
|
4844 | 859 |
<resource: #obsolete> |
860 |
||
72 | 861 |
^ self at:aKey ifAbsent:default |
2 | 862 |
! |
863 |
||
0 | 864 |
string:s |
3097 | 865 |
"translate (retrieve) a string - if not present, return s" |
123 | 866 |
|
72 | 867 |
^ self at:s ifAbsent:s |
3097 | 868 |
|
869 |
" |
|
870 |
NewLauncher classResources |
|
3762 | 871 |
string:'LICENCEFILE' |
3097 | 872 |
" |
0 | 873 |
! |
874 |
||
2461
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
875 |
string:s default:defaultString |
3097 | 876 |
"translate (retrieve) a string - if not present, return defaultString" |
2461
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
877 |
|
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
878 |
^ self at:s ifAbsent:defaultString |
3097 | 879 |
|
880 |
" |
|
881 |
NewLauncher classResources |
|
3762 | 882 |
string:'fooBar' default:'Hello world' |
3097 | 883 |
" |
884 |
||
2461
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
885 |
! |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
886 |
|
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
887 |
string:s default:defaultString with:arg |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
888 |
"translate and expand arg" |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
889 |
|
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
890 |
^ self string:s default:defaultString withArgs:(Array with:arg) |
3097 | 891 |
|
892 |
" |
|
893 |
NewLauncher classResources |
|
3762 | 894 |
string:'%1 fooBar' default:'Hello %1' with:'foo' |
3097 | 895 |
" |
896 |
||
2461
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
897 |
! |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
898 |
|
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
899 |
string:s default:defaultString with:arg1 with:arg2 |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
900 |
"translate and expand args" |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
901 |
|
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
902 |
^ self string:s default:defaultString withArgs:(Array with:arg1 with:arg2) |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
903 |
! |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
904 |
|
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
905 |
string:s default:defaultString with:arg1 with:arg2 with:arg3 |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
906 |
"translate and expand args" |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
907 |
|
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
908 |
^ self string:s default:defaultString withArgs:(Array with:arg1 with:arg2 with:arg3) |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
909 |
|
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
910 |
"Created: 9.12.1995 / 19:08:50 / cg" |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
911 |
! |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
912 |
|
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
913 |
string:s default:defaultString with:arg1 with:arg2 with:arg3 with:arg4 |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
914 |
"translate and expand args" |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
915 |
|
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
916 |
^ self string:s default:defaultString withArgs:(Array with:arg1 with:arg2 with:arg3 with:arg4) |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
917 |
|
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
918 |
"Created: 9.9.1996 / 18:52:14 / cg" |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
919 |
! |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
920 |
|
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
921 |
string:s default:defaultString withArgs:argArray |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
922 |
"translate and expand args" |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
923 |
|
5070 | 924 |
|template| |
2461
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
925 |
|
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
926 |
template := self at:s ifAbsent:defaultString. |
5070 | 927 |
^ template expandPlaceholdersWith:argArray. |
2461
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
928 |
! |
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
929 |
|
0 | 930 |
string:s with:arg |
123 | 931 |
"translate and expand arg" |
932 |
||
0 | 933 |
^ self string:s withArgs:(Array with:arg) |
934 |
! |
|
935 |
||
936 |
string:s with:arg1 with:arg2 |
|
123 | 937 |
"translate and expand args" |
938 |
||
0 | 939 |
^ self string:s withArgs:(Array with:arg1 with:arg2) |
940 |
! |
|
941 |
||
292
62799b2ab9ae
new method: string:with:with:with:
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
942 |
string:s with:arg1 with:arg2 with:arg3 |
62799b2ab9ae
new method: string:with:with:with:
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
943 |
"translate and expand args" |
62799b2ab9ae
new method: string:with:with:with:
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
944 |
|
62799b2ab9ae
new method: string:with:with:with:
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
945 |
^ self string:s withArgs:(Array with:arg1 with:arg2 with:arg3) |
62799b2ab9ae
new method: string:with:with:with:
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
946 |
|
62799b2ab9ae
new method: string:with:with:with:
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
947 |
"Created: 9.12.1995 / 19:08:50 / cg" |
62799b2ab9ae
new method: string:with:with:with:
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
948 |
! |
62799b2ab9ae
new method: string:with:with:with:
Claus Gittinger <cg@exept.de>
parents:
251
diff
changeset
|
949 |
|
1042 | 950 |
string:s with:arg1 with:arg2 with:arg3 with:arg4 |
951 |
"translate and expand args" |
|
952 |
||
953 |
^ self string:s withArgs:(Array with:arg1 with:arg2 with:arg3 with:arg4) |
|
954 |
||
955 |
"Created: 9.9.1996 / 18:52:14 / cg" |
|
956 |
! |
|
957 |
||
3184 | 958 |
string:s with:arg1 with:arg2 with:arg3 with:arg4 with:arg5 |
959 |
"translate and expand args" |
|
960 |
||
961 |
^ self string:s withArgs:(Array with:arg1 with:arg2 with:arg3 with:arg4 with:arg5) |
|
962 |
||
963 |
! |
|
964 |
||
5652 | 965 |
string:s with:arg1 with:arg2 with:arg3 with:arg4 with:arg5 with:arg6 |
966 |
"translate and expand args" |
|
967 |
||
968 |
^ self string:s withArgs:(Array with:arg1 with:arg2 with:arg3 with:arg4 with:arg5 with:arg6) |
|
969 |
||
970 |
"Created: / 13-11-2010 / 11:35:00 / cg" |
|
971 |
! |
|
972 |
||
973 |
string:s with:arg1 with:arg2 with:arg3 with:arg4 with:arg5 with:arg6 with:arg7 |
|
974 |
"translate and expand args" |
|
975 |
||
976 |
^ self string:s withArgs:(Array with:arg1 with:arg2 with:arg3 with:arg4 with:arg5 with:arg6 with:arg7) |
|
977 |
||
978 |
"Created: / 13-11-2010 / 11:35:07 / cg" |
|
979 |
! |
|
980 |
||
0 | 981 |
string:s withArgs:argArray |
4932
b19b928b0026
Allow (and insert) Texts as arguments in #string:with:
Stefan Vogel <sv@exept.de>
parents:
4848
diff
changeset
|
982 |
"translate and expand args - allow text as arguments" |
123 | 983 |
|
5069 | 984 |
|template| |
0 | 985 |
|
2461
3c212ae910ec
added #string:default:with* methods.
Claus Gittinger <cg@exept.de>
parents:
2459
diff
changeset
|
986 |
template := self at:s ifAbsent:s. |
5069 | 987 |
^ template expandPlaceholdersWith:argArray. |
4932
b19b928b0026
Allow (and insert) Texts as arguments in #string:with:
Stefan Vogel <sv@exept.de>
parents:
4848
diff
changeset
|
988 |
|
5069 | 989 |
|
990 |
||
991 |
||
992 |
||
993 |
||
994 |
||
995 |
||
3823 | 996 |
! |
997 |
||
4402 | 998 |
stringWithCRs:s |
999 |
"translate (retrieve) a string - if not present, return s" |
|
1000 |
||
1001 |
^ (self string:s) withCRs |
|
1002 |
||
1003 |
" |
|
1004 |
NewLauncher classResources |
|
1005 |
stringWithCRs:'LICENCEFILE' |
|
1006 |
" |
|
1007 |
! |
|
1008 |
||
3823 | 1009 |
stringWithCRs:s with:arg |
1010 |
"translate, replace \'s with CRs and finally expand arg. |
|
1011 |
CR-replacement is donw before args are inserted |
|
1012 |
i.e. if any arg contains a backslash (DOS filenames), those are not translated." |
|
1013 |
||
1014 |
^ self stringWithCRs:s withArgs:(Array with:arg) |
|
1015 |
||
1016 |
"Modified: / 21.3.2003 / 14:22:09 / cg" |
|
1017 |
! |
|
1018 |
||
1019 |
stringWithCRs:s with:arg1 with:arg2 |
|
1020 |
"translate, replace \'s with CRs and finally expand args. |
|
1021 |
CR-replacement is donw before args are inserted |
|
1022 |
i.e. if any arg contains a backslash (DOS filenames), those are not translated." |
|
1023 |
||
1024 |
^ self stringWithCRs:s withArgs:(Array with:arg1 with:arg2) |
|
1025 |
||
1026 |
"Modified: / 21.3.2003 / 14:22:06 / cg" |
|
1027 |
! |
|
1028 |
||
1029 |
stringWithCRs:s with:arg1 with:arg2 with:arg3 |
|
1030 |
"translate, replace \'s with CRs and finally expand args. |
|
1031 |
CR-replacement is donw before args are inserted |
|
1032 |
i.e. if any arg contains a backslash (DOS filenames), those are not translated." |
|
1033 |
||
1034 |
^ self stringWithCRs:s withArgs:(Array with:arg1 with:arg2 with:arg3) |
|
1035 |
||
1036 |
"Created: 9.12.1995 / 19:08:50 / cg" |
|
1037 |
! |
|
1038 |
||
1039 |
stringWithCRs:s with:arg1 with:arg2 with:arg3 with:arg4 |
|
1040 |
"translate, replace \'s with CRs and finally expand args. |
|
1041 |
CR-replacement is donw before args are inserted |
|
1042 |
i.e. if any arg contains a backslash (DOS filenames), those are not translated." |
|
1043 |
||
1044 |
^ self stringWithCRs:s withArgs:(Array with:arg1 with:arg2 with:arg3 with:arg4) |
|
1045 |
||
1046 |
"Modified: / 21.3.2003 / 14:21:48 / cg" |
|
1047 |
! |
|
1048 |
||
1049 |
stringWithCRs:s with:arg1 with:arg2 with:arg3 with:arg4 with:arg5 |
|
1050 |
"translate, replace \'s with CRs and finally expand args. |
|
1051 |
CR-replacement is donw before args are inserted |
|
1052 |
i.e. if any arg contains a backslash (DOS filenames), those are not translated." |
|
1053 |
||
1054 |
^ self stringWithCRs:s withArgs:(Array with:arg1 with:arg2 with:arg3 with:arg4 with:arg5) |
|
1055 |
||
1056 |
"Modified: / 21.3.2003 / 14:21:55 / cg" |
|
1057 |
! |
|
1058 |
||
5652 | 1059 |
stringWithCRs:s with:arg1 with:arg2 with:arg3 with:arg4 with:arg5 with:arg6 |
1060 |
"translate, replace \'s with CRs and finally expand args. |
|
1061 |
CR-replacement is donw before args are inserted |
|
1062 |
i.e. if any arg contains a backslash (DOS filenames), those are not translated." |
|
1063 |
||
1064 |
^ self stringWithCRs:s withArgs:(Array with:arg1 with:arg2 with:arg3 with:arg4 with:arg5 with:arg6) |
|
1065 |
||
1066 |
"Created: / 13-11-2010 / 11:35:30 / cg" |
|
1067 |
! |
|
1068 |
||
1069 |
stringWithCRs:s with:arg1 with:arg2 with:arg3 with:arg4 with:arg5 with:arg6 with:arg7 |
|
1070 |
"translate, replace \'s with CRs and finally expand args. |
|
1071 |
CR-replacement is donw before args are inserted |
|
1072 |
i.e. if any arg contains a backslash (DOS filenames), those are not translated." |
|
1073 |
||
1074 |
^ self stringWithCRs:s withArgs:(Array with:arg1 with:arg2 with:arg3 with:arg4 with:arg5 with:arg6 with:arg7) |
|
1075 |
||
1076 |
"Created: / 13-11-2010 / 11:35:20 / cg" |
|
1077 |
! |
|
1078 |
||
3823 | 1079 |
stringWithCRs:s withArgs:argArray |
1080 |
"translate, replace \'s with CRs and finally expand args. |
|
4963
157b9720c9d3
changed #stringWithCRs:withArgs: typo in comment
Stefan Vogel <sv@exept.de>
parents:
4950
diff
changeset
|
1081 |
CR-replacement is done before args are inserted |
3823 | 1082 |
i.e. if any arg contains a backslash (DOS filenames), those are not translated." |
1083 |
||
5070 | 1084 |
|template| |
3823 | 1085 |
|
1086 |
template := self at:s ifAbsent:s. |
|
5070 | 1087 |
^ template withCRs expandPlaceholdersWith:argArray. |
0 | 1088 |
! ! |
1089 |
||
3317 | 1090 |
!ResourcePack methodsFor:'accessing-internals'! |
2033
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1091 |
|
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1092 |
name:aKey |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1093 |
"translate a string" |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1094 |
|
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1095 |
^ self at:aKey ifAbsent:aKey |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1096 |
! |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1097 |
|
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1098 |
packsClassName |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1099 |
^ packsClassName |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1100 |
! |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1101 |
|
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1102 |
packsClassName:aString |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1103 |
packsClassName := aString |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1104 |
! |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1105 |
|
4093 | 1106 |
packsClassOrFileName |
1107 |
^ packsClassName |
|
1108 |
! |
|
1109 |
||
1110 |
packsClassOrFileName:aString |
|
1111 |
packsClassName := aString |
|
1112 |
! |
|
1113 |
||
4617 | 1114 |
projectPack |
1115 |
^ projectPack |
|
1116 |
||
1117 |
"Created: / 18-09-2006 / 17:38:07 / cg" |
|
1118 |
! |
|
1119 |
||
4085 | 1120 |
projectPack:anotherResourcePack |
1121 |
projectPack := anotherResourcePack |
|
1122 |
||
1123 |
"Created: / 29.1.1998 / 22:43:09 / cg" |
|
1124 |
! |
|
1125 |
||
4617 | 1126 |
superPack |
1127 |
^ superPack |
|
1128 |
||
1129 |
"Created: / 18-09-2006 / 17:38:12 / cg" |
|
1130 |
! |
|
1131 |
||
2033
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1132 |
superPack:anotherResourcePack |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1133 |
superPack := anotherResourcePack |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1134 |
|
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1135 |
"Created: / 29.1.1998 / 22:43:09 / cg" |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1136 |
! ! |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1137 |
|
0 | 1138 |
!ResourcePack methodsFor:'file reading'! |
1139 |
||
684 | 1140 |
fileReadFailed |
2033
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1141 |
"return true, if the pack does not really contain |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1142 |
valid translations, since the fileRead failed. |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1143 |
However, all inherited translations are still available |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1144 |
through the receiver" |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1145 |
|
687 | 1146 |
^ fileReadFailed ~~ false |
684 | 1147 |
|
2033
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1148 |
"Created: / 14.5.1996 / 10:19:26 / cg" |
dad8f0ee02f4
do not merge superPacks data;
Claus Gittinger <cg@exept.de>
parents:
1956
diff
changeset
|
1149 |
"Modified: / 29.1.1998 / 22:46:38 / cg" |
684 | 1150 |
! |
1151 |
||
1894
9982e96dff75
better behavior if no stylesheet is present.
Claus Gittinger <cg@exept.de>
parents:
1803
diff
changeset
|
1152 |
nonexistingFileRead |
9982e96dff75
better behavior if no stylesheet is present.
Claus Gittinger <cg@exept.de>
parents:
1803
diff
changeset
|
1153 |
"asked to read definitions for a non-existing file. |
9982e96dff75
better behavior if no stylesheet is present.
Claus Gittinger <cg@exept.de>
parents:
1803
diff
changeset
|
1154 |
Here, this is legal and ignored (typically using inherited resources). |
9982e96dff75
better behavior if no stylesheet is present.
Claus Gittinger <cg@exept.de>
parents:
1803
diff
changeset
|
1155 |
However, subclasses (such as styleSheet) may flag it as an error." |
9982e96dff75
better behavior if no stylesheet is present.
Claus Gittinger <cg@exept.de>
parents:
1803
diff
changeset
|
1156 |
|
9982e96dff75
better behavior if no stylesheet is present.
Claus Gittinger <cg@exept.de>
parents:
1803
diff
changeset
|
1157 |
^ nil |
9982e96dff75
better behavior if no stylesheet is present.
Claus Gittinger <cg@exept.de>
parents:
1803
diff
changeset
|
1158 |
|
9982e96dff75
better behavior if no stylesheet is present.
Claus Gittinger <cg@exept.de>
parents:
1803
diff
changeset
|
1159 |
"Created: 6.9.1997 / 11:38:53 / cg" |
9982e96dff75
better behavior if no stylesheet is present.
Claus Gittinger <cg@exept.de>
parents:
1803
diff
changeset
|
1160 |
! |
9982e96dff75
better behavior if no stylesheet is present.
Claus Gittinger <cg@exept.de>
parents:
1803
diff
changeset
|
1161 |
|
4332 | 1162 |
processLine:lineString encoding:encodingSymbolOrEncoder file:fileName printErrorWith:printError |
145 | 1163 |
"process a single valid line (i.e. #ifdef & #include has already been processed)" |
1164 |
||
4509 | 1165 |
self class |
1166 |
processResourceLine:lineString |
|
1167 |
encoding:encodingSymbolOrEncoder |
|
1168 |
file:fileName |
|
1169 |
printErrorWith:printError |
|
1170 |
for:self |
|
144 | 1171 |
! |
1172 |
||
244 | 1173 |
readFromFile:fileName directory:dirName |
1174 |
"read definitions from a file in a directory" |
|
1175 |
||
1176 |
|inStream ok| |
|
1177 |
||
686 | 1178 |
fileReadFailed := false. |
244 | 1179 |
dirName = 'resources' ifTrue:[ |
3769 | 1180 |
inStream := Smalltalk resourceFileStreamFor:fileName |
244 | 1181 |
] ifFalse:[ |
3769 | 1182 |
inStream := Smalltalk |
1183 |
systemFileStreamFor:(dirName |
|
1184 |
isNil ifTrue:[fileName] |
|
1185 |
ifFalse:[dirName asFilename construct:fileName]). |
|
244 | 1186 |
]. |
1187 |
inStream isNil ifTrue:[ |
|
3769 | 1188 |
" |
1189 |
an empty pack |
|
1190 |
" |
|
1191 |
^ self nonexistingFileRead |
|
244 | 1192 |
]. |
2996 | 1193 |
|
4093 | 1194 |
ok := self readFromResourceStream:inStream in:(inStream pathName asFilename directoryName). |
244 | 1195 |
inStream close. |
686 | 1196 |
|
244 | 1197 |
ok ifFalse:[ |
3769 | 1198 |
fileReadFailed := true. |
684 | 1199 |
|
3769 | 1200 |
('ResourcePack [warning]: ''' , inStream pathName , ''' contains error(s) - data may be incomplete.') errorPrintCR. |
244 | 1201 |
]. |
1202 |
||
4656 | 1203 |
"Modified: / 19-10-2006 / 22:46:48 / cg" |
244 | 1204 |
! |
1205 |
||
72 | 1206 |
readFromResourceStream:inStream in:dirName |
4848 | 1207 |
"read definitions from a stream. The dirName argument is required to |
210
0f942dafc85a
gracefully handle errors when reading resource files
Claus Gittinger <cg@exept.de>
parents:
177
diff
changeset
|
1208 |
specify where #include files are searched for. |
0f942dafc85a
gracefully handle errors when reading resource files
Claus Gittinger <cg@exept.de>
parents:
177
diff
changeset
|
1209 |
Return true, if the style sheet could be read without errors, false otherwise." |
145 | 1210 |
|
4058 | 1211 |
|lineString l lineNumber rest value ifLevel skipping first ok encoding decoder pack errorHandler |
4947 | 1212 |
printError fileName pushedSkipValues| |
4058 | 1213 |
|
1214 |
fileName := (inStream isFileStream |
|
1215 |
ifTrue:[inStream pathName asFilename baseName] |
|
1216 |
ifFalse:['---']). |
|
1217 |
||
1218 |
printError := [:message | |
|
1219 |
'ResourcePack [warning]: ' errorPrint. |
|
1220 |
message errorPrint. |
|
1221 |
' in file:' errorPrint. |
|
1222 |
fileName errorPrint. |
|
1223 |
' line: ' errorPrint. |
|
1224 |
lineNumber errorPrintCR |
|
1225 |
]. |
|
1226 |
||
1227 |
printError := [:message | ]. |
|
462
423f8426fefc
added #encoding directive (I am lazy)
Claus Gittinger <cg@exept.de>
parents:
444
diff
changeset
|
1228 |
|
423f8426fefc
added #encoding directive (I am lazy)
Claus Gittinger <cg@exept.de>
parents:
444
diff
changeset
|
1229 |
encoding := nil. |
0 | 1230 |
|
210
0f942dafc85a
gracefully handle errors when reading resource files
Claus Gittinger <cg@exept.de>
parents:
177
diff
changeset
|
1231 |
ok := true. |
0 | 1232 |
ifLevel := 0. |
1233 |
skipping := false. |
|
4058 | 1234 |
lineNumber := 0. |
4947 | 1235 |
pushedSkipValues := OrderedCollection new. |
3567
f85c170f14e8
allow expression evaluation in styleSheet
Claus Gittinger <cg@exept.de>
parents:
3549
diff
changeset
|
1236 |
|
f85c170f14e8
allow expression evaluation in styleSheet
Claus Gittinger <cg@exept.de>
parents:
3549
diff
changeset
|
1237 |
errorHandler := [:ex | |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1238 |
|con| |
4947 | 1239 |
|
1240 |
Transcript showCR:('ResourcePack [warning]: ''' , ex description , '''') "errorPrintCR". |
|
1241 |
Transcript showCR:('ResourcePack [info]: file: ' , inStream pathName printString , ' line: ' , lineNumber printString , ': ''' , lineString , '''') "errorPrintCR". |
|
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1242 |
con := ex suspendedContext. |
4947 | 1243 |
Transcript showCR:('ResourcePack [info]: in: ' , con fullPrintString) "errorPrintCR". |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1244 |
con := con sender. |
4947 | 1245 |
Transcript showCR:('ResourcePack [info]: : ' , con fullPrintString) "errorPrintCR". |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1246 |
con := con sender. |
4947 | 1247 |
Transcript showCR:('ResourcePack [info]: : ' , con fullPrintString) "errorPrintCR". |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1248 |
value := nil. |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1249 |
ok := false. |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1250 |
]. |
3567
f85c170f14e8
allow expression evaluation in styleSheet
Claus Gittinger <cg@exept.de>
parents:
3549
diff
changeset
|
1251 |
|
0 | 1252 |
[inStream atEnd] whileFalse:[ |
4058 | 1253 |
lineString := inStream nextLine. lineNumber := lineNumber + 1. |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1254 |
[lineString notNil and:[lineString endsWith:$\]] whileTrue:[ |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1255 |
lineString := lineString copyWithoutLast:1. |
4058 | 1256 |
l := inStream nextLine. lineNumber := lineNumber + 1. |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1257 |
l notNil ifTrue:[ |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1258 |
lineString := lineString , l. |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1259 |
]. |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1260 |
]. |
177 | 1261 |
|
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1262 |
(lineString size > 0) ifTrue:[ |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1263 |
first := lineString at:1. |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1264 |
"/ |
4947 | 1265 |
"/ for your convenience: treat both ';' AND '"/' as comment-line |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1266 |
"/ |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1267 |
((first == $;) or:[lineString startsWith:'"/']) ifFalse:[ |
4332 | 1268 |
((first == $#) and:[(lineString startsWith:'#(') not]) ifTrue:[ |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1269 |
"/ a directive |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1270 |
lineString := (lineString copyFrom:2) withoutSpaces. |
72 | 1271 |
|
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1272 |
(lineString startsWith:'if') ifTrue:[ |
4947 | 1273 |
pushedSkipValues add:skipping. |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1274 |
skipping ifFalse:[ |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1275 |
rest := lineString copyFrom:3. |
4835
1f64020798d9
changed #readFromResourceStream:in:
Stefan Vogel <sv@exept.de>
parents:
4796
diff
changeset
|
1276 |
Error, UserInformation |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1277 |
handle:errorHandler |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1278 |
do:[ |
4947 | 1279 |
value := Compiler evaluate:rest compile:false. |
4835
1f64020798d9
changed #readFromResourceStream:in:
Stefan Vogel <sv@exept.de>
parents:
4796
diff
changeset
|
1280 |
]. |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1281 |
(value == #Error) ifTrue:[ |
4058 | 1282 |
printError value:('error in resource:' , lineString). |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1283 |
]. |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1284 |
(value == false) ifTrue:[ |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1285 |
skipping := true |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1286 |
] |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1287 |
]. |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1288 |
ifLevel := ifLevel + 1 |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1289 |
] ifFalse:[ |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1290 |
(lineString startsWith:'endif') ifTrue:[ |
4950 | 1291 |
ifLevel == 0 ifTrue:[ |
1292 |
printError value:('if/endif nesting error'). |
|
1293 |
] ifFalse:[ |
|
1294 |
ifLevel := ifLevel - 1. |
|
1295 |
skipping := pushedSkipValues removeLast. |
|
1296 |
] |
|
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1297 |
] ifFalse:[ |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1298 |
(lineString startsWith:'else') ifTrue:[ |
4947 | 1299 |
(pushedSkipValues includes:true) ifFalse:[ |
1300 |
skipping := skipping not |
|
1301 |
] |
|
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1302 |
] ifFalse:[ |
4947 | 1303 |
skipping ifFalse:[ |
1304 |
(lineString startsWith:'superpack') ifTrue:[ |
|
1305 |
rest := lineString copyFrom:('superpack' size + 1). |
|
1306 |
value := Compiler evaluate:rest compile:false. |
|
1307 |
(value isKindOf:ResourcePack) ifTrue:[ |
|
1308 |
superPack := value |
|
1309 |
] |
|
1310 |
] ifFalse:[ |
|
4618 | 1311 |
(lineString startsWith:'include') ifTrue:[ |
1312 |
(lineString startsWith:'includeResourcesFor') ifTrue:[ |
|
1313 |
"/ include those resources ... |
|
1314 |
rest := lineString copyFrom:('includeResourcesFor' size + 1). |
|
1315 |
value := Compiler evaluate:rest compile:false. |
|
1316 |
value isBehavior ifTrue:[ |
|
1317 |
pack := self class for:value. |
|
1318 |
pack notNil ifTrue:[ |
|
1319 |
self addAll:pack. |
|
1320 |
] |
|
1321 |
] |
|
1322 |
] ifFalse:[ |
|
1323 |
rest := lineString copyFrom:('include' size + 1). |
|
1324 |
value := Compiler evaluate:rest compile:false. |
|
1325 |
value isString ifFalse:[ |
|
1326 |
printError value:('bad include filename: ' , value printString, ' "',lineString,'"'). |
|
1327 |
] ifTrue:[ |
|
1328 |
self readFromFile:value directory:dirName |
|
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1329 |
] |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1330 |
] |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1331 |
] ifFalse:[ |
4618 | 1332 |
(lineString startsWith:'encoding') ifTrue:[ |
4848 | 1333 |
"/decoder notNil ifTrue:[self halt:'oops - encoding change in file']. |
4618 | 1334 |
encoding := self class extractEncodingFromLine:lineString. |
1335 |
decoder := CharacterEncoder encoderFor:encoding ifAbsent:nil. |
|
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1336 |
] |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1337 |
] |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1338 |
] |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1339 |
] |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1340 |
] |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1341 |
] |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1342 |
]. |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1343 |
] ifFalse:[ |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1344 |
skipping ifFalse:[ |
4835
1f64020798d9
changed #readFromResourceStream:in:
Stefan Vogel <sv@exept.de>
parents:
4796
diff
changeset
|
1345 |
Error, UserInformation |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1346 |
handle:errorHandler |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1347 |
do:[ |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1348 |
(lineString at:1) == $!! ifTrue:[ |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1349 |
"/ evaluate the rest |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1350 |
Compiler evaluate:(lineString copyFrom:2) |
4332 | 1351 |
receiver:self |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1352 |
notifying:nil |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1353 |
compile:false. |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1354 |
] ifFalse:[ |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1355 |
"/ process as resource |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1356 |
self |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1357 |
processLine:lineString |
4017 | 1358 |
encoding:decoder |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1359 |
file:(inStream isFileStream |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1360 |
ifTrue:[inStream pathName] |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1361 |
ifFalse:['---']) |
4058 | 1362 |
printErrorWith:printError |
3817
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1363 |
]] |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1364 |
] |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1365 |
] |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1366 |
] |
34deab81bfe2
Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents:
3808
diff
changeset
|
1367 |
] |
0 | 1368 |
]. |
210
0f942dafc85a
gracefully handle errors when reading resource files
Claus Gittinger <cg@exept.de>
parents:
177
diff
changeset
|
1369 |
^ ok |
177 | 1370 |
|
4534
d71ca6ac7cbe
handle unicode string-keys and values
Claus Gittinger <cg@exept.de>
parents:
4531
diff
changeset
|
1371 |
"Modified: / 31-08-1995 / 02:33:45 / claus" |
4619 | 1372 |
"Modified: / 18-09-2006 / 20:35:37 / cg" |
0 | 1373 |
! ! |
1374 |
||
4093 | 1375 |
!ResourcePack methodsFor:'printing & storing'! |
1376 |
||
5603
0945abfddb9a
Implement display with #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5593
diff
changeset
|
1377 |
displayOn:aGCOrStream |
0945abfddb9a
Implement display with #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5593
diff
changeset
|
1378 |
|
0945abfddb9a
Implement display with #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5593
diff
changeset
|
1379 |
"/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
0945abfddb9a
Implement display with #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5593
diff
changeset
|
1380 |
"/ ST/X (and some old ST80's) mean: draw-yourself on a GC. |
0945abfddb9a
Implement display with #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5593
diff
changeset
|
1381 |
(aGCOrStream isStream or:[aGCOrStream == Transcript]) ifTrue:[ |
0945abfddb9a
Implement display with #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5593
diff
changeset
|
1382 |
aGCOrStream nextPutAll:'ResourcePack for: '. |
0945abfddb9a
Implement display with #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5593
diff
changeset
|
1383 |
packsClassName printOn:aGCOrStream. |
0945abfddb9a
Implement display with #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5593
diff
changeset
|
1384 |
^ self. |
0945abfddb9a
Implement display with #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5593
diff
changeset
|
1385 |
]. |
0945abfddb9a
Implement display with #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5593
diff
changeset
|
1386 |
|
0945abfddb9a
Implement display with #displayOn: instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
5593
diff
changeset
|
1387 |
^ super displayOn:aGCOrStream |
4093 | 1388 |
! ! |
1389 |
||
1173
86a212598655
newStyle info & error messages
Claus Gittinger <cg@exept.de>
parents:
1078
diff
changeset
|
1390 |
!ResourcePack class methodsFor:'documentation'! |
251 | 1391 |
|
1392 |
version |
|
5653 | 1393 |
^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.148 2010-11-13 10:42:05 cg Exp $' |
5357 | 1394 |
! |
1395 |
||
1396 |
version_CVS |
|
5653 | 1397 |
^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.148 2010-11-13 10:42:05 cg Exp $' |
251 | 1398 |
! ! |
3769 | 1399 |
|
0 | 1400 |
ResourcePack initialize! |