[etoys-dev] Translation support

Ricardo Moran richi.moran at gmail.com
Tue May 11 13:09:56 EDT 2010

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,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakland.org/pipermail/etoys-dev/attachments/20100511/9c604a89/attachment.html

More information about the etoys-dev mailing list