Hello all,
(Just a little background) I'm trying to implement the Google
translation services for a metropolitan planning organization that I
work for (
www.dvrpc.org). The (somewhat) difficult part of this is
trying to accommodate our existing page structure.
What I'm Doing:
What I'm trying to do is (using some jQuery) to pick out the
paragraphs innerHTML (<p> tags) on our site and translate that content
into a selected language. Because of the character limit, I'm using a
combination of substring and breaking up the text by period, semi-
colon or comma for semantic reasons. So, each request is of a
different size (and usually the last request is the smallest).
Once I get the result.translation I'm adding that to the innerText of
the <p> element that I translated.
The Problem:
Because each request for translation is a different size, the smaller
ones finish first, and thus go into my <p> element first. The
paragraph gets chopped up and thus makes no sense. NOTE: It works fine
in Firefox 2.0, I only notice this in IE 6. (Haven't tested in FF 3.0
or IE 7).
So, it is probably something wrong in my design, but I can't wrap my
head around it. Baring that, is there a way to wait for the result
from google.language.translate (I know it defeats the purpose of
AJAX).
Here is the url:
http://www.dvrpc.org/asp/test/googletranslate/mission2.htm
Thanks for reading and any help you are able to provide,
Nicholas Canzoneri