'From Small-Land 3.8-5976-0266 of 10 September 2004 [latest update: #5976] on 7 October 2004 at 9:23:12 pm'! "Change Set: LocaleID-DisplayName-dgd Date: 7 October 2004 Author: Diego Gomez Deck " (NaturalLanguageTranslator isoLanguage: 'es') phrase: '' translation: 'Español'. (NaturalLanguageTranslator isoLanguage: 'de') phrase: '' translation: 'Deutsch'. ! !Locale class methodsFor: 'accessing' stamp: 'dgd 10/7/2004 20:50'! stringForLanguageNameIs: localeID "Answer a string for a menu determining whether the given symbol is the project's natural language" ^ (self current localeID = localeID ifTrue: [''] ifFalse: ['']) , localeID displayName! ! !LocaleID methodsFor: 'accessing' stamp: 'dgd 10/7/2004 21:16'! displayName "Answer a proper name to represent the receiver in GUI. The wording is provided by translations of the magic value ''. 'English' -> 'English' 'German' -> 'Deutsch' " | magicPhrase translatedMagicPhrase | magicPhrase := ''. translatedMagicPhrase := magicPhrase translatedTo: self. ^ translatedMagicPhrase = magicPhrase ifTrue: [self displayLanguage] ifFalse: [translatedMagicPhrase]! ! !NaturalLanguageTranslator methodsFor: 'accessing' stamp: 'dgd 10/7/2004 20:50'! displayName ^ id displayName! ! !PRServerDirectory methodsFor: 'private' stamp: 'dgd 10/7/2004 20:55'! getPostArgsFromProject: aProject fileNamed: fileNameString fromDirectory: localDirectory | args thumbnail uploader | args := Dictionary new. "" args at: 'contents' put: {(localDirectory oldFileNamed: fileNameString) contentsOfEntireFile}. "" args at: 'name' put: {aProject name isoToSqueak}. args at: 'version' put: {(Project parseProjectFileName: fileNameString) second asString}. args at: 'language' put: {aProject naturalLanguage asString}. "" uploader := Utilities authorNamePerSe. uploader isEmptyOrNil ifTrue: [uploader := Utilities authorInitialsPerSe]. uploader isEmptyOrNil ifFalse: [args at: 'uploader' put: {uploader}]. "" self putSmalltalkInfoInto: args. "" thumbnail := self getProjectThumbnail: aProject. thumbnail isNil ifFalse: [args at: 'thumbnailcontents' put: {thumbnail}]. "" self putProjectDetailsFrom: aProject to: args. "" ^ args! ! !Project methodsFor: 'language' stamp: 'dgd 10/7/2004 21:05'! chooseNaturalLanguage "Put up a menu allowing the user to choose the natural language for the project" | aMenu availableLanguages | aMenu _ MenuMorph new defaultTarget: self. aMenu addTitle: 'choose language' translated. aMenu lastItem setBalloonText: 'This controls the human language in which tiles should be viewed. It is potentially extensible to be a true localization mechanism, but initially it only works in the classic tile scripting system. Each project has its own private language choice' translated. Preferences noviceMode ifFalse:[aMenu addStayUpItem]. availableLanguages := NaturalLanguageTranslator availableLanguageLocaleIDs asSortedCollection:[:x :y | x displayName < y displayName]. availableLanguages do: [:localeID | aMenu addUpdating: #stringForLanguageNameIs: target: Locale selector: #switchToID: argumentList: {localeID}]. aMenu popUpInWorld "Project current chooseNaturalLanguage"! ! !Project methodsFor: 'language' stamp: 'dgd 10/7/2004 20:51'! naturalLanguage "Answer the natural language for the project" ^ self localeID displayName! ! !ProjectNavigationMorph methodsFor: 'the buttons' stamp: 'dgd 10/7/2004 20:53'! buttonLanguage "Answer a button for finding/loading projects" ^ SimpleButtonDelayedMenuMorph new target: self; borderColor: #raised; color: self colorForButtons; label: Project current naturalLanguage font: self fontForButtons; setBalloonText: 'Click here to choose your language.' translated; actionSelector: #chooseLanguage! !