[etoys-dev] Etoys: System-bf.22.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat Jun 26 09:14:56 EDT 2010
Bert Freudenberg uploaded a new version of System to project Etoys:
http://source.squeak.org/etoys/System-bf.22.mcz
==================== Summary ====================
Name: System-bf.22
Author: bf
Time: 26 June 2010, 3:14:06 pm
UUID: 25c8a8c1-a006-4431-8fa3-3d08528779d2
Ancestors: System-bf.21
- store list of languages used in a project in the project manifest (SQ-513)
=============== Diff against System-bf.21 ===============
Item was changed:
----- Method: Project>>storeAttributesOn: (in category 'file in/out') -----
storeAttributesOn: aStream
"For the manifest: write a series of cr-delimited records of the form <key>: <value> to a stream."
| details loggedInAs incomingUser existingUri uri uriPrefix |
self storeAttributeKey: 'Squeak-Version' value: SystemVersion current version on: aStream.
self storeAttributeKey: 'Squeak-LatestUpdate' value: SystemVersion current highestUpdate printString on: aStream.
self storeAttributeKey: 'File-Name-Encoding' value: LanguageEnvironment defaultFileNameConverter class encodingNames first on: aStream.
self storeAttributeKey: 'Project-Language' value: Locale current localeID printString on: aStream.
+ self localesString ifNotEmptyDo: [:localesString |
+ self storeAttributeKey: 'Project-Languages' value: localesString on: aStream].
loggedInAs := 'unknown'.
Utilities loggedIn ifTrue:
[ServerDirectory servers at: 'My Squeakland' ifPresent:
[:server | loggedInAs := server userPerSe ifNil: ['unknown']]].
incomingUser := self projectParameterAt: #user ifAbsent: ['unknown'].
"If the project was loaded from outside, this will be the user associated with that outside version"
existingUri := self projectParameterAt: #URI ifAbsent: [nil].
uriPrefix := 'http://squeakland.org/etoys/'.
uri := uriPrefix, loggedInAs, '-', Time totalSeconds printString.
existingUri ifNotNil:
[incomingUser = loggedInAs
ifTrue:
[uri := existingUri.
(self projectParameterAt: #'prev-URI') ifNotNilDo:
[:prior | self storeAttributeKey: #'prev-URI' value: prior on: aStream]]
ifFalse:
[incomingUser = 'unknown' ifTrue: "saved as unknown user, now publishing as registered user; teefal wants new uri but using original epoch in this case."
[uri := String streamContents:
[:str |
str nextPutAll: uriPrefix.
str nextPutAll: loggedInAs, '-'.
str nextPutAll: (existingUri copyAfterLast: $-)]].
self storeAttributeKey: 'prev-URI' value: existingUri on: aStream]].
self storeAttributeKey: 'URI' value: uri on: aStream.
self storeAttributeKey: 'user' value: loggedInAs on: aStream.
details _ self world valueOfProperty: #ProjectDetails ifAbsent: [Dictionary new].
Project publishInSexp ifTrue: [
self storeAttributeKey: 'Project-Format' value: 'S-Expression' on: aStream.
self storeAttributeKey: 'Project-Format-Version' value: '1.0' on: aStream.
] ifFalse: [
self storeAttributeKey: 'Project-Format' value: 'ImageSegment' on: aStream.
].
details associationsDo: [:assoc |
self storeAttributeKey: assoc key asString value: assoc value asString on: aStream.]!
Item was added:
+ ----- Method: Project>>locales (in category 'language') -----
+ locales
+ "Answer list of all locales found in translatable objects"
+ | locales |
+ locales := Set new.
+ world allMorphsDo: [:m |
+ ((m isKindOf: TextMorph) and: [m translatable]) ifTrue: [
+ m valueOfProperty: #translations ifPresentDo: [:translations |
+ translations keysDo: [:locale | locales add: locale]]]].
+ ^locales!
Item was added:
+ ----- Method: Project>>localesString (in category 'language') -----
+ localesString
+ "Answer comma-separated string of all locales found in translatable objects"
+ ^String streamContents: [:stream |
+ self locales
+ do: [:locale | stream print: locale]
+ separatedBy: [stream nextPut: $,]]!
More information about the etoys-dev
mailing list