'From etoys2.2 of 22 September 2007 [latest update: #1730] on 28 October 2007 at 11:52:15 pm'! "Change Set: transSymbols-KR Date: 28 October 2007 Author: Korakurider to make sure that all of symbols in vocabulary will be exported to POs and will be translated"! !StandardScriptingSystem methodsFor: 'utilities' stamp: 'KR 10/28/2007 23:45'! arithmeticalOperatorsAndHelpStrings "Answer an array consisting of lists of the standard arithmetical operator tiles and of the corresponding balloon help for them" ^ #((+ - * / // \\ max: min:) ('add' 'subtract' 'multiply' 'divide' 'divide & truncate' 'remainder when divided by' 'larger value' 'smaller value' )) translatedNoop! ! !StandardScriptingSystem methodsFor: 'utilities' stamp: 'KR 10/28/2007 23:44'! numericComparitorsAndHelpStrings "Answer an array whose first element is the list of comparitors, and whose second element is a list of the corresponding help strings" ^ #((< <= = ~= > >= isDivisibleBy:) ('less than' 'less than or equal' 'equal' 'not equal' 'greater than' 'greater than or equal' 'divisible by' )) translatedNoop! ! !StandardScriptingSystem methodsFor: 'utilities' stamp: 'KR 10/28/2007 23:49'! tableOfNumericFunctions "Answer an array of triplets." " English on tile selector English balloon help" ^ #( (abs abs 'absolute value') (arcTan arcTan 'angle, in radians, whose tangent is the argument') (cos cos 'trigonometric cosine, argument in radians') (cubed cubed 'the argument times itself, times itself again') (cubeRoot cubeRoot 'cube root of the argument') (degreeArcTan degreeArcTan 'angle, in degrees, whose tangent is the argument') (degreeCos degreeCos 'trigonometric cosine, argument in degrees') (degreeSin degreeSin 'trignometric sine, argument in degrees') (degreeTan degreeTan 'trigonometric tangent, argument in degrees') (degreesToRadians degreesToRadians 'the number of degrees equivalent to the argument which is assumed to be expressed in radians') (exp exp 'exponential (e to the power of the argument)') (factorial factorial 'the product of all the whole numbers between 1 and the argument') (ln safeLn 'natural logarithm') (log safeLog 'logarithm, base 10') (negativeOf negated 'the negative of the argument') (radiansToDegrees radiansToDegrees 'the number of radians equivalent to the argument, which is expressed in degrees.') (random random 'a randomly chosen integer between 1 and the argument') (rounded rounded 'the integer closest to the argument.') (sin sin 'trigonometric sine, argument in radians') (squared squared 'the argument multiplied by itself') (squareRoot safeSquareRoot 'square root of the argument') (tan tan 'trigonometric tangent, argument in radians')) translatedNoop " (raisedto raisedTo: 'raised to the power') "! ! !TileMorph methodsFor: 'accessing' stamp: 'KR 10/28/2007 23:47'! options "Answer the options of the tile for an arrow" (type == #literal and: [literal isKindOf: Boolean]) ifTrue: [^ {{true. false}. #('true' 'false' ) translatedNoopAll}]. operatorOrExpression ifNil: [^ nil]. (ScriptingSystem arithmeticalOperatorsAndHelpStrings first includes: operatorOrExpression) ifTrue: [^ ScriptingSystem arithmeticalOperatorsAndHelpStrings]. (ScriptingSystem numericComparitorsAndHelpStrings first includes: operatorOrExpression) ifTrue: [self receiverType = #Number ifTrue: [^ ScriptingSystem numericComparitorsAndHelpStrings] ifFalse: [^ #(#(#= #~=) #('equal' 'not equal')) translatedNoop ]]. ^ nil! ! !VideoMorph class methodsFor: 'misc' stamp: 'KR 10/28/2007 21:53'! resolutions "answer a collection of valid resolutions" ^ #(#original #'256 colors' #'256 grays' #'4 grays' #'black and white' ) translatedNoopAll! ! !Vocabulary methodsFor: 'translation' stamp: 'KR 10/28/2007 23:16'! translatedWordingFor: aSymbol "If I have a translated wording for aSymbol, return it, else return aSymbol. Caveat: at present, this mechanism is only germane for *assignment-operator wordings*" #(: Incr: Decr: Mult:) with: #('' 'increase by' 'decrease by' 'multiply by') translatedNoop do: [:a :b | aSymbol = a ifTrue: [^ b translated]]. ^ aSymbol translated! ! !ScriptNameType methodsFor: 'tiles' stamp: 'KR 10/28/2007 22:55'! defaultArgumentTile "Answer a tile to represent the type" | aTile | aTile _ ScriptNameTile new dataType: self vocabularyName. aTile addArrows. aTile setLiteral: #emptyScript translatedNoopAll. ^ aTile! ! !Vocabulary class methodsFor: 'class initialization' stamp: 'KR 10/28/2007 21:52'! initializeStandardVocabularies "Initialize a few standard vocabularies and place them in the AllStandardVocabularies list." AllStandardVocabularies _ nil. self addStandardVocabulary: EToyVocabulary new. self addStandardVocabulary: EToyVectorVocabulary new. self addStandardVocabulary: self newPublicVocabulary. self addStandardVocabulary: FullVocabulary new. self addStandardVocabulary: self newQuadVocabulary. self addStandardVocabulary: ColorType new. self addStandardVocabulary: BooleanType new. self addStandardVocabulary: GraphicType new. self addStandardVocabulary: PlayerType new. self addStandardVocabulary: SoundType new. self addStandardVocabulary: StringType new. self addStandardVocabulary: MenuType new. self addStandardVocabulary: UnknownType new. self addStandardVocabulary: ScriptNameType new. self addStandardVocabulary: PointType new. self addStandardVocabulary: (SymbolListType new symbols: #(simple raised inset complexFramed complexRaised complexInset complexAltFramed complexAltRaised complexAltInset) translatedNoopAll ; vocabularyName: #BorderStyle; yourself). self addStandardVocabulary: (SymbolListType new symbols: #(lines arrows arrowheads dots) translatedNoopAll ; vocabularyName: #TrailStyle; yourself). self addStandardVocabulary: (SymbolListType new symbols: #(leftToRight rightToLeft topToBottom bottomToTop) translatedNoopAll ; vocabularyName: #ListDirection; yourself). self addStandardVocabulary: (SymbolListType new symbols: #(topLeft bottomRight center justified) translatedNoopAll ; vocabularyName: #ListCentering; yourself). self addStandardVocabulary: (SymbolListType new symbols: #(buttonDown whilePressed buttonUp) translatedNoopAll ; vocabularyName: #ButtonPhase; yourself). self addStandardVocabulary: (SymbolListType new symbols: #(rotate #'do not rotate' #'flip left right' #'flip up down') translatedNoopAll; vocabularyName: #RotationStyle; yourself). self addStandardVocabulary: (SymbolListType new symbols: #(rigid spaceFill shrinkWrap) translatedNoopAll; vocabularyName: #Resizing; yourself). self addStandardVocabulary: self newSystemVocabulary. "A custom vocabulary for Smalltalk -- still under development)" self numberVocabulary. "creates and adds it" self wonderlandVocabulary. "creates and adds it" self vocabularyForClass: Time. "creates and adds it" self addStandardVocabulary: (KedamaPatchType new vocabularyName: #Patch; yourself). self addStandardVocabulary: (SymbolListType new symbols: #(wrap stick bouncing) translatedNoopAll; vocabularyName: #EdgeMode; yourself). self addStandardVocabulary: (SymbolListType new symbols: #(logScale linear color) translatedNoopAll; vocabularyName: #PatchDisplayMode; yourself). "Vocabulary initialize"! !