cdrick65 at gmail.com
Tue Dec 8 10:11:49 UTC 2009
Lukas solution is far more better. But Soup should work too. Did you pass
the string to translate because
the default url and translation is done by "ajax" on the fly. Otherwise, the
string to translate is encodeed at the end of the url.
For instance, try with
2009/12/8 AxiNat <tibabenfortlapalanca at gmail.com>
> Hi all!
> I'm developing a Seaside app that needs to retrieve a translation from
> google translator, so I thought I'd use Soup.
> So i go like:
> *aSoup := Soup fromUrl: 'http://translate.google.com/#en|ca|<http://translate.google.com/#en%7Cca%7C>
> but i find that the fetched string is a bit different from the actual
> source code i can see in Mozilla...
> *results := aSoup findAllTags: **[:aTag |
> *aTag name = 'span' and:
> *[(aTag attributeAt: 'id') asString beginsWith: 'result_box']].*
you can also search for span whose title are each line you want to
> results contains the correct tag, but the tag contains an empty string,
> instead of the translation (it holds the translated string when I check the
> HTML source in firefox)
> Any ideas? I find it really awkward, I've worked with soup before and never
> had such problem... so I'm kinda clueless.
> Sorry if the question is a bit off-topic (not exactly a Seaside issue...),
> I just guessed that a lot of seasiders sure must have dealt with Soup quite
> a few times :)
> Bernat Romagosa.
> seaside mailing list
> seaside at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside