浏览代码

Revert some of the non literal translations for easier BC and DRYer code.

euromark 11 年之前
父节点
当前提交
ef837ee078
共有 4 个文件被更改,包括 22 次插入25 次删除
  1. 6 17
      Lib/EmailLib.php
  2. 3 2
      View/Helper/CommonHelper.php
  3. 1 0
      View/Helper/FormExtHelper.php
  4. 12 6
      View/Helper/FormatHelper.php

+ 6 - 17
Lib/EmailLib.php

@@ -4,10 +4,6 @@ App::uses('CakeLog', 'Log');
 App::uses('Utility', 'Tools.Utility');
 App::uses('MimeLib', 'Tools.Lib');
 
-if (!defined('BR')) {
-	define('BR', '<br />');
-}
-
 // Support BC (snake case config)
 if (!Configure::read('Config.systemEmail')) {
 	Configure::write('Config.systemEmail', Configure::read('Config.system_email'));
@@ -636,19 +632,12 @@ class EmailLib extends CakeEmail {
 	 *
 	 * @return void
 	 */
-	public function resetAndSet() {
-		$this->_to = array();
-		$this->_cc = array();
-		$this->_bcc = array();
-		$this->_messageId = true;
-		$this->_subject = '';
-		$this->_headers = array();
-		$this->_viewVars = array();
-		$this->_textMessage = '';
-		$this->_htmlMessage = '';
-		$this->_message = '';
-		$this->_attachments = array();
+	public function reset() {
+		parent::reset();
+		$this->_priority = null;
+		$this->_wrapLength = null;
 
+		$this->_log = null;
 		$this->_error = null;
 		$this->_debug = null;
 
@@ -659,7 +648,7 @@ class EmailLib extends CakeEmail {
 			$fromName = Configure::read('Config.adminName');
 		}
 		if (!$fromEmail) {
-			throw new RuntimeException('You need to either define systemEmail or adminEmail in Config.');
+			throw new RuntimeException('You need to either define Config.systemEmail or Config.adminEmail in Configure.');
 		}
 		$this->from($fromEmail, $fromName);
 

+ 3 - 2
View/Helper/CommonHelper.php

@@ -208,7 +208,8 @@ class CommonHelper extends AppHelper {
 
 	/**
 	 * Manual pluralizing a word using the Inflection class
-	 * //TODO: move to lib or bootstrap
+	 *
+	 * I18n will be done using default domain.
 	 *
 	 * @param string $singular
 	 * @param string $plural
@@ -223,7 +224,7 @@ class CommonHelper extends AppHelper {
 		}
 
 		if ($autoTranslate) {
-			$result = __d('tools', $result);
+			$result = __($result);
 		}
 		return $result;
 	}

+ 1 - 0
View/Helper/FormExtHelper.php

@@ -925,6 +925,7 @@ class FormExtHelper extends FormHelper {
 	/**
 	 * MaxLength js for textarea input
 	 * final output
+	 *
 	 * @param array $selectors with specific settings
 	 * @param array $globalOptions
 	 * @return string with JS code

+ 12 - 6
View/Helper/FormatHelper.php

@@ -340,7 +340,9 @@ class FormatHelper extends TextHelper {
 	}
 
 	/**
-	 * Quick way of printing default icons
+	 * Quick way of printing default icons.
+	 *
+	 * I18n will be done using default domain.
 	 *
 	 * @todo refactor to $type, $options, $attributes
 	 *
@@ -370,8 +372,8 @@ class FormatHelper extends TextHelper {
 				$title = (isset($title) ? $title : $this->icons[$type]['title']);
 				$alt = (isset($alt) ? $alt : preg_replace('/[^a-zA-Z0-9]/', '', $this->icons[$type]['title']));
 				if ($translate !== false) {
-					$title = __d('tools', $title);
-					$alt = __d('tools', $alt);
+					$title = __($title);
+					$alt = __($alt);
 				}
 				$alt = '[' . $alt . ']';
 			} else {
@@ -391,6 +393,8 @@ class FormatHelper extends TextHelper {
 	/**
 	 * Custom Icons
 	 *
+	 * I18n will be done using default domain.
+	 *
 	 * @param string $icon (constant or filename)
 	 * @param array $options:
 	 * - translate, ...
@@ -413,8 +417,8 @@ class FormatHelper extends TextHelper {
 			$title = isset($t) ? $t : ucfirst($type);
 			$alt = (isset($a) ? $a : Inflector::slug($title, '-'));
 			if ($translate !== false) {
-				$title = __d('tools', $title);
-				$alt = __d('tools', $alt);
+				$title = __($title);
+				$alt = __($alt);
 			}
 			$alt = '[' . $alt . ']';
 
@@ -434,6 +438,8 @@ class FormatHelper extends TextHelper {
 	/**
 	 * FormatHelper::_fontIcon()
 	 *
+	 * I18n will be done using default domain.
+	 *
 	 * @param string $type
 	 * @param array $options
 	 * @return string
@@ -449,7 +455,7 @@ class FormatHelper extends TextHelper {
 		if (!isset($options['title'])) {
 			$options['title'] = ucfirst($type);
 			if ($options['translate'] !== false) {
-				$options['title'] = __d('tools', $options['title']);
+				$options['title'] = __($options['title']);
 			}
 		}