Hi everyone,

I installed Entity Translation module along with the Internationalization (i18n) module (v1.11).
I configured the Entity Translation in order to translate Nodes and I made some translations regarding Nodes, Menu Items and Blocks.

The problem is that jQuery $(document).ready function works in English (default language) pages but NOT in Spanish pages for instance.
In Spanish pages, jQuery IS executed but the $(document).ready NOT. For example, a call like "$(".my-item-class").addClass("another-class");" works well.

I followed the guidelines to declare the $(document).ready function in Drupal but its content is never executed. In fact, all Drupal modules that use jQuery $(document).ready function fail in Spanish pages. Although they also follow the guidelines and declare that call (e.g. in Drupal behaviors) the problem appears.

I also tried to change the default language to Spanish, but the problem persists. Only English pages do not have this problem.

My Drupal website controls the language through the URL:

mywebsite.org/my-content-page
mywebsite.org/es/my-content-page

I reviewed Firebug but no error message is shown. jQuery is loaded and the only errors are related with JS that needs some work from code inside $(document).ready calls.

I reviewed jQuery Update but everything seems fine. I am using jQuery 1.7 version.
I also tried with the latest versions of Entity Translation (dev) and i18n (v1.13) but the same error again.

Do you have any idea about what could be the origin of this problem?

Thank you very much.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MmMnRr created an issue. See original summary.

MmMnRr’s picture

Hi,

Finally I solved this issue.
The problem was related to the EU Cookie Compliance module. That module has specific configuration for each language and that was the cause of the jQuery document.ready error. I had to save the configuration of this module in each language and the problem was solved.

Also, I did not explain that in browser console there was an error about some javascript code regarding the EU Cookie Compliance module. I thought that the error was not related to the jQuery issue, but it was.

Sorry for the inconvenience!
Issue solved.

MmMnRr’s picture

Status: Active » Closed (works as designed)