[etoys-dev] Etoys: GetText-Richo.5.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue May 25 21:44:29 EDT 2010
Ricardo Moran uploaded a new version of GetText to project Etoys:
http://source.squeak.org/etoys/GetText-Richo.5.mcz
==================== Summary ====================
Name: GetText-Richo.5
Author: Richo
Time: 25 May 2010, 10:44:35 pm
UUID: fbe6c380-d84d-2e44-b21e-19f8f722c5de
Ancestors: GetText-Richo.4
* Fixed #appendStringReceivers:into: to correctly use the default domain when a method doesn't belong to any package.
* Removed all extra information except "Language-Name" and "Language-Direction" (both are only exported to default domain po file).
=============== Diff against GetText-Richo.4 ===============
Item was changed:
----- Method: GetTextExporter>>appendStringReceivers:into: (in category 'private') -----
appendStringReceivers: aSymbol into: domains
| literals references domainName methodReference keywords found |
found := TranslatedReceiverFinder new stringReceiversWithContext: aSymbol.
found do: [ :assoc |
methodReference := assoc key.
keywords := assoc value.
+ domainName := (PackageOrganizer default packageOfMethod: methodReference ifNone: [nil]).
+ domainName := domainName isNil ifTrue: [TextDomainManager defaultDomain] ifFalse: [domainName name].
- domainName _ self getTextDomainForPackage:
- (PackageOrganizer default packageOfMethod: methodReference ifNone: [TextDomainManager defaultDomain]).
literals _ domains at: domainName ifAbsentPut: [Dictionary new].
keywords do: [ :literal |
references _ literals at: literal ifAbsentPut: [OrderedCollection new].
references add: methodReference.
].
].
+
!
Item was changed:
----- Method: GetTextExporter>>createExtraInformation (in category 'private') -----
createExtraInformation
| extras |
extras := OrderedCollection new.
#(
'Language name as you''d like it to appear in the Languages menu' 'Language-Name'
- 'Scale to apply to font size (2 for twice as large)' 'Font-Scale'
'Directionality of language' 'Language-Direction'
+ ) pairsDo: [:first :second |
- 'Use this if you do not want any of the text to be bolded, for legibility' 'Suppress-Bold'
- 'Font to use on a Windows system' 'Win-Font'
- 'Font to use on a Mac system' 'Mac-Font'
- 'Font to use on a Linux system' 'Linux-Font') pairsDo: [:first :second |
extras add: (Array with: '' with: first with: second).
].
^ extras!
Item was changed:
----- Method: GetTextExporter>>export:translator:domain: (in category 'private') -----
export: literals translator: translator domain: domainName
| fileName |
"Export a gettext file in a category. literals is a dictionary of keyword -> #(MethodReference...) in the textDomain."
fileName := self dirNameDomain: domainName translator: translator.
[stream := FileStream forceNewFileNamed: fileName.
stream lineEndConvention: #lf.
stream converter: UTF8TextConverter new.
self exportHeader: domainName.
+ domainName = TextDomainManager defaultDomain
+ ifTrue: [self exportInformation: self createExtraInformation].
- self exportInformation: self createExtraInformation.
self exportBody: literals translator: translator]
ensure: [stream close]!
More information about the etoys-dev
mailing list