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
This commit is contained in:
AD7six 2011-03-19 18:29:31 +01:00
parent a3447592d5
commit d2badbeb22
9 changed files with 29 additions and 29 deletions

View file

@ -124,7 +124,7 @@ class Helper extends Object {
* @param array $params Array of params for the method. * @param array $params Array of params for the method.
*/ */
public function __call($method, $params) { 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);
} }
/** /**

View file

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

View file

@ -940,13 +940,13 @@ class HtmlHelper extends AppHelper {
$reader = $configFile[1]; $reader = $configFile[1];
} }
} else { } 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'; $readerClass = Inflector::camelize($reader) . 'Reader';
App::uses($readerClass, 'Configure'); App::uses($readerClass, 'Configure');
if (!class_exists($readerClass)) { 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); $readerObj = new $readerClass($path);

View file

@ -153,7 +153,7 @@ class JsHelper extends AppHelper {
if (method_exists($this, $method . '_')) { if (method_exists($this, $method . '_')) {
return call_user_func(array(&$this, $method . '_'), $params); 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);
} }
/** /**

View file

@ -307,7 +307,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
function drop($options = array()) { function drop($options = array()) {
if (empty($options['drag'])) { if (empty($options['drag'])) {
trigger_error( 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; return false;
} }

View file

@ -164,7 +164,7 @@ class NumberHelper extends AppHelper {
* ### Options * ### Options
* *
* - `before` - The currency symbol to place before whole numbers ie. '$' * - `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. * 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!' * - `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 * - `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']; $options[$position] = $options[$symbolKey.'Symbol'];
$abs = abs($number); $abs = abs($number);
@ -236,7 +236,7 @@ class NumberHelper extends AppHelper {
* currency formats easier. * currency formats easier.
* *
* {{{ $number->addFormat('NOK', array('before' => 'Kr. ')); }}} * {{{ $number->addFormat('NOK', array('before' => 'Kr. ')); }}}
* *
* You can now use `NOK` as a shortform when formatting currency amounts. * You can now use `NOK` as a shortform when formatting currency amounts.
* *
* {{{ $number->currency($value, 'NOK'); }}} * {{{ $number->currency($value, 'NOK'); }}}
@ -259,4 +259,4 @@ class NumberHelper extends AppHelper {
$this->_currencies[$formatName] = $options + $this->_currencyDefaults; $this->_currencies[$formatName] = $options + $this->_currencyDefaults;
} }
} }

View file

@ -69,7 +69,7 @@ class PaginatorHelper extends AppHelper {
* - `escape` Defines if the title field for the link should be escaped (default: true). * - `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. * - `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. * 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. * '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 * - `convertKeys` - A list of keys in url arrays that should be converted to querysting params
* if paramType == 'querystring'. * if paramType == 'querystring'.
@ -102,7 +102,7 @@ class PaginatorHelper extends AppHelper {
$classname = $ajaxProvider . 'Helper'; $classname = $ajaxProvider . 'Helper';
if (!method_exists($classname, 'link')) { if (!method_exists($classname, 'link')) {
throw new CakeException(sprintf( 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); parent::__construct($View, $settings);
@ -306,7 +306,7 @@ class PaginatorHelper extends AppHelper {
if (empty($title)) { if (empty($title)) {
$title = $key; $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'; $dir = isset($options['direction']) ? $options['direction'] : 'asc';
unset($options['direction']); unset($options['direction']);
@ -314,7 +314,7 @@ class PaginatorHelper extends AppHelper {
$sortKey = $this->sortKey($options['model']); $sortKey = $this->sortKey($options['model']);
$defaultModel = $this->defaultModel(); $defaultModel = $this->defaultModel();
$isSorted = ( $isSorted = (
$sortKey === $key || $sortKey === $key ||
$sortKey === $defaultModel . '.' . $key || $sortKey === $defaultModel . '.' . $key ||
$key === $defaultModel . '.' . $sortKey $key === $defaultModel . '.' . $sortKey
); );
@ -603,12 +603,12 @@ class PaginatorHelper extends AppHelper {
/** /**
* Returns a set of numbers for the paged result set * 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));` * `$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. * Using the first and last options you can create links to the beginning and end of the page set.
* *
* *
* ### Options * ### Options
* *
@ -862,4 +862,4 @@ class PaginatorHelper extends AppHelper {
} }
return $out; return $out;
} }
} }

View file

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

View file

@ -396,7 +396,7 @@ class View extends Object {
$layout = $this->layout; $layout = $this->layout;
} }
if ($this->output === false) { 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) { if ($layout && $this->autoLayout) {
$this->output = $this->renderLayout($this->output, $layout); $this->output = $this->renderLayout($this->output, $layout);
@ -439,7 +439,7 @@ class View extends Object {
$this->output = $this->_render($layoutFileName); $this->output = $this->_render($layoutFileName);
if ($this->output === false) { 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)); $this->Helpers->trigger('afterLayout', array($layoutFileName));