Jump to content

[Solved]error trying to import a language pack


Recommended Posts

Hi , I have this error
"
1 error
1. archive cannot be extracted
"

when trying to import a language pack I downloaded from the prestashop site

I dont know what could be the problem , is there something that i have to configure before importing a language pack ?

thanks

Link to comment
Share on other sites

step 1 : Back Office >> Tools >> Languages Add New

step 2 : Back Office >> Tools >> Translations >> Translation exchange > import

Link to comment
Share on other sites

hi, thanks for the reply

I tried this:

1- went to my BO , exported a language pack, it gave me a nn.gzip file
2- tried to import tha file and it gave the same error

I checked privilegies of the directory translations either in the root dir and the themes dir Languages in the server and both are set to 777
is there any other possible reason for this error

thanks in advance

Link to comment
Share on other sites

You should check that GZIP compression is enabled on your server. When you installed PrestaShop, was "GZIP compression is on (recommended)" ticked? It may be possible to enable it using a php.ini file, or you may need to contact your host to enable it on your server.

Link to comment
Share on other sites

phpinfo'ing my server I got this settings
[Apache Environment]
-HTTP_ACCEPT_ENCODING gzip,deflate
[HTTP Headers Information]
-Accept-Encoding gzip,deflate


_SERVER["HTTP_ACCEPT_ENCODING"] gzip,deflate

from this info can I say that GZIP is available.
by the way, I am using gzip normally from the command line on my server , I just dont know if there is something else to configure to make it available for php or apache

thanks again
Link to comment
Share on other sites

I think that allows you to compress your website before sending it to a client. Actually decompressing a GZIP file on the server may be different. There's not much more I can say. I suggest that you ask your host.

Link to comment
Share on other sites

thanks for your reply, we asked our host, they say gzip is enabled
I would like to ask how to show the error that $gz->extract() is returning , in that way I could send it to our host and see what they can do.
The AdminTranslations class implements this method

   public function submitImportLang()
   {
       global $currentIndex;

       if (!isset($_FILES['file']['tmp_name']) OR !$_FILES['file']['tmp_name'])
           $this->_errors[] = Tools::displayError('no file selected');
       else
       {
           $gz = new Archive_Tar($_FILES['file']['tmp_name'], true);
           if ($gz->extract(_PS_TRANSLATIONS_DIR_.'../', false))
               Tools::redirectAdmin($currentIndex.'&conf=15&token;='.$this->token);
           $this->_errors[] = Tools::displayError('archive cannot be extracted');
       }
   }



so in the page I can only see the "archive cannot be extracted" error message
what code can I add to this method to show more detailed information about this error

thanks again

Link to comment
Share on other sites

The error message are generated in classes/Archive_Tar.php, but strangely, they aren't displayed. Instead, it says "To be completed". Here's the code on lines 565-579:

// [spam-filter]{ _error()
function _error($p_message)
{
   // ----- To be completed
   $this->raiseError($p_message);
}
// [spam-filter]}

// [spam-filter]{ _warning()
function _warning($p_message)
{
   // ----- To be completed
   $this->raiseError($p_message);
}
// [spam-filter]}



You could try changing this to:

// [spam-filter]{ _error()
function _error($p_message)
{
   echo 'Error: ' . $p_message . '
';
   // ----- To be completed
   $this->raiseError($p_message);
}
// [spam-filter]}

// [spam-filter]{ _warning()
function _warning($p_message)
{
   echo 'Warning: ' . $p_message . '
';
   // ----- To be completed
   $this->raiseError($p_message);
}
// [spam-filter]}



This should display the error messages, unless the page is reloading after they are displayed.

Link to comment
Share on other sites

thanks for the reply !, adding those lines showed the actual errors, since I added a few modules to our store they werent given 777 permision so the translation couldnt complete , now PS imported them with success.

thanks !!

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