Browse Source

update language domains

no domain - the thing being translated comes from the app - so let the
user handle that
cake - end user
cake_error - error messages
AD7six 15 years ago
parent
commit
d2badbeb22

+ 1 - 1
lib/Cake/View/Helper.php

@@ -124,7 +124,7 @@ class Helper extends Object {
  * @param array $params Array of params for the method.
  */
 	public function __call($method, $params) {
-		trigger_error(__d('cake', 'Method %1$s::%2$s does not exist', get_class($this), $method), E_USER_WARNING);
+		trigger_error(__d('cake_error', 'Method %1$s::%2$s does not exist', get_class($this), $method), E_USER_WARNING);
 	}
 
 /**

+ 10 - 10
lib/Cake/View/Helper/FormHelper.php

@@ -241,12 +241,12 @@ class FormHelper extends AppHelper {
 		$options);
 		$this->_inputDefaults = $options['inputDefaults'];
 		unset($options['inputDefaults']);
-		
+
 		if (!isset($options['id'])) {
 			$domId = isset($options['action']) ? $options['action'] : $this->request['action'];
 			$options['id'] = $this->domId($domId . 'Form');
 		}
-		
+
 		if ($options['action'] === null && $options['url'] === null) {
 			$options['action'] = $this->request->here(false);
 		} elseif (empty($options['url']) || is_array($options['url'])) {
@@ -631,7 +631,7 @@ class FormHelper extends AppHelper {
 				$actionName = __d('cake', 'Edit %s');
 			}
 			$modelName = Inflector::humanize(Inflector::underscore($model));
-			$legend = sprintf($actionName, __d('cake', $modelName));
+			$legend = sprintf($actionName, __($modelName));
 		}
 
 		$out = null;
@@ -1058,7 +1058,7 @@ class FormHelper extends AppHelper {
 			$legend = $attributes['legend'];
 			unset($attributes['legend']);
 		} elseif (count($options) > 1) {
-			$legend = __d('cake', Inflector::humanize($this->field()));
+			$legend = __(Inflector::humanize($this->field()));
 		}
 		$label = true;
 
@@ -1128,7 +1128,7 @@ class FormHelper extends AppHelper {
 	}
 
 /**
- * Missing method handler - implements various simple input types. Is used to create inputs 
+ * Missing method handler - implements various simple input types. Is used to create inputs
  * of various types.  e.g. `$this->Form->text();` will create `<input type="text" />` while
  * `$this->Form->range();` will create `<input type="range" />`
  *
@@ -1151,7 +1151,7 @@ class FormHelper extends AppHelper {
 	public function __call($method, $params) {
 		$options = array();
 		if (empty($params)) {
-			throw new CakeException(__d('cake', 'Missing field name for FormHelper::%s', $method));
+			throw new CakeException(__d('cake_error', 'Missing field name for FormHelper::%s', $method));
 		}
 		if (isset($params[1])) {
 			$options = $params[1];
@@ -1471,7 +1471,7 @@ class FormHelper extends AppHelper {
 		$style = null;
 		$tag = null;
 		$attributes += array(
-			'class' => null, 
+			'class' => null,
 			'escape' => true,
 			'secure' => null,
 			'empty' => '',
@@ -2023,7 +2023,7 @@ class FormHelper extends AppHelper {
 	function __selectOptions($elements = array(), $parents = array(), $showParents = null, $attributes = array()) {
 		$select = array();
 		$attributes = array_merge(
-			array('escape' => true, 'style' => null, 'value' => null, 'class' => null), 
+			array('escape' => true, 'style' => null, 'value' => null, 'class' => null),
 			$attributes
 		);
 		$selectedIsEmpty = ($attributes['value'] === '' || $attributes['value'] === null);
@@ -2226,7 +2226,7 @@ class FormHelper extends AppHelper {
 		} else {
 			$secure = (isset($this->request['_Token']) && !empty($this->request['_Token']));
 		}
-		
+
 		$fieldName = null;
 		if ($secure && !empty($options['name'])) {
 			preg_match_all('/\[(.*?)\]/', $options['name'], $matches);
@@ -2242,4 +2242,4 @@ class FormHelper extends AppHelper {
 		}
 		return $result;
 	}
-}
+}

+ 2 - 2
lib/Cake/View/Helper/HtmlHelper.php

@@ -940,13 +940,13 @@ class HtmlHelper extends AppHelper {
 				$reader = $configFile[1];
 			}
 		} else {
-			throw new ConfigureException(__d('cake', 'Cannot load the configuration file. Wrong "configFile" configuration.'));
+			throw new ConfigureException(__d('cake_error', 'Cannot load the configuration file. Wrong "configFile" configuration.'));
 		}
 
 		$readerClass = Inflector::camelize($reader) . 'Reader';
 		App::uses($readerClass, 'Configure');
 		if (!class_exists($readerClass)) {
-			throw new ConfigureException(__d('cake', 'Cannot load the configuration file. Unknown reader.'));
+			throw new ConfigureException(__d('cake_error', 'Cannot load the configuration file. Unknown reader.'));
 		}
 
 		$readerObj = new $readerClass($path);

+ 1 - 1
lib/Cake/View/Helper/JsHelper.php

@@ -153,7 +153,7 @@ class JsHelper extends AppHelper {
 		if (method_exists($this, $method . '_')) {
 			return call_user_func(array(&$this, $method . '_'), $params);
 		}
-		trigger_error(__d('cake', 'JsHelper:: Missing Method %s is undefined', $method), E_USER_WARNING);
+		trigger_error(__d('cake_error', 'JsHelper:: Missing Method %s is undefined', $method), E_USER_WARNING);
 	}
 
 /**

+ 1 - 1
lib/Cake/View/Helper/MootoolsEngineHelper.php

@@ -307,7 +307,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
 	function drop($options = array()) {
 		if (empty($options['drag'])) {
 			trigger_error(
-				__d('cake', 'MootoolsEngine::drop() requires a "drag" option to properly function'), E_USER_WARNING
+				__d('cake_error', 'MootoolsEngine::drop() requires a "drag" option to properly function'), E_USER_WARNING
 			);
 			return false;
 		}

+ 4 - 4
lib/Cake/View/Helper/NumberHelper.php

@@ -164,7 +164,7 @@ class NumberHelper extends AppHelper {
  * ### Options
  *
  * - `before` - The currency symbol to place before whole numbers ie. '$'
- * - `after` - The currency symbol to place after decimal numbers ie. 'c'. Set to boolean false to 
+ * - `after` - The currency symbol to place after decimal numbers ie. 'c'. Set to boolean false to
  *    use no decimal symbol.  eg. 0.35 => $0.35.
  * - `zero` - The text to use for zero values, can be a string or a number. ie. 0, 'Free!'
  * - `places` - Number of decimal places to use. ie. 2
@@ -215,7 +215,7 @@ class NumberHelper extends AppHelper {
 			}
 		}
 
-		$position = $options[$symbolKey.'Position'] != 'after' ? 'before' : 'after';		
+		$position = $options[$symbolKey.'Position'] != 'after' ? 'before' : 'after';
 		$options[$position] = $options[$symbolKey.'Symbol'];
 
 		$abs = abs($number);
@@ -236,7 +236,7 @@ class NumberHelper extends AppHelper {
  * currency formats easier.
  *
  * {{{ $number->addFormat('NOK', array('before' => 'Kr. ')); }}}
- * 
+ *
  * You can now use `NOK` as a shortform when formatting currency amounts.
  *
  * {{{ $number->currency($value, 'NOK'); }}}
@@ -259,4 +259,4 @@ class NumberHelper extends AppHelper {
 		$this->_currencies[$formatName] = $options + $this->_currencyDefaults;
 	}
 
-}
+}

+ 7 - 7
lib/Cake/View/Helper/PaginatorHelper.php

@@ -69,7 +69,7 @@ class PaginatorHelper extends AppHelper {
  * - `escape` Defines if the title field for the link should be escaped (default: true).
  * - `update` DOM id of the element updated with the results of the AJAX call.
  *     If this key isn't specified Paginator will use plain HTML links.
- * - `paging['paramType']` The type of parameters to use when creating links.  Valid options are 
+ * - `paging['paramType']` The type of parameters to use when creating links.  Valid options are
  *     'querystring', 'named', and 'route'.  See PaginatorComponent::$settings for more information.
  * - `convertKeys` - A list of keys in url arrays that should be converted to querysting params
  *    if paramType == 'querystring'.
@@ -102,7 +102,7 @@ class PaginatorHelper extends AppHelper {
 		$classname = $ajaxProvider . 'Helper';
 		if (!method_exists($classname, 'link')) {
 			throw new CakeException(sprintf(
-				__d('cake', '%s does not implement a link() method, it is incompatible with PaginatorHelper'), $classname
+				__d('cake_error', '%s does not implement a link() method, it is incompatible with PaginatorHelper'), $classname
 			));
 		}
 		parent::__construct($View, $settings);
@@ -306,7 +306,7 @@ class PaginatorHelper extends AppHelper {
 
 		if (empty($title)) {
 			$title = $key;
-			$title = __d('cake', Inflector::humanize(preg_replace('/_id$/', '', $title)));
+			$title = __(Inflector::humanize(preg_replace('/_id$/', '', $title)));
 		}
 		$dir = isset($options['direction']) ? $options['direction'] : 'asc';
 		unset($options['direction']);
@@ -314,7 +314,7 @@ class PaginatorHelper extends AppHelper {
 		$sortKey = $this->sortKey($options['model']);
 		$defaultModel = $this->defaultModel();
 		$isSorted = (
-			$sortKey === $key || 
+			$sortKey === $key ||
 			$sortKey === $defaultModel . '.' . $key ||
 			$key === $defaultModel . '.' . $sortKey
 		);
@@ -603,12 +603,12 @@ class PaginatorHelper extends AppHelper {
 
 /**
  * Returns a set of numbers for the paged result set
- * uses a modulus to decide how many numbers to show on each side of the current page (default: 8). 
+ * uses a modulus to decide how many numbers to show on each side of the current page (default: 8).
  *
  * `$this->Paginator->numbers(array('first' => 2, 'last' => 2));`
  *
  * Using the first and last options you can create links to the beginning and end of the page set.
- * 
+ *
  *
  * ### Options
  *
@@ -862,4 +862,4 @@ class PaginatorHelper extends AppHelper {
 		}
 		return $out;
 	}
-}
+}

+ 1 - 1
lib/Cake/View/Helper/TimeHelper.php

@@ -752,4 +752,4 @@ class TimeHelper extends AppHelper {
 		$format = $this->convertSpecifiers($format, $date);
 		return strftime($format, $date);
 	}
-}
+}

+ 2 - 2
lib/Cake/View/View.php

@@ -396,7 +396,7 @@ class View extends Object {
 			$layout = $this->layout;
 		}
 		if ($this->output === false) {
-			throw new CakeException(__d('cake', "Error in view %s, got no content.", $viewFileName));
+			throw new CakeException(__d('cake_error', "Error in view %s, got no content.", $viewFileName));
 		}
 		if ($layout && $this->autoLayout) {
 			$this->output = $this->renderLayout($this->output, $layout);
@@ -439,7 +439,7 @@ class View extends Object {
 		$this->output = $this->_render($layoutFileName);
 
 		if ($this->output === false) {
-			throw new CakeException(__d('cake', "Error in layout %s, got no content.", $layoutFileName));
+			throw new CakeException(__d('cake_error', "Error in layout %s, got no content.", $layoutFileName));
 		}
 
 		$this->Helpers->trigger('afterLayout', array($layoutFileName));