[Etoys] about LanguageEditor>>checkSpanishPhrase:translation:

Xavier Alvarez xavi.alvarez at gmail.com
Fri Nov 30 00:59:12 EST 2007


Yoshiki,

Here's the de-garbled method. This one was easy to fix (as the text mentions the
garbled characters: exclamación = ¡, interrogación = ¿).  It would seem the string 
suffered quite a bit of abuse as a simple test chunk [1] failed to yield any
valid result... although is probably due to copy-pasting, let's hope my mailer 
isn't as abusive :)

checkSpanishPhrase: phraseString translation: translationString 
	"check the translation and aswer a string with a comment or a 
	nil meaning no-comments"
	| superResult |
	superResult := self checkPhrase: phraseString translation: translationString.
	superResult isNil
		ifFalse: [^ superResult].
	"For some reason, MCInstaller couldn't read Spanish character. "
	"((translationString withBlanksTrimmed includes: $?)
	and: [(translationString withBlanksTrimmed includes: $¿) not]) 
		ifTrue: [^ '¿Olvidó el signo de pregunta?'].
	((translationString withBlanksTrimmed includes: $!)
	and: [(translationString withBlanksTrimmed includes: $¡) not])
		ifTrue: [^ '¿Olvidó el signo de admiración?']
	"
	^ nil


Cheers,
Xavier


[1] De-garbler chunk:
| garbled |
garbled := 'é?OlvidƧ el signo de admiraciƧn?'.
TextConverter allEncodingNames inject: Dictionary new into: [:dict :encoding |
	| converter |
	converter := TextConverter newForEncoding: encoding.
	dict at: encoding put: (garbled convertFromWithConverter: converter).
	dict ]

On Thursday 29 November 2007 10:48, antonio wrote:
an> Hello,
an>
an> I saw Kim said about Squeakpolis.
an> I have just uploaded this:
an> http://squeak.educarex.es/Squeakpolis/uploads/48/EducarexOriginal.changes.zip 
an> http://squeak.educarex.es/Squeakpolis/uploads/48/EducarexOriginal.image.zip 
an> very similar, it could be useful.
an>
an> And that is (tak 12/26/2004 12:10 · private):
an>
an>         checkSpanishPhrase: phraseString translation: translationString 
an>         "check the translation an aswer a string with a comment or a 
an>         nil meaning no-comments"
an>         | superResult |
an>         superResult := self checkPhrase: phraseString translation: 
an>         translationString.
an>         superResult isNil
an>         ifFalse: [^ superResult].
an>         "For some reason, MCInstaller couldn't read Spanish
an>         character. "
an>         "((translationString withBlanksTrimmed includes: $?)
an>         and: [(translationString withBlanksTrimmed includes: $é…) 
an>         not]) ifTrue: [^ 'é…OlvidƧ el signo de pregunta?']. 
an>         ((translationString withBlanksTrimmed includes: $!) 
an>         and: [(translationString withBlanksTrimmed includes: $éÄ) 
an>         not]) ifTrue: [^ 'é…OlvidƧ el signo de admiraciƧn?'] 
an>         "
an>         ^ nil
an>
an>
an> Message: 3
an>
an> > Date: Wed, 28 Nov 2007 16:28:59 -0800
an> > From: Yoshiki Ohshima <yoshiki at vpri.org>
an> > Subject: [Etoys] LanguageEditor>>checkSpanishPhrase:translation: 
an> > To: "etoys at lists.laptop.org" <etoys at lists.laptop.org> 
an> > Message-ID: <umysxopx0.wl%yoshiki at vpri.org>
an> > Content-Type: text/plain; charset=US-ASCII
an> >
an> >   Hello Spanish speaking Etoys developers,
an> >
an> >   It appears that some methods with latin1 characters got messed up 
an> > over the years (possibly when going through Monticello, for some 
an> > instances).  Most of them I can fix, but there is one method I'd like 
an> > to get some suggestions from Spanish speaking people. 
an> >
an> >   Please take a look at
an> > LanguageEditor>>checkSpanishPhrase:translation:.  Can anybody edit the 
an> > method to make it look ok?  Seemingly it was trying to warn the 
an> > LanguageEditor user when a phrase doesn't have a matching ? and 
an> > inverted ?, or ! and inverted !.
an> >
an> >   As you see, it is in a comment and not used (and will not be used) 
an> > anymore so there is no real reason to fix it, but I thought it is nice 
an> > anyway.
an> >
an> >   Thank you!
an> >
an> > -- Yoshiki
an> >
an> > P.S.
an> >   I looked at a Smallland image based on 3.8, but I don't have the 
an> > .changes for the image.  So I cannot see comments... 
an> >
an> > P.P.S.
an> >   Now small-land.org seems to be grabbed.  What is the best place now? 
an>
an>
an>

-- 
XA
=========
Don't Panic!  The Answer is 42


More information about the Etoys mailing list