diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php index 9a0ee93bc..f099cd3ce 100644 --- a/lib/Cake/Controller/Component/AuthComponent.php +++ b/lib/Cake/Controller/Component/AuthComponent.php @@ -345,7 +345,7 @@ class AuthComponent extends Component { protected function _setDefaults() { $defaults = array( 'logoutRedirect' => $this->loginAction, - 'authError' => __d('cake_dev', 'You are not authorized to access that location.') + 'authError' => __d('cake', 'You are not authorized to access that location.') ); foreach ($defaults as $key => $value) { if (empty($this->{$key})) { diff --git a/lib/Cake/Controller/Scaffold.php b/lib/Cake/Controller/Scaffold.php index 14a1f20c9..261e36534 100644 --- a/lib/Cake/Controller/Scaffold.php +++ b/lib/Cake/Controller/Scaffold.php @@ -125,7 +125,7 @@ class Scaffold { $this->ScaffoldModel = $this->controller->{$this->modelClass}; $this->scaffoldTitle = Inflector::humanize(Inflector::underscore($this->viewPath)); $this->scaffoldActions = $controller->scaffold; - $title_for_layout = __d('cake_dev', 'Scaffold :: ') . Inflector::humanize($request->action) . ' :: ' . $this->scaffoldTitle; + $title_for_layout = __d('cake', 'Scaffold :: ') . Inflector::humanize($request->action) . ' :: ' . $this->scaffoldTitle; $modelClass = $this->controller->modelClass; $primaryKey = $this->ScaffoldModel->primaryKey; $displayField = $this->ScaffoldModel->displayField; @@ -163,7 +163,7 @@ class Scaffold { $this->ScaffoldModel->id = $request->params['pass'][0]; } if (!$this->ScaffoldModel->exists()) { - throw new NotFoundException(__d('cake_dev', 'Invalid %s', Inflector::humanize($this->modelKey))); + throw new NotFoundException(__d('cake', 'Invalid %s', Inflector::humanize($this->modelKey))); } $this->ScaffoldModel->recursive = 1; $this->controller->request->data = $this->ScaffoldModel->read(); @@ -218,10 +218,10 @@ class Scaffold { */ protected function _scaffoldSave(CakeRequest $request, $action = 'edit') { $formAction = 'edit'; - $success = __d('cake_dev', 'updated'); + $success = __d('cake', 'updated'); if ($action === 'add') { $formAction = 'add'; - $success = __d('cake_dev', 'saved'); + $success = __d('cake', 'saved'); } if ($this->controller->beforeScaffold($action)) { @@ -230,7 +230,7 @@ class Scaffold { $this->ScaffoldModel->id = $request['pass'][0]; } if (!$this->ScaffoldModel->exists()) { - throw new NotFoundException(__d('cake_dev', 'Invalid %s', Inflector::humanize($this->modelKey))); + throw new NotFoundException(__d('cake', 'Invalid %s', Inflector::humanize($this->modelKey))); } } @@ -241,7 +241,7 @@ class Scaffold { if ($this->ScaffoldModel->save($request->data)) { if ($this->controller->afterScaffoldSave($action)) { - $message = __d('cake_dev', + $message = __d('cake', 'The %1$s has been %2$s', Inflector::humanize($this->modelKey), $success @@ -252,7 +252,7 @@ class Scaffold { } } else { if ($this->_validSession) { - $this->controller->Session->setFlash(__d('cake_dev', 'Please correct errors below.')); + $this->controller->Session->setFlash(__d('cake', 'Please correct errors below.')); } } } @@ -300,13 +300,13 @@ class Scaffold { } $this->ScaffoldModel->id = $id; if (!$this->ScaffoldModel->exists()) { - throw new NotFoundException(__d('cake_dev', 'Invalid %s', Inflector::humanize($this->modelClass))); + throw new NotFoundException(__d('cake', 'Invalid %s', Inflector::humanize($this->modelClass))); } if ($this->ScaffoldModel->delete()) { - $message = __d('cake_dev', 'The %1$s with id: %2$d has been deleted.', Inflector::humanize($this->modelClass), $id); + $message = __d('cake', 'The %1$s with id: %2$d has been deleted.', Inflector::humanize($this->modelClass), $id); return $this->_sendMessage($message); } else { - $message = __d('cake_dev', + $message = __d('cake', 'There was an error deleting the %1$s with id: %2$d', Inflector::humanize($this->modelClass), $id diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php index 633c49913..58a410d26 100644 --- a/lib/Cake/Error/ExceptionRenderer.php +++ b/lib/Cake/Error/ExceptionRenderer.php @@ -204,7 +204,7 @@ class ExceptionRenderer { public function error400($error) { $message = $error->getMessage(); if (Configure::read('debug') == 0 && $error instanceof CakeException) { - $message = __('Not Found'); + $message = __d('cake', 'Not Found'); } $url = $this->controller->request->here(); $this->controller->response->statusCode($error->getCode()); @@ -227,7 +227,7 @@ class ExceptionRenderer { $code = ($error->getCode() > 500 && $error->getCode() < 506) ? $error->getCode() : 500; $this->controller->response->statusCode($code); $this->controller->set(array( - 'name' => __('An Internal Error Has Occurred'), + 'name' => __d('cake', 'An Internal Error Has Occurred'), 'message' => h($url), 'error' => $error, )); diff --git a/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp b/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp index 95d651579..f4b3df987 100644 --- a/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp +++ b/lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp @@ -20,11 +20,11 @@ @@ -33,12 +33,12 @@
' . $settings['engine']; - echo __(' is being used to cache, to change this edit config/core.php '); + echo __d('cake', ' is being used to cache, to change this edit config/core.php '); echo '
'; echo 'Settings:'; - echo __('Rename config/database.php.default to config/database.php'); + echo __d('cake', 'Rename config/database.php.default to config/database.php'); endif; ?> @@ -82,60 +82,60 @@ if (!empty($filePresent)): ?>
- isConnected()): - __(' is able to '); + __d('cake', ' is able to '); else: - __(' is NOT able to '); + __d('cake', ' is NOT able to '); endif; - __('connect to the database.'); + __d('cake', 'connect to the database.'); ?>
- - - + + + - + - +- +
- +
- : + : '{$url}'" ); ?>
diff --git a/lib/Cake/View/Errors/error500.ctp b/lib/Cake/View/Errors/error500.ctp index be2bfabd7..6c500aa73 100644 --- a/lib/Cake/View/Errors/error500.ctp +++ b/lib/Cake/View/Errors/error500.ctp @@ -18,8 +18,8 @@ ?>- : - + : +
0 ): diff --git a/lib/Cake/View/Helper/FormHelper.php b/lib/Cake/View/Helper/FormHelper.php index 7e1bd8524..b38aab46e 100644 --- a/lib/Cake/View/Helper/FormHelper.php +++ b/lib/Cake/View/Helper/FormHelper.php @@ -683,7 +683,7 @@ class FormHelper extends AppHelper { if (is_array($error)) { foreach ($error as &$e) { if (is_numeric($e)) { - $e = __('Error in field %s', Inflector::humanize($this->field())); + $e = __d('cake', 'Error in field %s', Inflector::humanize($this->field())); } } } @@ -821,13 +821,13 @@ class FormHelper extends AppHelper { } if ($legend === true) { - $actionName = __('New %s'); + $actionName = __d('cake', 'New %s'); $isEdit = ( strpos($this->request->params['action'], 'update') !== false || strpos($this->request->params['action'], 'edit') !== false ); if ($isEdit) { - $actionName = __('Edit %s'); + $actionName = __d('cake', 'Edit %s'); } $modelName = Inflector::humanize(Inflector::underscore($model)); $legend = sprintf($actionName, __($modelName)); @@ -1582,7 +1582,7 @@ class FormHelper extends AppHelper { */ public function submit($caption = null, $options = array()) { if (!is_string($caption) && empty($caption)) { - $caption = __('Submit'); + $caption = __d('cake', 'Submit'); } $out = null; $div = true; @@ -2435,18 +2435,18 @@ class FormHelper extends AppHelper { break; case 'month': if ($options['monthNames'] === true) { - $data['01'] = __('January'); - $data['02'] = __('February'); - $data['03'] = __('March'); - $data['04'] = __('April'); - $data['05'] = __('May'); - $data['06'] = __('June'); - $data['07'] = __('July'); - $data['08'] = __('August'); - $data['09'] = __('September'); - $data['10'] = __('October'); - $data['11'] = __('November'); - $data['12'] = __('December'); + $data['01'] = __d('cake', 'January'); + $data['02'] = __d('cake', 'February'); + $data['03'] = __d('cake', 'March'); + $data['04'] = __d('cake', 'April'); + $data['05'] = __d('cake', 'May'); + $data['06'] = __d('cake', 'June'); + $data['07'] = __d('cake', 'July'); + $data['08'] = __d('cake', 'August'); + $data['09'] = __d('cake', 'September'); + $data['10'] = __d('cake', 'October'); + $data['11'] = __d('cake', 'November'); + $data['12'] = __d('cake', 'December'); } else if (is_array($options['monthNames'])) { $data = $options['monthNames']; } else { diff --git a/lib/Cake/View/Helper/NumberHelper.php b/lib/Cake/View/Helper/NumberHelper.php index 60270b732..a891fd4ec 100644 --- a/lib/Cake/View/Helper/NumberHelper.php +++ b/lib/Cake/View/Helper/NumberHelper.php @@ -84,15 +84,15 @@ class NumberHelper extends AppHelper { public function toReadableSize($size) { switch (true) { case $size < 1024: - return __n('%d Byte', '%d Bytes', $size, $size); + return __dn('cake', '%d Byte', '%d Bytes', $size, $size); case round($size / 1024) < 1024: - return __('%d KB', $this->precision($size / 1024, 0)); + return __d('cake', '%d KB', $this->precision($size / 1024, 0)); case round($size / 1024 / 1024, 2) < 1024: - return __('%.2f MB', $this->precision($size / 1024 / 1024, 2)); + return __d('cake', '%.2f MB', $this->precision($size / 1024 / 1024, 2)); case round($size / 1024 / 1024 / 1024, 2) < 1024: - return __('%.2f GB', $this->precision($size / 1024 / 1024 / 1024, 2)); + return __d('cake', '%.2f GB', $this->precision($size / 1024 / 1024 / 1024, 2)); default: - return __('%.2f TB', $this->precision($size / 1024 / 1024 / 1024 / 1024, 2)); + return __d('cake', '%.2f TB', $this->precision($size / 1024 / 1024 / 1024 / 1024, 2)); } } diff --git a/lib/Cake/View/Helper/PaginatorHelper.php b/lib/Cake/View/Helper/PaginatorHelper.php index eb5d98b10..d77761065 100644 --- a/lib/Cake/View/Helper/PaginatorHelper.php +++ b/lib/Cake/View/Helper/PaginatorHelper.php @@ -557,7 +557,7 @@ class PaginatorHelper extends AppHelper { array( 'model' => $this->defaultModel(), 'format' => 'pages', - 'separator' => __(' of ') + 'separator' => __d('cake', ' of ') ), $options); diff --git a/lib/Cake/View/Helper/TimeHelper.php b/lib/Cake/View/Helper/TimeHelper.php index cf2e66ee5..7bd5b5e6f 100644 --- a/lib/Cake/View/Helper/TimeHelper.php +++ b/lib/Cake/View/Helper/TimeHelper.php @@ -80,19 +80,19 @@ class TimeHelper extends AppHelper { protected function _translateSpecifier($specifier) { switch ($specifier[1]) { case 'a': - $abday = __c('abday', 5); + $abday = __dc('cake', 'abday', 5); if (is_array($abday)) { return $abday[date('w', $this->__time)]; } break; case 'A': - $day = __c('day', 5); + $day = __dc('cake', 'day', 5); if (is_array($day)) { return $day[date('w', $this->__time)]; } break; case 'c': - $format = __c('d_t_fmt', 5); + $format = __dc('cake', 'd_t_fmt', 5); if ($format != 'd_t_fmt') { return $this->convertSpecifiers($format, $this->__time); } @@ -114,13 +114,13 @@ class TimeHelper extends AppHelper { return date('jS', $this->__time); case 'b': case 'h': - $months = __c('abmon', 5); + $months = __dc('cake', 'abmon', 5); if (is_array($months)) { return $months[date('n', $this->__time) -1]; } return '%b'; case 'B': - $months = __c('mon', 5); + $months = __dc('cake', 'mon', 5); if (is_array($months)) { return $months[date('n', $this->__time) -1]; } @@ -131,14 +131,14 @@ class TimeHelper extends AppHelper { case 'P': $default = array('am' => 0, 'pm' => 1); $meridiem = $default[date('a',$this->__time)]; - $format = __c('am_pm', 5); + $format = __dc('cake', 'am_pm', 5); if (is_array($format)) { $meridiem = $format[$meridiem]; return ($specifier[1] == 'P') ? strtolower($meridiem) : strtoupper($meridiem); } break; case 'r': - $complete = __c('t_fmt_ampm', 5); + $complete = __dc('cake', 't_fmt_ampm', 5); if ($complete != 't_fmt_ampm') { return str_replace('%p',$this->_translateSpecifier(array('%p', 'p')),$complete); } @@ -152,13 +152,13 @@ class TimeHelper extends AppHelper { case 'u': return ($weekDay = date('w', $this->__time)) ? $weekDay : 7; case 'x': - $format = __c('d_fmt', 5); + $format = __dc('cake', 'd_fmt', 5); if ($format != 'd_fmt') { return $this->convertSpecifiers($format, $this->__time); } break; case 'X': - $format = __c('t_fmt', 5); + $format = __dc('cake', 't_fmt', 5); if ($format != 't_fmt') { return $this->convertSpecifiers($format, $this->__time); } @@ -260,9 +260,9 @@ class TimeHelper extends AppHelper { $y = $this->isThisYear($date) ? '' : ' %Y'; if ($this->isToday($dateString, $userOffset)) { - $ret = __('Today, %s', strftime("%H:%M", $date)); + $ret = __d('cake', 'Today, %s', strftime("%H:%M", $date)); } elseif ($this->wasYesterday($dateString, $userOffset)) { - $ret = __('Yesterday, %s', strftime("%H:%M", $date)); + $ret = __d('cake', 'Yesterday, %s', strftime("%H:%M", $date)); } else { $format = $this->convertSpecifiers("%b %eS{$y}, %H:%M", $date); $ret = strftime($format, $date); @@ -609,41 +609,41 @@ class TimeHelper extends AppHelper { $diff = $futureTime - $pastTime; if ($diff > abs($now - $this->fromString($end))) { - $relativeDate = __('on %s', date($format, $inSeconds)); + $relativeDate = __d('cake', 'on %s', date($format, $inSeconds)); } else { if ($years > 0) { // years and months and days - $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d year', '%d years', $years, $years); - $relativeDate .= $months > 0 ? ($relativeDate ? ', ' : '') . __n('%d month', '%d months', $months, $months) : ''; - $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . __n('%d week', '%d weeks', $weeks, $weeks) : ''; - $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __n('%d day', '%d days', $days, $days) : ''; + $relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d year', '%d years', $years, $years); + $relativeDate .= $months > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d month', '%d months', $months, $months) : ''; + $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d week', '%d weeks', $weeks, $weeks) : ''; + $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d day', '%d days', $days, $days) : ''; } elseif (abs($months) > 0) { // months, weeks and days - $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d month', '%d months', $months, $months); - $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . __n('%d week', '%d weeks', $weeks, $weeks) : ''; - $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __n('%d day', '%d days', $days, $days) : ''; + $relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d month', '%d months', $months, $months); + $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d week', '%d weeks', $weeks, $weeks) : ''; + $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d day', '%d days', $days, $days) : ''; } elseif (abs($weeks) > 0) { // weeks and days - $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d week', '%d weeks', $weeks, $weeks); - $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __n('%d day', '%d days', $days, $days) : ''; + $relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d week', '%d weeks', $weeks, $weeks); + $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d day', '%d days', $days, $days) : ''; } elseif (abs($days) > 0) { // days and hours - $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d day', '%d days', $days, $days); - $relativeDate .= $hours > 0 ? ($relativeDate ? ', ' : '') . __n('%d hour', '%d hours', $hours, $hours) : ''; + $relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d day', '%d days', $days, $days); + $relativeDate .= $hours > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d hour', '%d hours', $hours, $hours) : ''; } elseif (abs($hours) > 0) { // hours and minutes - $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d hour', '%d hours', $hours, $hours); - $relativeDate .= $minutes > 0 ? ($relativeDate ? ', ' : '') . __n('%d minute', '%d minutes', $minutes, $minutes) : ''; + $relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d hour', '%d hours', $hours, $hours); + $relativeDate .= $minutes > 0 ? ($relativeDate ? ', ' : '') . __dn('cake', '%d minute', '%d minutes', $minutes, $minutes) : ''; } elseif (abs($minutes) > 0) { // minutes only - $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d minute', '%d minutes', $minutes, $minutes); + $relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d minute', '%d minutes', $minutes, $minutes); } else { // seconds only - $relativeDate .= ($relativeDate ? ', ' : '') . __n('%d second', '%d seconds', $seconds, $seconds); + $relativeDate .= ($relativeDate ? ', ' : '') . __dn('cake', '%d second', '%d seconds', $seconds, $seconds); } if (!$backwards) { - $relativeDate = __('%s ago', $relativeDate); + $relativeDate = __d('cake', '%s ago', $relativeDate); } } return $relativeDate; @@ -662,7 +662,7 @@ class TimeHelper extends AppHelper { public function wasWithinLast($timeInterval, $dateString, $userOffset = null) { $tmp = str_replace(' ', '', $timeInterval); if (is_numeric($tmp)) { - $timeInterval = $tmp . ' ' . __('days'); + $timeInterval = $tmp . ' ' . __d('cake', 'days'); } $date = $this->fromString($dateString, $userOffset); diff --git a/lib/Cake/View/Scaffolds/form.ctp b/lib/Cake/View/Scaffolds/form.ctp index 4749b2314..379ff6f19 100644 --- a/lib/Cake/View/Scaffolds/form.ctp +++ b/lib/Cake/View/Scaffolds/form.ctp @@ -20,32 +20,32 @@ Form->create(); echo $this->Form->inputs($scaffoldFields, array('created', 'modified', 'updated')); - echo $this->Form->end(__('Submit')); + echo $this->Form->end(__d('cake', 'Submit')); ?>Paginator->counter(array( - 'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') + 'format' => __d('cake', 'Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}') )); ?>