Jump to content

Simple way to translate your prestashop theme


riconegri

Recommended Posts

On page translations of Prestashop in Chrome, you translate the page to the desired language, and runs the script below in the console

 

jQuery('tbody tr').each(function(i){
 var vau = jQuery(this).find('input').val() || jQuery(this).find('textarea').val();
 if(!vau){
jQuery(this).find('input').val(jQuery(this).find('td').eq(0).text());
jQuery(this).find('textarea').val(jQuery(this).find('td').eq(0).text());
//console.log(jQuery(this).find('td').eq(0).text());
 }
});

 

 

 

The translated terms of the browser, were transferred to the fields, so now it's just correct, and save your translation.

Remember, symbols are wrongly translated, so remember to pass the translation, and change, for exemple, the '% d' to '% d' ..., remove a blank ..., or improve script...

 

Thanks...

post-552935-0-83280600-1376326761_thumb.jpg

post-552935-0-06158300-1376326774_thumb.jpg

post-552935-0-85883800-1376326786_thumb.jpg

Edited by riconegri (see edit history)
  • Like 5
Link to comment
Share on other sites

  • 3 years later...

Hola, ojalá me pudieran ayudar. Al ingresar el código:

 

jQuery('tbody tr').each(function(i){
  var vau = jQuery(this).find('input').val() || jQuery(this).find('textarea').val();
  if(!vau){
jQuery(this).find('input').val(jQuery(this).find('td').eq(0).text());
jQuery(this).find('textarea').val(jQuery(this).find('td').eq(0).text());
//console.log(jQuery(this).find('td').eq(0).text());
  }
});

 

 
Me sale el siguiente error en la consola y no cambia nada
 
 
VM2419:1 Uncaught ReferenceError: jQuery is not defined(…)(anonymous function) @ VM2419:1
 
 
Que creen que pueda ser que hago mal?
 
De antemano muchas gracias!
Link to comment
Share on other sites

  • 1 month later...

On page translations of Prestashop in Chrome, you translate the page to the desired language, and runs the script below in the console

 

 

jQuery('tbody tr').each(function(i){
var vau = jQuery(this).find('input').val() || jQuery(this).find('textarea').val();
if(!vau){
jQuery(this).find('input').val(jQuery(this).find('td').eq(0).text());
jQuery(this).find('textarea').val(jQuery(this).find('td').eq(0).text());
//console.log(jQuery(this).find('td').eq(0).text());
}
});

 

 

The translated terms of the browser, were transferred to the fields, so now it's just correct, and save your translation.

Remember, symbols are wrongly translated, so remember to pass the translation, and change, for exemple, the '% d' to '% d' ..., remove a blank ..., or improve script...

 

Thanks...

 

amazing, everyone should know this!!!!! you saved me tons of hours!!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...