[Cuis] Multilingual applications in Cuis

H. Hirzel hannes.hirzel at gmail.com
Tue Jan 29 05:49:23 CST 2013


Hello Germán and Juan

On 1/29/13, Juan Vuletich <juan at jvuletich.org> wrote:
> Hi Germán,
>
> For a desktop app, Squeak includes #translated, and the necessary
> functionality. The code is not complex, and it could be easily turned
> into an optional package for Cuis.

It would be good to have an external package which deals with strings
constants and translations of it.

There is a class category in Squeak 4.4
    'GetText-Localization'

with the classes
    MOFile
    GetTextTranslator
    TextDomainManager  (a Singleton)

However it seems that the code is etoys specific

see for example method
   domainForClass: aClass
	^'etoys'

TextDomainManager class


Accessing translated strings goes through


String>>translated
	"answer the receiver translated to the default language"
	| translation |
	translation := self
		translatedTo: LocaleID current
		inDomain: (TextDomainManager domainOfMethod: thisContext sender method).
	self == translation ifTrue: [^self translatedInAllDomains].
	^translation

And a class

  NaturalLanguageTranslator in the category

SystemLocalization (an abstract class of natural language translators,
all implemented as singletons).
is involved as well.

The gettext apporach http://en.wikipedia.org/wiki/GNU_gettext is used.

I would not call the Squeak implementation particularly simple and it
seems to be incomplete. I think it would be good to have it rewritten
for Cuis.

--Hannes




More information about the Cuis mailing list