Fwd: Re: Spanish Vocabulary

Daniel Kornhauser dkor at media.mit.edu
Fri Oct 12 14:05:44 UTC 2001


Dear Goran:

You internationalization tutorial was GREAT. I did the translation to 
Spanish a few days ago but it was short lived.
When I finished the list I close squeaky without saving.
YES I'm stupid, yes I ignored the warning message ....
Anyway now I have timed who much it take's to translate to Spanish : it's 
five hours of work (with breaks and other distractions). The translations I 
did wasn't very good because I didn't know what 30% of the terms I was 
translating actually did in EToys.but it was decent.

  I will work on it next week; I'm leaving to work one week in Mexico in a 
little town called "Santa Clara del Cobre "and I have no choice because I 
want to use it there.

So Please forgive me for my delay in my replies and we well have a Spanish 
Etoys before the end of the month.

						Daniel.

P.S:

I took the liberty of including goran internationalization tutorial as I 
found it very helpful:

From: goran.hultgren at bluefish.se
Received: from pegasus.corren.se ([192.165.38.119])
	by aleve.media.mit.edu (8.9.3/8.9.3/+ALEVE) with ESMTP id EAA11007
	for <dkor at media.mit.edu>; Wed, 3 Oct 2001 04:26:54 -0400 (EDT)
Received: from aSqueakSystem (marvin.corren.se [172.1.73.19])
  by pegasus.corren.se (Sun Internet Mail Server sims.4.0.2000.10.12.16.25.p8)
  with SMTP id <0GKM00G32FBUG6 at pegasus.corren.se> for dkor at media.mit.edu; Wed,
  3 Oct 2001 10:23:55 +0200 (MET DST)
Date: Wed, 03 Oct 2001 10:05:47 +0100
Subject: Re: How to do Etoy Translations.
To: Daniel Kornhauser <dkor at media.mit.edu>
Message-id: <0GKM00G33FBUG6 at pegasus.corren.se>
MIME-version: 1.0
X-Mailer: Celeste 2.0.4343
Content-type: TEXT/PLAIN
Content-transfer-encoding: 8BIT
X-UID: 7214

Hi! (this email turned into a little tutorial, hope you don't mind...)

Daniel Kornhauser <dkor at media.mit.edu> wrote:
 > Hi Goran:
 >
 > I noticed that you posted a Swedish translation to the EToyVocabulary. I'd
 > like to make a Spanish translation of the
 > EToyVocabulary.
 > Since I don't know Smalltalk (but I can handle other languages, C, java,
 > python, etc...) my first question is how to I load
 > SwedishVocabulary.cs in Squeak ( I'm lost in the pop up menus I can't file
 > "open file" or something that looks like it).

First, make sure you have a fresh Squeak image. I use 3.1a update 4343.

Well, start with open... from the popupmenu you get when pointing at the
desktop, and then "filelist". This gives you a little filebrowser, find
the directory where you have downloaded my changeset. If you don't have
it handy I found it at:

http://attach4.groups.yahoo.com/v1/cLe6O0f56hQgRP77MO0Y0mnxu926ODo5G92l51TFqmcGGe9wKt8CPuGkvoyVzHI2hOfsGtUTxeZyLlid0RVjsqcDnoHdH1TpnYoSXM2cT-3Ax 
rLx_ADNsZzuKxY/SwedishVocabulary.cs.gz

 > Daniel : If you don't find it with this link you can just go to yahoo 
squeak links and search for SwedishVocabulary.

Select the file and select "decompress into file". This creates a .cs
file. Select that one and do "file in to new changeset" in the
popupmenu. That is better than plain "file in".

ChangeSets are wonderful little things which can be described as
"recording tapes" that record all the source code changes that you do no
matter what tool you are using. The best tool to play with them is the
"dual change sorter" which you open with "open..."->"dual change
sorter".

You should find my changeset for my swedish translation at the top and
by looking at it you see exactly what changes it contains. You should
see that it contains changes to two classes - EToyVocabulary and
Project. By selecting each you see that I changed one method in Project
called "chooseNaturalLanguage". You can then select a method and do
"versions". This gives you a small browser showing you exactly what I
did. My initials are "gh" and "sw" is Scott Wallace. You can register
your own initials by editing the swikipage at:
http://minnow.cc.gatech.edu/squeak/8

I just checked and "dk" seems to be available! :-) As soon as you try to
change anything in Squeak it will ask you for your initials.

Anyway, to make your own spanish translation you should create a new
changeset called "SpanishVocabulary" or something and then make sure
that this new changeset is the one that is recording. Create it by doing
"create new changeset" in the dual change sorter.

Automatically Squeak will change over to record in your new changeset -
in the title of the dual change sorter you can see which changeset is
the "current" one, it should now be your new one.

The next step is to edit the same methods like I did! As you can see I
changed one in Project and two in EToyVocabulary (well, three to be
exact but the change in templateForLanguageTranslation was just a better
comment), and then I added one new to EToyVocabulary called
#addSwedishVocabulary.

Changing a method is easy - you just edit it and save it by doing
"accept" or alt-s (on Win32). If you change the top line of the method
(the signature) and do a save you will automatically create a new method
if the signature is different.

Normally a Smalltalk developer would do this in the normal browser. You
get one with "open..." and then "browser". Use "find class" to find
EToyVocabulary. Take a look at the methods and then just edit and save!

When you save your edits you will see them showing up in your dual
change sorter. The easiest way for you to know what to translate stuff
to is to look at the method #templateForLanguageTranslation which has
the translations in english, because I guess your swedish is a little
bit rusty... Andreas explains in the comment there how to do it too.

(a note: In that method there are sometimes symbols #blabla where I
instead used Strings like 'blabla', it probably doesn't matter - I just
did what Andreas did in his german translation)

Anyway, in short you would add "Español" after my "Svenska" in the
#chooseNaturalLanguage method. Then you would add one line in
#assureTranslationsAvailableFor: much like I did.

And then you would create a new method called #addSpanishVocabulary in
which you just change all the translations and also refer to #Español
instead of #Svenska like I did.

When you are done you should actually be able to try it out by creating
a new Project, entering it and testing it by doing help...->set language
and selecting "Español".

BTW - I noted that the ñ doesn't work when creating symbols using the #
sign. You will have to use #Espanol instead or write:

'Español' asSymbol

...instead of:

#Español

Hmm, ok, if we want to be correct then the method #chooseNaturalLanguage
will look like:
      ...
	#(English Deutsch Kiswahili Svenska 'Español') do:
		[:langSymbol |
			aMenu addUpdating: #stringForLanguageNameIs: target: self selector:
#setNaturalLanguageTo: argumentList: {langSymbol asSymbol}].
	aMenu popUpInWorld

Note that I added "asSymbol" to ensure that 'Español' (which is a String
literal, not a symbol) will be converted to a symbol. The others are
already symbols (even though they do not have the symbol sign # in front
of them - this is because of the fact they are inside a literal array
#() where they don't have too) so they won't mind! :-) Yeah, array
creation using #() is a little bit tricky in Smalltalk - it is actually
heavily being debated right now on the list. As is also accented
characters!

 > 			Thanks  a lot
 > 					daniel

Always nice to be able to help! Just mail me if/when you get stuck. You
can also "bounce" your changeset on me if you want me to check it out
before posting it on the list. I will be going to Iceland tomorrow
though and will be back on monday. You can also probably bounce it on
Andreas Raab - he is a nice guy! :-)

regards, Göran





More information about the Squeak-dev mailing list