[etoys-dev] Re: Translation support

Bert Freudenberg bert at freudenbergs.de
Tue May 11 13:47:09 EDT 2010


On 11.05.2010, at 10:09, Ricardo Moran wrote:
> Hi guys, I uploaded to the inbox the changes I made to the translation framework. After loading that, you can use the following code to split the text domains using the package criteria and export a template:
> 
> =================
> domains := Dictionary new.
> 
> "Count tile phrases"
> GetTextExporter2 new appendVocabularies: domains.
> 
> "Count tile phrases"
> GetTextExporter2 new 
> 		appendStringReceivers: #translated into: domains;
> 		appendStringReceivers: #translatedNoop into: domains.
> 
> phrases := Set new.
> domains do: [:domain | domain do: [:translations | translations do: [:each | phrases add: each]]].
> 
> packages := Set new.
> phrases do: [:each| | package |
> package := PackageOrganizer default packageOfMethod: each ifNone: [].
> package notNil ifTrue: [packages add: package]].
> 
> TextDomainManager initialize.
> packages collect: [:each | each name] thenDo: [: packageName | TextDomainManager registerPackage: packageName domain: packageName].
> 
> GetTextExporter2 exportTemplate.
> ==================
> 
> I plan to upload this script to the update stream using the config map (as Bert suggested) but since I don't know how to do it yet I'm simply sending it to you for now. Please tell me if what I'm doing is correct.
> 
> Thanks in advance,
> Richo 


I'll try it later.

But this does not belong in the update stream. It does not need to be run in everyone's image. Only a developer who wants to produce the templates needs to run it. 

IMHO this belongs into the class initialize method of TextDomainManager. And since modified initializers are run by Monticello when loading the package, there is no need for a changeset at all :)

Btw, do we even need the TextDomainManager anymore? If package names and translation domains are synonyms, why have yet another registry? Wouldn't PackageOrganizer be enough? At the very least it could be hugely simplified. Same for TextDomainInfo, it basically duplicates PackageInfo.

- Bert -

-------------- nächster Teil --------------
Ein Dateianhang mit HTML-Daten wurde abgetrennt...
URL: http://lists.squeakland.org/pipermail/etoys-dev/attachments/20100511/78d37ca7/attachment-0001.html


More information about the etoys-dev mailing list