Jump to content

Front end translation (managing) issue after upgrade to 1.5.5.0


Recommended Posts

Hi all!

 

After upgrading to Prestashop 1.5.5.0 I got a problem with the translations. I am not able anymore to manage the translations of the front end. This means that i cant edit them. (See attachment). It states that there are no expressions..

However, it is still possible to manage/edit the translations of the backend.

 

Anyone with a solution? or is this a bug?

 

Thanks!

post-526539-0-68558100-1378063712_thumb.png

post-526539-0-98203700-1378063712_thumb.png

Edited by sf-webdesign (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Hi all!

 

After upgrading to Prestashop 1.5.5.0 I got a problem with the translations. I am not able anymore to manage the translations of the front end. This means that i cant edit them. (See attachment). It states that there are no expressions..

However, it is still possible to manage/edit the translations of the backend.

 

Anyone with a solution? or is this a bug?

 

Thanks!

 

 

I have the same problem after updating to V 1.5.5.0 "stable"
 
I am Unable to do a fresh install since my shop is in production. I'll try the process again manually WITHOUT Module 1-click.
 
But any help to fix this bug is welcome! I have 2 stores in the same situation.
erro_trans_front.jpg
WebRep
 
Classificação geral
 
 
Este site não tem classificação
(número de votos insuficientes)
 
 
 
 
 
 
 
 
 
 
 
Link to comment
Share on other sites

Hi , please I have a similar problem which is there are less expressions than it should be for example in the front office header fieldset there are only 4 expressions 

can anyone help ?

 

 

I have the same problem after updating to V 1.5.5.0 "stable"
 
I am Unable to do a fresh install since my shop is in production. I'll try the process again manually WITHOUT Module 1-click.
 
But any help to fix this bug is welcome! I have 2 stores in the same situation.
erro_trans_front.jpg
WebRep
 
Classificação geral
 
 
Este site não tem classificação
(número de votos insuficientes)
 
 
 
 
 
 
 
 
 
 
 

 

 

 

Hello all, please turn on error reporting and let me know what errors you see. I can help you from there. Thank you! 

 

Read how to here, http://www.prestashop.com/forums/topic/224525-how-to-turn-on-error-reporting-for-debug-information-500-error-or-blank-page/

 

Always make sure to have a backup!

  • Like 1
Link to comment
Share on other sites

Hello all, please turn on error reporting and let me know what errors you see. I can help you from there. Thank you! 

 

Read how to here, http://www.prestashop.com/forums/topic/224525-how-to-turn-on-error-reporting-for-debug-information-500-error-or-blank-page/

 

Always make sure to have a backup!

Hi there!

 

these errors are displayed:

 

 

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: unrecognized character after (? at offset 10 in /home/httpd/vhosts/armazemcruz.com.br/httpdocs/loja/controllers/admin/AdminTranslationsController.php on line 1104

 

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/armazemcruz.com.br/httpdocs/loja/controllers/admin/AdminTranslationsController.php on line 1624

 

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: unrecognized character after (? at offset 10 in /home/httpd/vhosts/armazemcruz.com.br/httpdocs/loja/controllers/admin/AdminTranslationsController.php on line 1104

 

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/armazemcruz.com.br/httpdocs/loja/controllers/admin/AdminTranslationsController.php on line 1624

 

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: unrecognized character after (? at offset 10 in /home/httpd/vhosts/armazemcruz.com.br/httpdocs/loja/controllers/admin/AdminTranslationsController.php on line 1104

 

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/armazemcruz.com.br/httpdocs/loja/controllers/admin/AdminTranslationsController.php on line 1624

 

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: unrecognized character after (? at offset 10 in /home/httpd/vhosts/armazemcruz.com.br/httpdocs/loja/controllers/admin/AdminTranslationsController.php on line 1104

 

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/armazemcruz.com.br/httpdocs/loja/controllers/admin/AdminTranslationsController.php on line 1624

 

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: unrecognized character after (? at offset 10 in /home/httpd/vhosts/armazemcruz.com.br/httpdocs/loja/controllers/admin/AdminTranslationsController.php on line 1104

 

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/armazemcruz.com.br/httpdocs/loja/controllers/admin/AdminTranslationsController.php on line 1624

 

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: unrecognized character after (? at offset 10 in /home/httpd/vhosts/armazemcruz.com.br/httpdocs/loja/controllers/admin/AdminTranslationsController.php on line 1104

 

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/armazemcruz.com.br/httpdocs/loja/controllers/admin/AdminTranslationsController.php on line 1624

 

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: unrecognized character after (? at offset 10 in /home/httpd/vhosts/armazemcruz.com.br/httpdocs/loja/controllers/admin/AdminTranslationsController.php on line 1104

 

Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/armazemcruz.com.br/httpdocs/loja/controllers/admin/AdminTranslationsController.php on line 1624

 

 

 

Thank you for your help

 

Eduardo

Link to comment
Share on other sites

Hi,
in Prestashop 1.5.6.0 same problem. I can not change language for site and can not translate front office.
Multistore is activated

PHP: 5.2.17

 

 

Warning: preg_match_all() [function.preg-match-all]: Compilation failed: unrecognized character after (? at offset 10 in /var/www/clients/client3/web51/web/controllers/admin/AdminTranslationsController.php on line 1108

Warning: Invalid argument supplied for foreach() in /var/www/clients/client3/web51/web/controllers/admin/AdminTranslationsController.php on line 1628

 

 

anyone know how to fix it?

 

Thank you

Edited by chrasty (see edit history)
Link to comment
Share on other sites

I fixed it in 1.5.6.0

 

Open /controllers/admin/AdminTranslationsController.php

 

on line 1070

 

change :

case 'front':
		// Parsing file in Front office
		$regex = '/\{l\s*s=(?|\'('._PS_TRANS_PATTERN_.')\'|"('._PS_TRANS_PATTERN_.')")(\s*sprintf=.*)?(\s*js=1)?\s*\}/U';
	break;

case 'back':
		// Parsing file in Back office
		if ($type_file == 'php')
			$regex = '/this->l\(\''._PS_TRANS_PATTERN_.'\'[\)|\,]/U';
		else if ($type_file == 'specific')
			$regex = '/Translate::getAdminTranslation\(\''._PS_TRANS_PATTERN_.'\'\)/U';
		else
			$regex = '/\{l\s*s\s*=(?|\''._PS_TRANS_PATTERN_.'\'|"'._PS_TRANS_PATTERN_.'")(\s*sprintf=.*)?(\s*js=1)?(\s*slashes=1)?\s*\}/U';
	break;

case 'errors':
		// Parsing file for all errors syntax
		$regex = '/Tools::displayError\(\''._PS_TRANS_PATTERN_.'\'(,\s*(.+))?\)/U';
	break;

case 'modules':
		// Parsing modules file
		if ($type_file == 'php')
			$regex = '/->l\(\''._PS_TRANS_PATTERN_.'\'(, ?\'(.+)\')?(, ?(.+))?\)/U';
		else
			// In tpl file look for something that should contain mod='module_name' according to the documentation
			$regex = '/\{l\s*s=(?|\''._PS_TRANS_PATTERN_.'\'|"'._PS_TRANS_PATTERN_.'").*\s+mod=\''.$module_name.'\'.*\}/U';
	break;

case 'pdf':
		// Parsing PDF file
		if ($type_file == 'php')
			$regex = '/HTMLTemplate.*::l\(\''._PS_TRANS_PATTERN_.'\'[\)|\,]/U';
		else
			$regex = '/\{l\s*s=(?|\''._PS_TRANS_PATTERN_.'\'|"'._PS_TRANS_PATTERN_.'")(\s*sprintf=.*)?(\s*js=1)?(\s*pdf=\'true\')?\s*\}/U';
	break; 

for :

case 'front':
		// Parsing file in Front office
		  $regex = '/\{l\s*s=[\'\"]'._PS_TRANS_PATTERN_.'[\'\"](\s*sprintf=.*)?(\s*js=1)?\}/U';
	break;

case 'back':
		// Parsing file in Back office
		if ($type_file == 'php')
			$regex = '/this->l\(\''._PS_TRANS_PATTERN_.'\'[\)|\,]/U';
		else if ($type_file == 'specific')
			$regex = '/Translate::getAdminTranslation\(\''._PS_TRANS_PATTERN_.'\'\)/U';
		else
			  $regex = '/\{l\s*s\s*=[\'\"]'._PS_TRANS_PATTERN_.'[\'\"](\s*sprintf=.*)?(\s*js=1)?(\s*slashes=1)?\s*\}/U';
	break;

case 'errors':
		// Parsing file for all errors syntax
		$regex = '/\{l\s*s=[\'\"]'.PS_TRANS_PATTERN_.'[\'\"].*\s+mod=\''.$module_name.'\'.*\}/U';
	break;

case 'modules':
		// Parsing modules file
		if ($type_file == 'php')
			$regex = '/->l\(\''._PS_TRANS_PATTERN_.'\'(, ?\'(.+)\')?(, ?(.+))?\)/U';
		else
			// In tpl file look for something that should contain mod='module_name' according to the documentation
			  $regex = '/\{l\s*s=[\'\"]'._PS_TRANS_PATTERN_.'[\'\"].*\s+mod=\''.$module_name.'\'.*\}/U';
	break;

case 'pdf':
		// Parsing PDF file
		if ($type_file == 'php')
			$regex = '/HTMLTemplate.*::l\(\''._PS_TRANS_PATTERN_.'\'[\)|\,]/U';
		else
		  	 $regex = '/\{l\s*s=[\'\"]'._PS_TRANS_PATTERN_.'[\'\"](\s*sprintf=.*)?(\s*js=1)?(\s*pdf=\'true\')?\s*\}/U';
	break;
Link to comment
Share on other sites

 

I fixed it in 1.5.6.0

 

Open /controllers/admin/AdminTranslationsController.php

 

on line 1070

 

change :

case 'front':
		// Parsing file in Front office
		$regex = '/\{l\s*s=(?|\'('._PS_TRANS_PATTERN_.')\'|"('._PS_TRANS_PATTERN_.')")(\s*sprintf=.*)?(\s*js=1)?\s*\}/U';
	break;

case 'back':
		// Parsing file in Back office
		if ($type_file == 'php')
			$regex = '/this->l\(\''._PS_TRANS_PATTERN_.'\'[\)|\,]/U';
		else if ($type_file == 'specific')
			$regex = '/Translate::getAdminTranslation\(\''._PS_TRANS_PATTERN_.'\'\)/U';
		else
			$regex = '/\{l\s*s\s*=(?|\''._PS_TRANS_PATTERN_.'\'|"'._PS_TRANS_PATTERN_.'")(\s*sprintf=.*)?(\s*js=1)?(\s*slashes=1)?\s*\}/U';
	break;

case 'errors':
		// Parsing file for all errors syntax
		$regex = '/Tools::displayError\(\''._PS_TRANS_PATTERN_.'\'(,\s*(.+))?\)/U';
	break;

case 'modules':
		// Parsing modules file
		if ($type_file == 'php')
			$regex = '/->l\(\''._PS_TRANS_PATTERN_.'\'(, ?\'(.+)\')?(, ?(.+))?\)/U';
		else
			// In tpl file look for something that should contain mod='module_name' according to the documentation
			$regex = '/\{l\s*s=(?|\''._PS_TRANS_PATTERN_.'\'|"'._PS_TRANS_PATTERN_.'").*\s+mod=\''.$module_name.'\'.*\}/U';
	break;

case 'pdf':
		// Parsing PDF file
		if ($type_file == 'php')
			$regex = '/HTMLTemplate.*::l\(\''._PS_TRANS_PATTERN_.'\'[\)|\,]/U';
		else
			$regex = '/\{l\s*s=(?|\''._PS_TRANS_PATTERN_.'\'|"'._PS_TRANS_PATTERN_.'")(\s*sprintf=.*)?(\s*js=1)?(\s*pdf=\'true\')?\s*\}/U';
	break; 

for :

case 'front':
		// Parsing file in Front office
		  $regex = '/\{l\s*s=[\'\"]'._PS_TRANS_PATTERN_.'[\'\"](\s*sprintf=.*)?(\s*js=1)?\}/U';
	break;

case 'back':
		// Parsing file in Back office
		if ($type_file == 'php')
			$regex = '/this->l\(\''._PS_TRANS_PATTERN_.'\'[\)|\,]/U';
		else if ($type_file == 'specific')
			$regex = '/Translate::getAdminTranslation\(\''._PS_TRANS_PATTERN_.'\'\)/U';
		else
			  $regex = '/\{l\s*s\s*=[\'\"]'._PS_TRANS_PATTERN_.'[\'\"](\s*sprintf=.*)?(\s*js=1)?(\s*slashes=1)?\s*\}/U';
	break;

case 'errors':
		// Parsing file for all errors syntax
		$regex = '/\{l\s*s=[\'\"]'.PS_TRANS_PATTERN_.'[\'\"].*\s+mod=\''.$module_name.'\'.*\}/U';
	break;

case 'modules':
		// Parsing modules file
		if ($type_file == 'php')
			$regex = '/->l\(\''._PS_TRANS_PATTERN_.'\'(, ?\'(.+)\')?(, ?(.+))?\)/U';
		else
			// In tpl file look for something that should contain mod='module_name' according to the documentation
			  $regex = '/\{l\s*s=[\'\"]'._PS_TRANS_PATTERN_.'[\'\"].*\s+mod=\''.$module_name.'\'.*\}/U';
	break;

case 'pdf':
		// Parsing PDF file
		if ($type_file == 'php')
			$regex = '/HTMLTemplate.*::l\(\''._PS_TRANS_PATTERN_.'\'[\)|\,]/U';
		else
		  	 $regex = '/\{l\s*s=[\'\"]'._PS_TRANS_PATTERN_.'[\'\"](\s*sprintf=.*)?(\s*js=1)?(\s*pdf=\'true\')?\s*\}/U';
	break;
Resolved.
 
THANK YOU FOR HELP!
Link to comment
Share on other sites

Hey guys, I took the time to make a Pull Request on our GitHub regarding this fix. Our development team got together and saw an issue with Azimov's fix because   > .*\s+mod=   can crash in certain conditions .

 

 

Our Development team came up with a more stable fix and I have attached the file here.

 

 

Please make a backup as you need and replace your classes/admin/AdminTranslationsController.php with this file attached. Let me know if it still works for you.

 

Please make sure to backup :)

AdminTranslationsController.php

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...