Jump to content

Install Language problem: 23%


Recommended Posts

[Thu Oct 15 16:20:50.457460 2015] [:error] [pid 672:tid 1072] [client ::1:59528] script 'C:/Servers/Apache24/htdocs/prestashop/install/sandbox/anything.php' not found or unable to stat, referer: http://localhost/prestashop/install/index.php

Well, that's the error I'm facing when try to install prestashop (1.6.1.0).

 

I really don't understand what's going on, I already install it in other computer. The only thing that's different is that this PC is behind a proxy.

 

The error shown in page is that "was not possible to install "Português (Brazil)" language

 

Apache 2.4 + PHP 5.4

 

 

Any help?

Link to comment
Share on other sites

After some research I found this
 
1- Even I select United States as country, PS Install still looking for 'BR' code.
2- The table ps_lang is empty, so when install process will look for the country, there's nothing there.
 

The error occurrs in "install.php" file at "installLanguages" function and the exact point is in "if (!$id_lang = Language::getIdByIso($iso, true)){."
 

 

Some help?

 

 
write_log function was add by me.

	public function installLanguages($languages_list = null)
	{
		write_log("installLanguages --start");
	
		if ($languages_list == null || !is_array($languages_list) || !count($languages_list))
			$languages_list = $this->language->getIsoList();

		$languages_available = $this->language->getIsoList();
		$languages = array();
		foreach ($languages_list as $iso)
		{
			write_log("installing $iso");
			if (!in_array($iso, $languages_available))
				continue;
			if (!file_exists(_PS_INSTALL_LANGS_PATH_.$iso.'/language.xml'))
				throw new PrestashopInstallerException($this->language->l('File "language.xml" not found for language iso "%s"', $iso));

			if (!$xml = @simplexml_load_file(_PS_INSTALL_LANGS_PATH_.$iso.'/language.xml'))
				throw new PrestashopInstallerException($this->language->l('File "language.xml" not valid for language iso "%s"', $iso));

			$params_lang = array(
				'name' => (string)$xml->name,
				'iso_code' => substr((string)$xml->language_code, 0, 2),
				'allow_accented_chars_url' => (string)$xml->allow_accented_chars_url
			);

			if (InstallSession::getInstance()->safe_mode)
				Language::checkAndAddLanguage($iso, false, true, $params_lang);
			else
				Language::downloadAndInstallLanguagePack($iso, _PS_INSTALL_VERSION_, $params_lang);

			Language::loadLanguages();
			Tools::clearCache();
				write_log("iso=$iso");
			write_log('!$id_lang = Language::getIdByIso($iso, true)');
			if (!$id_lang = Language::getIdByIso($iso, true)){
				write_log("id_lang=$id_lang ;;;; ".'getIdByIso '.Language::getIdByIso($iso, true));
				throw new PrestashopInstallerException($this->language->l('Cannot install language "%s"', ($xml->name) ? $xml->name : $iso));
				}
				
			$languages[$id_lang] = $iso;

			// Copy language flag
			if (is_writable(_PS_IMG_DIR_.'l/'))
				if (!copy(_PS_INSTALL_LANGS_PATH_.$iso.'/flag.jpg', _PS_IMG_DIR_.'l/'.$id_lang.'.jpg'))
					throw new PrestashopInstallerException($this->language->l('Cannot copy flag language "%s"', _PS_INSTALL_LANGS_PATH_.$iso.'/flag.jpg => '._PS_IMG_DIR_.'l/'.$id_lang.'.jpg'));
		}

		return $languages;
	}

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

Finally I got it working!!!!!!!!!

:D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D

 

For those who had same problem change

if (InstallSession::getInstance()->safe_mode)
                Language::checkAndAddLanguage($iso, false, true, $params_lang);
            else
                Language::downloadAndInstallLanguagePack($iso, _PS_INSTALL_VERSION_, $params_lang);

To

//if (InstallSession::getInstance()->safe_mode)
				Language::checkAndAddLanguage($iso, false, true, $params_lang);
			//else
				//Language::downloadAndInstallLanguagePack($iso, _PS_INSTALL_VERSION_, $params_lang);
  • Like 4
  • Thanks 1
Link to comment
Share on other sites

  • 4 years later...
  • 2 months later...
  • 2 weeks later...
On 10/16/2015 at 4:49 PM, lcssanches said:

Finally I got it working!!!!!!!!!

:D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D  :D

 

For those who had same problem change


if (InstallSession::getInstance()->safe_mode)
                Language::checkAndAddLanguage($iso, false, true, $params_lang);
            else
                Language::downloadAndInstallLanguagePack($iso, _PS_INSTALL_VERSION_, $params_lang);

To


//if (InstallSession::getInstance()->safe_mode)
				Language::checkAndAddLanguage($iso, false, true, $params_lang);
			//else
				//Language::downloadAndInstallLanguagePack($iso, _PS_INSTALL_VERSION_, $params_lang);

Where is this file ??

 

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 years later...
On 8/9/2023 at 10:06 AM, danloop said:

I have the same problem with version 8, But the code is different, and the solution doesn't work, someone can help

on presta 17.8.9 is the same. Hosting on Zettahost

Prestashop has the nasty habit of automatically determining your country and language. That is not always helpful as it doesn't include language packs for all options.

I don't know which file would contain the language detection in PS 8.0/8.1. My guess would be /install/classes/controllerHttp.php from line 140-150.

Alternatively you could try to add your language under /install/langs. Just copy from a related language and adapt the texts.

 

Link to comment
Share on other sites

Two other options for the language problem:

 - try installing while behind a VPN. Protonmail offers a free VPN service.

 - sometimes there is a problem that Prestashop ignores your country and language settings at the start.

To understand the latter one should understand the first phases of the installation. Most of the settings that you make on the first pages are stored in hidden HTML form variables in the next page as the database is not yet available. So you can check (and also change!) those settings in the next page.

The problem with the interface is that the "pretty" interface that you see for for example "country" is a javascript construct. When you make a change in that construct that change is not immediately made in the real country field. That field is only changed by a second javascript routine when you submit that page. And it looks like that can go wrong.

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