Skip to content

Commit

Permalink
update language domains
Browse files Browse the repository at this point in the history
no domain - the thing being translated comes from the app - so let the
user handle that
cake - end user
cake_error - error messages
  • Loading branch information
AD7six committed Mar 19, 2011
1 parent a344759 commit d2badbe
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper.php
Expand Up @@ -124,7 +124,7 @@ public function __construct(View $View, $settings = array()) {
* @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);
}

/**
Expand Down
20 changes: 10 additions & 10 deletions lib/Cake/View/Helper/FormHelper.php
Expand Up @@ -241,12 +241,12 @@ function create($model = null, $options = array()) {
$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'])) {
Expand Down Expand Up @@ -631,7 +631,7 @@ public function inputs($fields = null, $blacklist = null) {
$actionName = __d('cake', 'Edit %s');
}
$modelName = Inflector::humanize(Inflector::underscore($model));
$legend = sprintf($actionName, __d('cake', $modelName));
$legend = sprintf($actionName, __($modelName));
}

$out = null;
Expand Down Expand Up @@ -1058,7 +1058,7 @@ public function radio($fieldName, $options = array(), $attributes = array()) {
$legend = $attributes['legend'];
unset($attributes['legend']);
} elseif (count($options) > 1) {
$legend = __d('cake', Inflector::humanize($this->field()));
$legend = __(Inflector::humanize($this->field()));
}
$label = true;

Expand Down Expand Up @@ -1128,7 +1128,7 @@ public function radio($fieldName, $options = array(), $attributes = array()) {
}

/**
* 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" />`
*
Expand All @@ -1151,7 +1151,7 @@ public function radio($fieldName, $options = array(), $attributes = array()) {
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];
Expand Down Expand Up @@ -1471,7 +1471,7 @@ public function select($fieldName, $options = array(), $attributes = array()) {
$style = null;
$tag = null;
$attributes += array(
'class' => null,
'class' => null,
'escape' => true,
'secure' => null,
'empty' => '',
Expand Down Expand Up @@ -2023,7 +2023,7 @@ protected function _name($options = array(), $field = null, $key = 'name') {
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);
Expand Down Expand Up @@ -2226,7 +2226,7 @@ protected function _initInputField($field, $options = array()) {
} else {
$secure = (isset($this->request['_Token']) && !empty($this->request['_Token']));
}

$fieldName = null;
if ($secure && !empty($options['name'])) {
preg_match_all('/\[(.*?)\]/', $options['name'], $matches);
Expand All @@ -2242,4 +2242,4 @@ protected function _initInputField($field, $options = array()) {
}
return $result;
}
}
}
4 changes: 2 additions & 2 deletions lib/Cake/View/Helper/HtmlHelper.php
Expand Up @@ -940,13 +940,13 @@ public function loadConfig($configFile, $path = CONFIGS) {
$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);
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/JsHelper.php
Expand Up @@ -153,7 +153,7 @@ public function __call($method, $params) {
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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/MootoolsEngineHelper.php
Expand Up @@ -307,7 +307,7 @@ function drag($options = array()) {
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;
}
Expand Down
8 changes: 4 additions & 4 deletions lib/Cake/View/Helper/NumberHelper.php
Expand Up @@ -164,7 +164,7 @@ public function format($number, $options = false) {
* ### 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
Expand Down Expand Up @@ -215,7 +215,7 @@ public function currency($number, $currency = 'USD', $options = array()) {
}
}

$position = $options[$symbolKey.'Position'] != 'after' ? 'before' : 'after';
$position = $options[$symbolKey.'Position'] != 'after' ? 'before' : 'after';
$options[$position] = $options[$symbolKey.'Symbol'];

$abs = abs($number);
Expand All @@ -236,7 +236,7 @@ public function currency($number, $currency = 'USD', $options = array()) {
* 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'); }}}
Expand All @@ -259,4 +259,4 @@ public function addFormat($formatName, $options) {
$this->_currencies[$formatName] = $options + $this->_currencyDefaults;
}

}
}
14 changes: 7 additions & 7 deletions lib/Cake/View/Helper/PaginatorHelper.php
Expand Up @@ -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'.
Expand Down Expand Up @@ -102,7 +102,7 @@ function __construct(View $View, $settings = array()) {
$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);
Expand Down Expand Up @@ -306,15 +306,15 @@ public function sort($key, $title = null, $options = array()) {

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']);

$sortKey = $this->sortKey($options['model']);
$defaultModel = $this->defaultModel();
$isSorted = (
$sortKey === $key ||
$sortKey === $key ||
$sortKey === $defaultModel . '.' . $key ||
$key === $defaultModel . '.' . $sortKey
);
Expand Down Expand Up @@ -603,12 +603,12 @@ public function counter($options = array()) {

/**
* 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
*
Expand Down Expand Up @@ -862,4 +862,4 @@ public function last($last = 'last >>', $options = array()) {
}
return $out;
}
}
}
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/TimeHelper.php
Expand Up @@ -752,4 +752,4 @@ public function i18nFormat($date, $format = null, $invalid = false, $userOffset
$format = $this->convertSpecifiers($format, $date);
return strftime($format, $date);
}
}
}
4 changes: 2 additions & 2 deletions lib/Cake/View/View.php
Expand Up @@ -396,7 +396,7 @@ public function render($view = null, $layout = null) {
$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);
Expand Down Expand Up @@ -439,7 +439,7 @@ public function renderLayout($content_for_layout, $layout = null) {
$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));
Expand Down

0 comments on commit d2badbe

Please sign in to comment.