[-] Installer: Install only the language choosen in the installer

This commit is contained in:
Rémi Gaillard
2013-03-21 15:17:07 +01:00
parent e00d7e736f
commit 5f2a4f3dea
2 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -237,7 +237,7 @@ class InstallXmlLoader
$default_lang = null;
foreach ($this->languages as $id_lang => $iso)
{
if ($iso == 'en')
if ($iso == $this->language->getLanguageIso())
$default_lang = $id_lang;
try
+7 -4
View File
@@ -176,7 +176,7 @@ class InstallModelInstall extends InstallAbstractModel
// Install languages
try
{
$languages = $this->installLanguages();
$languages = $this->installLanguages(array($this->language->getLanguageIso()));
}
catch (PrestashopInstallerException $e)
{
@@ -197,7 +197,7 @@ class InstallModelInstall extends InstallAbstractModel
public function populateDatabase($entity = null)
{
$languages = array();
foreach (Language::getLanguages(false) as $lang)
foreach (Language::getLanguages(true) as $lang)
$languages[$lang['id_lang']] = $lang['iso_code'];
// Install XML data (data/xml/ folder)
@@ -293,10 +293,13 @@ class InstallModelInstall extends InstallAbstractModel
*
* @return array Association between ID and iso array(id_lang => iso, ...)
*/
public function installLanguages()
public function installLanguages($languages_list = null)
{
if ($languages_list == null || !is_array($languages_list) || !count($languages_list))
$languages_list = $this->language->getIsoList();
$languages = array();
foreach ($this->language->getIsoList() as $iso)
foreach ($languages_list as $iso)
{
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));