浏览代码

Remove some more useless dev message translations insight exceptions and alike.

euromark 11 年之前
父节点
当前提交
e7d983911d
共有 5 个文件被更改,包括 9 次插入9 次删除
  1. 1 1
      Controller/Component/CommonComponent.php
  2. 1 1
      Controller/Component/MobileComponent.php
  3. 3 3
      Lib/GeocodeLib.php
  4. 3 3
      Lib/SpellLib.php
  5. 1 1
      View/RssView.php

+ 1 - 1
Controller/Component/CommonComponent.php

@@ -503,7 +503,7 @@ class CommonComponent extends Component {
 	 */
 	 */
 	public function setMeta($type, $content, $prep = true) {
 	public function setMeta($type, $content, $prep = true) {
 		if (!in_array($type, array('title', 'canonical', 'description', 'keywords', 'robots', 'language', 'custom'))) {
 		if (!in_array($type, array('title', 'canonical', 'description', 'keywords', 'robots', 'language', 'custom'))) {
-			trigger_error(__d('tools', 'Meta Type invalid'), E_USER_WARNING);
+			trigger_error(sprintf('Meta Type %s invalid', $type), E_USER_WARNING);
 			return;
 			return;
 		}
 		}
 		if ($type === 'canonical' && $prep) {
 		if ($type === 'canonical' && $prep) {

+ 1 - 1
Controller/Component/MobileComponent.php

@@ -265,7 +265,7 @@ class MobileComponent extends Component {
 			return call_user_func($this->settings['engine']);
 			return call_user_func($this->settings['engine']);
 		}
 		}
 		if (!in_array($this->settings['engine'], array('tools', 'vendor'))) {
 		if (!in_array($this->settings['engine'], array('tools', 'vendor'))) {
-			throw new CakeException(__d('tools', 'Engine %s not available', $this->settings['engine']));
+			throw new CakeException(sprintf('Engine %s not available', $this->settings['engine']));
 		}
 		}
 		return $this->detectByVendor($this->settings['engine']);
 		return $this->detectByVendor($this->settings['engine']);
 	}
 	}

+ 3 - 3
Lib/GeocodeLib.php

@@ -743,7 +743,7 @@ class GeocodeLib {
 		}
 		}
 		$unit = strtoupper($unit);
 		$unit = strtoupper($unit);
 		if (!isset($this->units[$unit])) {
 		if (!isset($this->units[$unit])) {
-			throw new CakeException(__d('tools', 'Invalid Unit: %s', $unit));
+			throw new CakeException(sprintf('Invalid Unit: %s', $unit));
 		}
 		}
 
 
 		$res = $this->calculateDistance($pointX, $pointY);
 		$res = $this->calculateDistance($pointX, $pointY);
@@ -787,7 +787,7 @@ class GeocodeLib {
 	 */
 	 */
 	public function convert($value, $fromUnit, $toUnit) {
 	public function convert($value, $fromUnit, $toUnit) {
 		if (!isset($this->units[($fromUnit = strtoupper($fromUnit))]) || !isset($this->units[($toUnit = strtoupper($toUnit))])) {
 		if (!isset($this->units[($fromUnit = strtoupper($fromUnit))]) || !isset($this->units[($toUnit = strtoupper($toUnit))])) {
-			throw new CakeException(__d('tools', 'Invalid Unit'));
+			throw new CakeException('Invalid Unit');
 		}
 		}
 		if ($fromUnit === 'M') {
 		if ($fromUnit === 'M') {
 			$value *= $this->units[$toUnit];
 			$value *= $this->units[$toUnit];
@@ -832,7 +832,7 @@ class GeocodeLib {
 			case 5:
 			case 5:
 				break;
 				break;
 			default:
 			default:
-				throw new CakeException(__d('tools', 'Invalid level \'%s\'', $level));
+				throw new CakeException(sprintf('Invalid level \'%s\'', $level));
 		}
 		}
 		$scrambleVal = 0.000001 * mt_rand(1000, 2000) * (mt_rand(0, 1) === 0 ? 1 : -1);
 		$scrambleVal = 0.000001 * mt_rand(1000, 2000) * (mt_rand(0, 1) === 0 ? 1 : -1);
 
 

+ 3 - 3
Lib/SpellLib.php

@@ -36,7 +36,7 @@ class SpellLib {
 
 
 	public function __construct($options = array()) {
 	public function __construct($options = array()) {
 		if (!function_exists('enchant_broker_init')) {
 		if (!function_exists('enchant_broker_init')) {
-			throw new InternalErrorException(__d('tools', 'Module %s not installed', 'Enchant'));
+			throw new InternalErrorException(sprintf('Module %s not installed', 'Enchant'));
 		}
 		}
 		$this->_Broker = enchant_broker_init();
 		$this->_Broker = enchant_broker_init();
 
 
@@ -49,13 +49,13 @@ class SpellLib {
 		$options = array_merge($defaults, $options);
 		$options = array_merge($defaults, $options);
 
 
 		if (!isset($this->_engines[$options['engine']])) {
 		if (!isset($this->_engines[$options['engine']])) {
-			throw new InternalErrorException(__d('tools', 'Engine %s not found', (string) $options['engine']));
+			throw new InternalErrorException(sprintf('Engine %s not found', (string) $options['engine']));
 		}
 		}
 		$engineFolder = $this->_engines[$options['engine']];
 		$engineFolder = $this->_engines[$options['engine']];
 		enchant_broker_set_dict_path($this->_Broker, $options['engine'], $options['path'] . $engineFolder . DS);
 		enchant_broker_set_dict_path($this->_Broker, $options['engine'], $options['path'] . $engineFolder . DS);
 
 
 		if (!enchant_broker_dict_exists($this->_Broker, $options['lang'])) {
 		if (!enchant_broker_dict_exists($this->_Broker, $options['lang'])) {
-			throw new InternalErrorException(__d('tools', 'Dictionary %s not found', $options['lang']));
+			throw new InternalErrorException(sprintf('Dictionary %s not found', $options['lang']));
 		}
 		}
 
 
 		$this->_Dict = enchant_broker_request_dict($this->_Broker, $options['lang']);
 		$this->_Dict = enchant_broker_request_dict($this->_Broker, $options['lang']);

+ 1 - 1
View/RssView.php

@@ -219,7 +219,7 @@ class RssView extends View {
 		$namespaces = array();
 		$namespaces = array();
 		foreach ($this->_usedNamespaces as $usedNamespacePrefix) {
 		foreach ($this->_usedNamespaces as $usedNamespacePrefix) {
 			if (!isset($this->_namespaces[$usedNamespacePrefix])) {
 			if (!isset($this->_namespaces[$usedNamespacePrefix])) {
-				throw new RuntimeException(__d('tools', 'The prefix %s is not specified.', $usedNamespacePrefix));
+				throw new RuntimeException(sprintf('The prefix %s is not specified.', $usedNamespacePrefix));
 			}
 			}
 			$namespaces['xmlns:' . $usedNamespacePrefix] = $this->_namespaces[$usedNamespacePrefix];
 			$namespaces['xmlns:' . $usedNamespacePrefix] = $this->_namespaces[$usedNamespacePrefix];
 		}
 		}