I just encountered a problem with the javascript translation. I have a javascript file where I generate small UI elements using jQuery, and I wrap the label in the Drupal.t function. The site is multilingual NL/FR So e.g.:


For some reason the translation failed; I only got out what I put in: Dutch in this case. After clearing the Drupal cache everything seems to be back to normal. I assume somehow the generation of the french translation js file failed, but I'm unsure how this could have happened.

Anybody know what could cause this, or how to pro-actively refresh the cache?


You can refresh the cache with drush: drush cc css-js to clear only Javascript (the admin module allows you to do this from config), or you can just go to performance and clear all the cache.

It does seems like clearing cache is important in these cases: https://www.drupal.org/docs/7/api/localization-api/translating-strings-in-javascript

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.