ResourcePack.st
changeset 3097 b2cca70d5d55
parent 3082 0f6435aaa66a
child 3101 38cc69894380
equal deleted inserted replaced
3096:6ee19dabbba1 3097:b2cca70d5d55
   357 
   357 
   358     ^ self at:aKey ifAbsent:default
   358     ^ self at:aKey ifAbsent:default
   359 !
   359 !
   360 
   360 
   361 string:s
   361 string:s
   362     "translate a string"
   362     "translate (retrieve) a string - if not present, return s"
   363 
   363 
   364     ^ self at:s ifAbsent:s
   364     ^ self at:s ifAbsent:s
       
   365 
       
   366     "
       
   367      NewLauncher classResources
       
   368         string:'LICENCEFILE' 
       
   369     "
   365 !
   370 !
   366 
   371 
   367 string:s default:defaultString
   372 string:s default:defaultString
   368     "translate a string"
   373     "translate (retrieve) a string - if not present, return defaultString"
   369 
   374 
   370     ^ self at:s ifAbsent:defaultString
   375     ^ self at:s ifAbsent:defaultString
       
   376 
       
   377     "
       
   378      NewLauncher classResources
       
   379         string:'fooBar' default:'Hello world'  
       
   380     "
       
   381 
   371 !
   382 !
   372 
   383 
   373 string:s default:defaultString with:arg
   384 string:s default:defaultString with:arg
   374     "translate and expand arg"
   385     "translate and expand arg"
   375 
   386 
   376     ^ self string:s default:defaultString withArgs:(Array with:arg)
   387     ^ self string:s default:defaultString withArgs:(Array with:arg)
       
   388 
       
   389     "
       
   390      NewLauncher classResources
       
   391         string:'%1 fooBar' default:'Hello %1' with:'foo' 
       
   392     "
       
   393 
   377 !
   394 !
   378 
   395 
   379 string:s default:defaultString with:arg1 with:arg2
   396 string:s default:defaultString with:arg1 with:arg2
   380     "translate and expand args"
   397     "translate and expand args"
   381 
   398 
   748 ! !
   765 ! !
   749 
   766 
   750 !ResourcePack class methodsFor:'documentation'!
   767 !ResourcePack class methodsFor:'documentation'!
   751 
   768 
   752 version
   769 version
   753     ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.59 1999-12-05 15:07:47 cg Exp $'
   770     ^ '$Header: /cvs/stx/stx/libview/ResourcePack.st,v 1.60 1999-12-09 09:13:06 cg Exp $'
   754 ! !
   771 ! !
   755 ResourcePack initialize!
   772 ResourcePack initialize!