#FEATURE by exept
class: ShowMeHowItWorks
changed:
#findComponent:in:
#showing:saying:do:
--- a/ShowMeHowItWorks.st Thu Nov 14 21:44:16 2019 +0100
+++ b/ShowMeHowItWorks.st Fri Nov 15 00:42:20 2019 +0100
@@ -519,16 +519,21 @@
[
|sentence|
sentence := (sentenceOrNil ? xLatedMessage) copy withCRs replaceAny:c'\t' with:(Character space).
- sentence := sentence copy withCRs replaceAny:c'\n\r' with:(Character space).
- sentence := sentence asLowercase.
- pronunciations notNil ifTrue:[
- pronunciations keysAndValuesDo:[:word :pronounced |
- (sentence includesString:word) ifTrue:[
- sentence := sentence copyReplaceString:word withString:pronounced
+ sentence asStringCollection do:[:eachLineIn |
+ |eachLine|
+
+ eachLine := eachLineIn.
+ "/ eachLine := eachLine copy withCRs replaceAny:c'\n\r' with:(Character space).
+ eachLine := eachLine asLowercase.
+ pronunciations notNil ifTrue:[
+ pronunciations keysAndValuesDo:[:word :pronounced |
+ (eachLine includesString:word) ifTrue:[
+ eachLine := eachLine copyReplaceString:word withString:pronounced
+ ]
]
- ]
+ ].
+ self tell:eachLine.
].
- self tell:sentence.
talkDone signal
] fork.
@@ -1557,7 +1562,7 @@
self halt.
]
] ifFalse:[
- anApplicationOrViewOrMenuItem isMenu ifFalse:[
+ (anApplicationOrViewOrMenuItem askFor:#isMenu) ifFalse:[
self assert:false message:'container is not a menu'.
].
"/ a menu item