'From etoys2.2 of 25 September 2007 [latest update: #1668] on 27 September 2007 at 7:55:33 pm'! "Change Set: ArrayTransNoop-KR Date: 27 September 2007 Author: Bert Freudenberg, Korakurider GetText exporting facility now can extract string members in array receiver of #translatedNoop, while symbol members are ignored. e.g. aMenu addTranslatedList: #( ( 'menu1' ignored ) ('menu2' ignored 'balloon2') -) translatedNoop. " ! !Object methodsFor: 'translating' stamp: 'bf 9/27/2007 12:20'! literalStringsDo: aBlock "Assuming the receiver receiver is a literal, evaluate aBlock with all Strings (but not Symbols) within it." ^ self! ! !Array methodsFor: 'translating' stamp: 'bf 9/27/2007 12:20'! literalStringsDo: aBlock "Assuming the receiver receiver is a literal, evaluate aBlock with all Strings (but not Symbols) within it." self do: [:each | each literalStringsDo: aBlock]! ! !Array methodsFor: 'translating' stamp: 'KR 9/27/2007 12:20'! translatedNoop "This is correspondence gettext_noop() in gettext." ^ self! ! !String methodsFor: 'translating' stamp: 'bf 9/27/2007 12:20'! literalStringsDo: aBlock "Assuming the receiver receiver is a literal, evaluate aBlock with all Strings (but not Symbols) within it." aBlock value: self! ! !Symbol methodsFor: 'translating' stamp: 'bf 9/27/2007 12:20'! literalStringsDo: aBlock "Assuming the receiver receiver is a literal, evaluate aBlock with all Strings (but not Symbols) within it." ^ self! ! !TranslatedReceiverFinder methodsFor: 'accessing' stamp: 'KR 9/27/2007 19:47'! stringReceiversWithContext: aSymbol "Find string receivers for a symbol. Answer a collection of aMethodReference -> {keyword. keyword...}" "self new stringReceiversWithContext: #translated" | keywords methodReferences messages | methodReferences _ SystemNavigation default allCallsOn: aSymbol. ^ methodReferences inject: OrderedCollection new into: [:list :next | messages _ Set new. "Find from string literal" self search: aSymbol messageNode: next decompile addTo: messages. keywords := OrderedCollection new. messages select: [:aMessageNode | aMessageNode receiver isMemberOf: LiteralNode] thenDo: [:aMessageNode | aMessageNode receiver key literalStringsDo: [:literal | keywords add: literal ]. ]. keywords ifNotEmpty: [list add: next -> keywords]. list] ! !