Hi,

I was updated on the forum that we need to enable json format translation when we use ajax. The documentation is at https://gtranslate.io/docs/58-gtranslate-tdn-documentation.

Would be great if the module can translate views ajax.

Thanks,
Sadashiv.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sadashiv created an issue. See original summary.

sadashiv’s picture

Hi,

I think views is most common and I was able to get it translated using one hook. I am attaching a patch for the same.

Hth,
Sadashiv.

omarlopesino’s picture

Status: Active » Needs review
FileSize
4.61 KB

This does not work correctly in all cases because AJAX callbacks are made without using language prefix.
The AJAX call is still being made to /views/ajax or /system/ajax instead of /en/views/ajax or /en/system/ajax .

I upload a patch which hooks into jquery ajax prefilter event and add the prefix for the urls mentiones (/views/ajax , /system/ajax). It can be set up in the gtranslate config, in "Ajax paths" textarea.

Please review, thanks!

omarlopesino’s picture

Uploading new patch, fixing some uses cases for ajax callbacks.