For some reason the l10n_client is not posting the "source" variable for me. When l10n_client_save_string() executes it has "target", "textgroup", and "form_token" variables but never gets the "source" variable. So I end up with WSOD on mydomain.com/de/i18nstrings/save. Just did a clean install of the dev version. I'm using i18n with 6 languages. Everything works except the client translation.
I also noticed I have three POSTS being sent. Is this normal?
First posts "source=Street" with "Street" being the variable I am translating.
// URL=http://mydomain.com/de/icl_content/icl_string_status
Host=mydomain.com
User-Agent=Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.10) Gecko/20100504 Firefox/3.5.10 (.NET CLR 3.5.30729)
Accept=*/*
Accept-Language=en-us,en;q=0.5
Accept-Encoding=gzip,deflate
Accept-Charset=ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive=300
Connection=keep-alive
Content-Type=application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With=XMLHttpRequest
Content-Length=53
Cookie=SESS73ed5c96d0d7f839706145f64d91a738=e51dd5cadc7d4a39eb490c12ec8b1ff1; __utma=120964508.524358018.1277363088.1277363088.1277365847.2; __utmz=120964508.1277363088.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none); __utmv=120964508.authenticated%20user%2Cadmin%20super; Drupal_l10n_client=1; has_js=1; __utmc=120964508
Pragma=no-cache
Cache-Control=no-cache
POSTDATA=icl_ajx_action=icl_single_string_status&source=Street
Second does this
// URL=http://mydomain.com/de/icl_content/icl_string_status
Host=mydomain.com
User-Agent=Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.10) Gecko/20100504 Firefox/3.5.10 (.NET CLR 3.5.30729)
Accept=*/*
Accept-Language=en-us,en;q=0.5
Accept-Encoding=gzip,deflate
Accept-Charset=ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive=300
Connection=keep-alive
Content-Type=application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With=XMLHttpRequest
Content-Length=37
Cookie=SESS73ed5c96d0d7f839706145f64d91a738=e51dd5cadc7d4a39eb490c12ec8b1ff1; __utma=120964508.524358018.1277363088.1277363088.1277365847.2; __utmz=120964508.1277363088.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none); __utmv=120964508.authenticated%20user%2Cadmin%20super; Drupal_l10n_client=1; has_js=1; __utmc=120964508
Pragma=no-cache
Cache-Control=no-cache
POSTDATA=icl_ajx_action=icl_any_queued_strings
Third posts the rest of the variables. I guess this is what l10n_client_save_string() ends up with.
// URL=http://mydomain.com/de/i18nstrings/save
Host=mydomain.com
User-Agent=Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.10) Gecko/20100504 Firefox/3.5.10 (.NET CLR 3.5.30729)
Accept=text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language=en-us,en;q=0.5
Accept-Encoding=gzip,deflate
Accept-Charset=ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive=300
Connection=keep-alive
Referer=http://mydomain.com/de/admin/by-module
Cookie=SESS73ed5c96d0d7f839706145f64d91a738=e51dd5cadc7d4a39eb490c12ec8b1ff1; __utma=120964508.524358018.1277363088.1277363088.1277365847.2; __utmz=120964508.1277363088.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none); __utmv=120964508.authenticated%20user%2Cadmin%20super; Drupal_l10n_client=1; has_js=1; __utmc=120964508
Content-Type=application/x-www-form-urlencoded
Content-Length=187
POSTDATA=target=Stra%C3%9Fe&op=%C3%9Cbersetzung+speichern&textgroup=default&form_build_id=form-97af362bc7f6c4bc1f2b57396ca61839&form_token=d2e04e591683fdea833fabb8169032b5&form_id=l10n_client_form
Any ideas as to why it's doing this?
Comments
Comment #1
tinker commentedOK, I have figured out why the client is not working. It turns out that the AJAX form submit is never triggered because the form ID does not match.
In l10n_client.js there is a submit() on form ID "l10n-client-form" but for some reason on my site this form ID is "l10n-client-form-1". I don't know why the "-1" is appended to the form id but if I modify the form names in l10n_client.js everything works.
Here is the form that is generated: (I have overridden to use )
Comment #2
tinker commentedSorry marked the wrong version
Comment #3
tinker commentedRead up on JQuery and rolled a patch to fix this issue. Reading though other issues on drupal.org it was recommended not to use #ids with AJAX and to use .classes instead. So basically all I have done in this patch is to introduced a class for the l10n-client-form and use that as a context for selecting all the objects within it.
I would really appreciate if I could get some help testing this and having it committed. Please let me know if there is anything I can do to speed up the process.
Comment #4
gábor hojtsyWhy would there be two copies of the same form on the page? That's why Drupal would name the second one like that. Can you figure out why it's included twice? That's the base issue. If you have two copies of the form, you have other problems, so let's not masquerade it this way.
Comment #5
tinker commentedI do not have two copies of the form. That's what weird. I do however have multiple other forms on pretty much every page (add to cart, newsletter signup etc). I search for "l10n-client-form" in the rendered xhtml source code and only return one hit which is always "l10n-client-form-1".
Comment #6
tinker commentedThrough a strange turn of events I discovered it was the Cufon module causing this problem.
Cufon module disables $closure in preprocess_page function
http://drupal.org/node/734630
It forced preprocess_page run twice, and made the form ids have "-1" appended to them, which caused the JavaScripts to fail.
Comment #7
danny_joris commentedJust want to confirm #6. I had the same issue with Cufon. Now fixed thanks to #734630: Cufon module disables $closure in preprocess_page function