this works only if "#googtrans/.." is already in the URL. If you
choose the language at the site with "<form", unfortunately it does
not work. does google offers a variable which I can attach to
"action"?

On 12 Jan., 18:28, qoregexp wrote:
> For some reason Google Translate doesn't add the translate tag to the
> action in forms, so after you click the submit button, the target page
> isn't translated.  You can work around this as follows:
>
> change
>
> <formmethod="post" action="whatever">
>
> to
>
> <formmethod="post" action="whatever" onsubmit="this.action +=
> location.hash">
>
> If you find that the submit button on a translatedformdoesn't work
> at all (you click and nothing happens at all), the problem is probably
> the placement of the <form> tag.  A syntax checker will tell you if
> the <form> tag is in a place it's not supposed to be.  Most browsers
> can cope but somehow the translated pages are much fussier.
>
> For links in Javascript, it's the same, i.e.
>
> this.document.location.href = "whatever += location.hash;
> or
> window.location += location.hash;
>
> My actual implementation was slightly more involved, since
> location.hash isn't set until you LEAVE the first page you translate,
> but that's basically it.

Reply via email to