[-] BO : fix #PSCFV-2480 : fix translations

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15615 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2012-05-22 12:42:58 +00:00
parent 15a0234612
commit 4708c70a35
7 changed files with 27 additions and 28 deletions
+6 -6
View File
@@ -177,13 +177,13 @@ class TranslateCore
if ($_MODULES == null)
return str_replace('"', '"', $string);
$currentKey = strtolower('<{'.$name.'}'._THEME_NAME_.'>'.$source).'_'.$key;
$defaultKey = strtolower('<{'.$name.'}prestashop>'.$source).'_'.$key;
$current_key = strtolower('<{'.$name.'}'._THEME_NAME_.'>'.$source).'_'.$key;
$default_key = strtolower('<{'.$name.'}prestashop>'.$source).'_'.$key;
if (isset($_MODULES[$currentKey]))
$ret = stripslashes($_MODULES[$currentKey]);
elseif (isset($_MODULES[$defaultKey]))
$ret = stripslashes($_MODULES[$defaultKey]);
if (isset($_MODULES[$current_key]))
$ret = stripslashes($_MODULES[$current_key]);
elseif (isset($_MODULES[$default_key]))
$ret = stripslashes($_MODULES[$default_key]);
// if translation was not found in module, look for it in AdminController or Helpers
elseif (!empty($_LANGADM))
$ret = Translate::getGenericAdminTranslation($string, $key, $_LANGADM);
+1 -1
View File
@@ -45,7 +45,7 @@ class DbMySQLiCore extends Db
// Do not use object way for error because this work bad before PHP 5.2.9
if (mysqli_connect_error())
throw new PrestaShopDatabaseException(Tools::displayError('Link to database cannot be established : '.mysqli_connect_error()));
throw new PrestaShopDatabaseException(sprintf(Tools::displayError('Link to database cannot be established: %s'), mysqli_connect_error()));
// UTF-8 support
if (!$this->link->query('SET NAMES \'utf8\''))
+1 -1
View File
@@ -52,7 +52,7 @@ class DbPDOCore extends Db
}
catch (PDOException $e)
{
throw new PrestaShopDatabaseException(Tools::displayError('Link to database cannot be established. ('.$e->getMessage().')'));
throw new PrestaShopDatabaseException(sprintf(Tools::displayError('Link to database cannot be established: %s'), $e->getMessage()));
}
// UTF-8 support
+2 -2
View File
@@ -42,12 +42,12 @@ abstract class StockManagerModuleCore extends Module
$class_file = _PS_MODULE_DIR_.'/'.$this->name.'/'.$this->stock_manager_class.'.php';
if (!isset($this->stock_manager_class) || !file_exists($class_file))
die(Tools::displayError('Incorrect Stock Manager class ['.$this->stock_manager_class.']'));
die(sprintf(Tools::displayError('Incorrect Stock Manager class [%s]'), $this->stock_manager_class));
require_once($class_file);
if (!class_exists($this->stock_manager_class))
die(Tools::displayError('Stock Manager class not found ['.$this->stock_manager_class.']'));
die(sprintf(Tools::displayError('Stock Manager class not found [%s]'), $this->stock_manager_class));
$class = $this->stock_manager_class;
if (call_user_func(array($class, 'isAvailable')))
+3 -4
View File
@@ -39,12 +39,12 @@ abstract class TaxManagerModuleCore extends Module
$class_file = _PS_MODULE_DIR_.'/'.$this->name.'/'.$this->tax_manager_class.'.php';
if (!isset($this->tax_manager_class) || !file_exists($class_file))
die(Tools::displayError('Incorrect Tax Manager class ['.$this->tax_manager_class.']'));
die(sprintf(Tools::displayError('Incorrect Tax Manager class [%s]'), $this->tax_manager_class));
require_once($class_file);
if (!class_exists($this->tax_manager_class))
die(Tools::displayError('Tax Manager class not found ['.$this->tax_manager_class.']'));
die(sprintf(Tools::displayError('Tax Manager class not found [%s]'), $this->tax_manager_class));
$class = $this->tax_manager_class;
if (call_user_func(array($class, 'isAvailableForThisAddress'), $args['address']))
@@ -52,5 +52,4 @@ abstract class TaxManagerModuleCore extends Module
return false;
}
}
}