Converted views, router and security classes to new translation shotcut function use.

This commit is contained in:
predominant 2010-04-16 02:20:15 +10:00
parent 6bd9f0f05b
commit c98021dcd8
37 changed files with 263 additions and 263 deletions

View file

@ -44,7 +44,7 @@ class Overloadable extends Object {
*/ */
function __call($method, $params) { function __call($method, $params) {
if (!method_exists($this, 'call__')) { if (!method_exists($this, 'call__')) {
trigger_error(sprintf(__('Magic method handler call__ not defined in %s', true), get_class($this)), E_USER_ERROR); trigger_error(sprintf(__('Magic method handler call__ not defined in %s'), get_class($this)), E_USER_ERROR);
} }
return $this->call__($method, $params); return $this->call__($method, $params);
} }

View file

@ -278,7 +278,7 @@ class Router {
//TODO 2.0 refactor this to use a string class name, throw exception, and then construct. //TODO 2.0 refactor this to use a string class name, throw exception, and then construct.
$Route =& new $routeClass($route, $defaults, $options); $Route =& new $routeClass($route, $defaults, $options);
if ($routeClass !== 'CakeRoute' && !is_subclass_of($Route, 'CakeRoute')) { if ($routeClass !== 'CakeRoute' && !is_subclass_of($Route, 'CakeRoute')) {
trigger_error(__('Route classes must extend CakeRoute', true), E_USER_WARNING); trigger_error(__('Route classes must extend CakeRoute'), E_USER_WARNING);
return false; return false;
} }
$self->routes[] =& $Route; $self->routes[] =& $Route;

View file

@ -170,7 +170,7 @@ class Security extends Object {
*/ */
public static function cipher($text, $key) { public static function cipher($text, $key) {
if (empty($key)) { if (empty($key)) {
trigger_error(__('You cannot use an empty key for Security::cipher()', true), E_USER_WARNING); trigger_error(__('You cannot use an empty key for Security::cipher()'), E_USER_WARNING);
return ''; return '';
} }

View file

@ -334,7 +334,7 @@ class Validation extends Object {
break; break;
default: default:
$_this =& Validation::getInstance(); $_this =& Validation::getInstance();
$_this->errors[] = __('You must define the $operator parameter for Validation::comparison()', true); $_this->errors[] = __('You must define the $operator parameter for Validation::comparison()');
break; break;
} }
return false; return false;
@ -357,7 +357,7 @@ class Validation extends Object {
$_this->_extract($check); $_this->_extract($check);
} }
if ($_this->regex === null) { if ($_this->regex === null) {
$_this->errors[] = __('You must define a regular expression for Validation::custom()', true); $_this->errors[] = __('You must define a regular expression for Validation::custom()');
return false; return false;
} }
return $_this->_check(); return $_this->_check();
@ -894,11 +894,11 @@ class Validation extends Object {
protected function _pass($method, $check, $classPrefix) { protected function _pass($method, $check, $classPrefix) {
$className = ucwords($classPrefix) . 'Validation'; $className = ucwords($classPrefix) . 'Validation';
if (!class_exists($className)) { if (!class_exists($className)) {
trigger_error(sprintf(__('Could not find %s class, unable to complete validation.', true), $className), E_USER_WARNING); trigger_error(sprintf(__('Could not find %s class, unable to complete validation.'), $className), E_USER_WARNING);
return false; return false;
} }
if (!is_callable(array($className, $method))) { if (!is_callable(array($className, $method))) {
trigger_error(sprintf(__('Method %s does not exist on %s unable to complete validation.', true), $method, $className), E_USER_WARNING); trigger_error(sprintf(__('Method %s does not exist on %s unable to complete validation.'), $method, $className), E_USER_WARNING);
return false; return false;
} }
$check = (array)$check; $check = (array)$check;

View file

@ -19,6 +19,6 @@
?> ?>
<h2><?php echo $name; ?></h2> <h2><?php echo $name; ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('The requested address %s was not found on this server.', true), "<strong>'{$message}'</strong>"); ?> <?php printf(__('The requested address %s was not found on this server.'), "<strong>'{$message}'</strong>"); ?>
</p> </p>

View file

@ -19,6 +19,6 @@
?> ?>
<h2><?php echo $name; ?></h2> <h2><?php echo $name; ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('An Internal Error Has Occurred.', true), "<strong>'{$message}'</strong>"); ?> <?php printf(__('An Internal Error Has Occurred.'), "<strong>'{$message}'</strong>"); ?>
</p> </p>

View file

@ -17,14 +17,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php printf(__('Missing Method in %s', true), $controller); ?></h2> <h2><?php printf(__('Missing Method in %s'), $controller); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('The action %1$s is not defined in controller %2$s', true), '<em>' . $action . '</em>', '<em>' . $controller . '</em>'); ?> <?php printf(__('The action %1$s is not defined in controller %2$s'), '<em>' . $action . '</em>', '<em>' . $controller . '</em>'); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create %1$s%2$s in file: %3$s.', true), '<em>' . $controller . '::</em>', '<em>' . $action . '()</em>', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php'); ?> <?php printf(__('Create %1$s%2$s in file: %3$s.'), '<em>' . $controller . '::</em>', '<em>' . $action . '()</em>', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php'); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -41,6 +41,6 @@ class <?php echo $controller;?> extends AppController {
?&gt; ?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s.', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_action.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s.'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_action.ctp'); ?>
</p> </p>

View file

@ -19,12 +19,12 @@
?> ?>
<h2><?php __('Missing Behavior Class'); ?></h2> <h2><?php __('Missing Behavior Class'); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('The behavior class <em>%s</em> can not be found or does not exist.', true), $behaviorClass); ?> <?php printf(__('The behavior class <em>%s</em> can not be found or does not exist.'), $behaviorClass); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create the class below in file: %s', true), APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file); ?> <?php printf(__('Create the class below in file: %s'), APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -34,6 +34,6 @@ class <?php echo $behaviorClass;?> extends ModelBehavior {
?&gt; ?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_class.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_class.ctp'); ?>
</p> </p>

View file

@ -17,14 +17,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php __('Missing Behavior File'); ?></h2> <h2><?php echo __('Missing Behavior File'); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('The Behavior file %s can not be found or does not exist.', true), APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file); ?> <?php printf(__('The Behavior file %s can not be found or does not exist.'), APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create the class below in file: %s', true), APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file); ?> <?php printf(__('Create the class below in file: %s'), APP_DIR . DS . 'models' . DS . 'behaviors' . DS . $file); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -34,6 +34,6 @@ class <?php echo $behaviorClass;?> extends ModelBehavior {
?&gt; ?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_file.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_behavior_file.ctp'); ?>
</p> </p>

View file

@ -17,14 +17,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php __('Missing Component Class'); ?></h2> <h2><?php echo __('Missing Component Class'); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Component class %1$s in %2$s was not found.', true), '<em>' . $component . 'Component</em>', '<em>' . $controller . 'Controller</em>'); ?> <?php printf(__('Component class %1$s in %2$s was not found.'), '<em>' . $component . 'Component</em>', '<em>' . $controller . 'Controller</em>'); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create the class %s in file: %s', true), '<em>' . $component . 'Component</em>', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file); ?> <?php printf(__('Create the class %s in file: %s'), '<em>' . $component . 'Component</em>', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -34,6 +34,6 @@ class <?php echo $component;?>Component extends Object {<br />
?&gt; ?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_class.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_class.ctp'); ?>
</p> </p>

View file

@ -17,14 +17,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php __('Missing Component File'); ?></h2> <h2><?php echo __('Missing Component File'); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php __('The component file was not found.'); ?> <?php echo __('The component file was not found.'); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create the class %s in file: %s', true), '<em>' . $component . 'Component</em>', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file); ?> <?php printf(__('Create the class %s in file: %s'), '<em>' . $component . 'Component</em>', APP_DIR . DS . 'controllers' . DS . 'components' . DS . $file); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -34,6 +34,6 @@ class <?php echo $component;?>Component extends Object {<br />
?&gt; ?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_file.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_component_file.ctp'); ?>
</p> </p>

View file

@ -17,16 +17,16 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php __('Missing Database Connection'); ?></h2> <h2><?php echo __('Missing Database Connection'); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('%s requires a database connection', true), $model); ?> <?php printf(__('%s requires a database connection'), $model); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Confirm you have created the file : %s.', true), APP_DIR . DS . 'config' . DS . 'database.php'); ?> <?php printf(__('Confirm you have created the file : %s.'), APP_DIR . DS . 'config' . DS . 'database.php'); ?>
</p> </p>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s.', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . basename(__FILE__)); ?> <?php printf(__('If you want to customize this error message, create %s.'), APP_DIR . DS . 'views' . DS . 'errors' . DS . basename(__FILE__)); ?>
</p> </p>

View file

@ -17,14 +17,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php __('Missing Controller'); ?></h2> <h2><?php echo __('Missing Controller'); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('%s could not be found.', true), '<em>' . $controller . '</em>'); ?> <?php printf(__('%s could not be found.'), '<em>' . $controller . '</em>'); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create the class %s below in file: %s', true), '<em>' . $controller . '</em>', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php'); ?> <?php printf(__('Create the class %s below in file: %s'), '<em>' . $controller . '</em>', APP_DIR . DS . 'controllers' . DS . Inflector::underscore($controller) . '.php'); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -35,6 +35,6 @@ class <?php echo $controller;?> extends AppController {
?&gt; ?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_controller.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_controller.ctp'); ?>
</p> </p>

View file

@ -17,14 +17,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php __('Missing Helper Class'); ?></h2> <h2><?php echo __('Missing Helper Class'); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('The helper class <em>%s</em> can not be found or does not exist.', true), $helperClass); ?> <?php printf(__('The helper class <em>%s</em> can not be found or does not exist.'), $helperClass); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create the class below in file: %s', true), APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file); ?> <?php printf(__('Create the class below in file: %s'), APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -34,6 +34,6 @@ class <?php echo $helperClass;?> extends AppHelper {
?&gt; ?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_class.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_class.ctp'); ?>
</p> </p>

View file

@ -17,14 +17,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php __('Missing Helper File'); ?></h2> <h2><?php echo __('Missing Helper File'); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('The helper file %s can not be found or does not exist.', true), APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file); ?> <?php printf(__('The helper file %s can not be found or does not exist.'), APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create the class below in file: %s', true), APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file); ?> <?php printf(__('Create the class below in file: %s'), APP_DIR . DS . 'views' . DS . 'helpers' . DS . $file); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -34,6 +34,6 @@ class <?php echo $helperClass;?> extends AppHelper {
?&gt; ?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_file.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_helper_file.ctp'); ?>
</p> </p>

View file

@ -17,16 +17,16 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php __('Missing Layout'); ?></h2> <h2><?php echo __('Missing Layout'); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('The layout file %s can not be found or does not exist.', true), '<em>' . $file . '</em>'); ?> <?php printf(__('The layout file %s can not be found or does not exist.'), '<em>' . $file . '</em>'); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Confirm you have created the file: %s', true), '<em>' . $file . '</em>'); ?> <?php printf(__('Confirm you have created the file: %s'), '<em>' . $file . '</em>'); ?>
</p> </p>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_layout.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_layout.ctp'); ?>
</p> </p>

View file

@ -17,14 +17,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php __('Missing Model'); ?></h2> <h2><?php echo __('Missing Model'); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('<em>%s</em> could not be found.', true), $model); ?> <?php printf(__('<em>%s</em> could not be found.'), $model); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Create the class %s in file: %s', true), '<em>' . $model . '</em>', APP_DIR . DS . 'models' . DS . Inflector::underscore($model) . '.php'); ?> <?php printf(__('Create the class %s in file: %s'), '<em>' . $model . '</em>', APP_DIR . DS . 'models' . DS . Inflector::underscore($model) . '.php'); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php
@ -36,6 +36,6 @@ class <?php echo $model;?> extends AppModel {
?&gt; ?&gt;
</pre> </pre>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_model.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_model.ctp'); ?>
</p> </p>

View file

@ -17,16 +17,16 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php __('Missing Database Connection'); ?></h2> <h2><?php echo __('Missing Database Connection'); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php __('Scaffold requires a database connection'); ?> <?php echo __('Scaffold requires a database connection'); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Confirm you have created the file: %s', true), APP_DIR . DS . 'config' . DS . 'database.php'); ?> <?php printf(__('Confirm you have created the file: %s'), APP_DIR . DS . 'config' . DS . 'database.php'); ?>
</p> </p>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_scaffolddb.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_scaffolddb.ctp'); ?>
</p> </p>

View file

@ -17,12 +17,12 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php __('Missing Database Table'); ?></h2> <h2><?php echo __('Missing Database Table'); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Database table %1$s for model %2$s was not found.', true), '<em>' . $table . '</em>', '<em>' . $model . '</em>'); ?> <?php printf(__('Database table %1$s for model %2$s was not found.'), '<em>' . $table . '</em>', '<em>' . $model . '</em>'); ?>
</p> </p>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_table.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_table.ctp'); ?>
</p> </p>

View file

@ -17,16 +17,16 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php __('Missing View'); ?></h2> <h2><?php echo __('Missing View'); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('The view for %1$s%2$s was not found.', true), '<em>' . $controller . 'Controller::</em>', '<em>' . $action . '()</em>'); ?> <?php printf(__('The view for %1$s%2$s was not found.'), '<em>' . $controller . 'Controller::</em>', '<em>' . $action . '()</em>'); ?>
</p> </p>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('Confirm you have created the file: %s', true), $file); ?> <?php printf(__('Confirm you have created the file: %s'), $file); ?>
</p> </p>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_view.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'missing_view.ctp'); ?>
</p> </p>

View file

@ -17,12 +17,12 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php printf(__('Private Method in %s', true), $controller); ?></h2> <h2><?php printf(__('Private Method in %s'), $controller); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php printf(__('%s%s cannot be accessed directly.', true), '<em>' . $controller . '::</em>', '<em>' . $action . '()</em>'); ?> <?php printf(__('%s%s cannot be accessed directly.'), '<em>' . $controller . '::</em>', '<em>' . $action . '()</em>'); ?>
</p> </p>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'private_action.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'private_action.ctp'); ?>
</p> </p>

View file

@ -17,14 +17,14 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
?> ?>
<h2><?php __('Scaffold Error'); ?></h2> <h2><?php echo __('Scaffold Error'); ?></h2>
<p class="error"> <p class="error">
<strong><?php __('Error'); ?>: </strong> <strong><?php echo __('Error'); ?>: </strong>
<?php __('Method _scaffoldError in was not found in the controller'); ?> <?php echo __('Method _scaffoldError in was not found in the controller'); ?>
</p> </p>
<p class="notice"> <p class="notice">
<strong><?php __('Notice'); ?>: </strong> <strong><?php echo __('Notice'); ?>: </strong>
<?php printf(__('If you want to customize this error message, create %s', true), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'scaffold_error.ctp'); ?> <?php printf(__('If you want to customize this error message, create %s'), APP_DIR . DS . 'views' . DS . 'errors' . DS . 'scaffold_error.ctp'); ?>
</p> </p>
<pre> <pre>
&lt;?php &lt;?php

View file

@ -151,7 +151,7 @@ class Helper {
* *
*/ */
public function __call($method, $params) { public function __call($method, $params) {
trigger_error(sprintf(__('Method %1$s::%2$s does not exist', true), get_class($this), $method), E_USER_WARNING); trigger_error(sprintf(__('Method %1$s::%2$s does not exist'), get_class($this), $method), E_USER_WARNING);
} }
/** /**

View file

@ -358,7 +358,7 @@ class FormHelper extends AppHelper {
$submitOptions = $options; $submitOptions = $options;
if (!$submit) { if (!$submit) {
$submit = __('Submit', true); $submit = __('Submit');
} }
} }
$out .= $this->submit($submit, $submitOptions); $out .= $this->submit($submit, $submitOptions);
@ -499,7 +499,7 @@ class FormHelper extends AppHelper {
if ($text != null) { if ($text != null) {
$error = $text; $error = $text;
} elseif (is_numeric($error)) { } elseif (is_numeric($error)) {
$error = sprintf(__('Error in field %s', true), Inflector::humanize($this->field())); $error = sprintf(__('Error in field %s'), Inflector::humanize($this->field()));
} }
if ($options['escape']) { if ($options['escape']) {
$error = h($error); $error = h($error);
@ -542,7 +542,7 @@ class FormHelper extends AppHelper {
if (substr($text, -3) == '_id') { if (substr($text, -3) == '_id') {
$text = substr($text, 0, strlen($text) - 3); $text = substr($text, 0, strlen($text) - 3);
} }
$text = __(Inflector::humanize(Inflector::underscore($text)), true); $text = __(Inflector::humanize(Inflector::underscore($text)));
} }
if (is_string($options)) { if (is_string($options)) {
@ -608,16 +608,16 @@ class FormHelper extends AppHelper {
} }
if ($legend === true) { if ($legend === true) {
$actionName = __('New %s', true); $actionName = __('New %s');
$isEdit = ( $isEdit = (
strpos($this->action, 'update') !== false || strpos($this->action, 'update') !== false ||
strpos($this->action, 'edit') !== false strpos($this->action, 'edit') !== false
); );
if ($isEdit) { if ($isEdit) {
$actionName = __('Edit %s', true); $actionName = __('Edit %s');
} }
$modelName = Inflector::humanize(Inflector::underscore($model)); $modelName = Inflector::humanize(Inflector::underscore($model));
$legend = sprintf($actionName, __($modelName, true)); $legend = sprintf($actionName, __($modelName));
} }
$out = null; $out = null;
@ -1034,7 +1034,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 = __(Inflector::humanize($this->field()), true); $legend = __(Inflector::humanize($this->field()));
} }
$label = true; $label = true;
@ -1284,7 +1284,7 @@ class FormHelper extends AppHelper {
*/ */
public function submit($caption = null, $options = array()) { public function submit($caption = null, $options = array()) {
if (!$caption) { if (!$caption) {
$caption = __('Submit', true); $caption = __('Submit');
} }
$out = null; $out = null;
$div = true; $div = true;
@ -2090,18 +2090,18 @@ class FormHelper extends AppHelper {
break; break;
case 'month': case 'month':
if ($options['monthNames'] === true) { if ($options['monthNames'] === true) {
$data['01'] = __('January', true); $data['01'] = __('January');
$data['02'] = __('February', true); $data['02'] = __('February');
$data['03'] = __('March', true); $data['03'] = __('March');
$data['04'] = __('April', true); $data['04'] = __('April');
$data['05'] = __('May', true); $data['05'] = __('May');
$data['06'] = __('June', true); $data['06'] = __('June');
$data['07'] = __('July', true); $data['07'] = __('July');
$data['08'] = __('August', true); $data['08'] = __('August');
$data['09'] = __('September', true); $data['09'] = __('September');
$data['10'] = __('October', true); $data['10'] = __('October');
$data['11'] = __('November', true); $data['11'] = __('November');
$data['12'] = __('December', true); $data['12'] = __('December');
} else if (is_array($options['monthNames'])) { } else if (is_array($options['monthNames'])) {
$data = $options['monthNames']; $data = $options['monthNames'];
} else { } else {

View file

@ -149,7 +149,7 @@ class JsHelper extends AppHelper {
if (method_exists($this, $method . '_')) { if (method_exists($this, $method . '_')) {
return $this->dispatchMethod($method . '_', $params); return $this->dispatchMethod($method . '_', $params);
} }
trigger_error(sprintf(__('JsHelper:: Missing Method %s is undefined', true), $method), E_USER_WARNING); trigger_error(sprintf(__('JsHelper:: Missing Method %s is undefined'), $method), E_USER_WARNING);
} }
/** /**
@ -751,7 +751,7 @@ class JsBaseEngineHelper extends AppHelper {
* @return object instance of $this. Allows chained methods. * @return object instance of $this. Allows chained methods.
*/ */
public function get($selector) { public function get($selector) {
trigger_error(sprintf(__('%s does not have get() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have get() implemented'), get_class($this)), E_USER_WARNING);
return $this; return $this;
} }
@ -769,7 +769,7 @@ class JsBaseEngineHelper extends AppHelper {
* @return string completed event handler * @return string completed event handler
*/ */
public function event($type, $callback, $options = array()) { public function event($type, $callback, $options = array()) {
trigger_error(sprintf(__('%s does not have event() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have event() implemented'), get_class($this)), E_USER_WARNING);
} }
/** /**
@ -779,7 +779,7 @@ class JsBaseEngineHelper extends AppHelper {
* @return string completed domReady method * @return string completed domReady method
*/ */
public function domReady($functionBody) { public function domReady($functionBody) {
trigger_error(sprintf(__('%s does not have domReady() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have domReady() implemented'), get_class($this)), E_USER_WARNING);
} }
/** /**
@ -789,7 +789,7 @@ class JsBaseEngineHelper extends AppHelper {
* @return string completed iteration * @return string completed iteration
*/ */
function each($callback) { function each($callback) {
trigger_error(sprintf(__('%s does not have each() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have each() implemented'), get_class($this)), E_USER_WARNING);
} }
/** /**
@ -816,7 +816,7 @@ class JsBaseEngineHelper extends AppHelper {
* @return string completed string with effect. * @return string completed string with effect.
*/ */
public function effect($name, $options) { public function effect($name, $options) {
trigger_error(sprintf(__('%s does not have effect() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have effect() implemented'), get_class($this)), E_USER_WARNING);
} }
/** /**
@ -845,7 +845,7 @@ class JsBaseEngineHelper extends AppHelper {
* @return string XHR request. * @return string XHR request.
*/ */
public function request($url, $options = array()) { public function request($url, $options = array()) {
trigger_error(sprintf(__('%s does not have request() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have request() implemented'), get_class($this)), E_USER_WARNING);
} }
/** /**
@ -868,7 +868,7 @@ class JsBaseEngineHelper extends AppHelper {
* @return string Completed drag script * @return string Completed drag script
*/ */
public function drag($options = array()) { public function drag($options = array()) {
trigger_error(sprintf(__('%s does not have drag() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have drag() implemented'), get_class($this)), E_USER_WARNING);
} }
/** /**
@ -889,7 +889,7 @@ class JsBaseEngineHelper extends AppHelper {
* @return string Completed drop script * @return string Completed drop script
*/ */
public function drop($options = array()) { public function drop($options = array()) {
trigger_error(sprintf(__('%s does not have drop() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have drop() implemented'), get_class($this)), E_USER_WARNING);
} }
/** /**
@ -914,7 +914,7 @@ class JsBaseEngineHelper extends AppHelper {
* @return string Completed sortable script. * @return string Completed sortable script.
*/ */
public function sortable() { public function sortable() {
trigger_error(sprintf(__('%s does not have sortable() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have sortable() implemented'), get_class($this)), E_USER_WARNING);
} }
/** /**
@ -938,7 +938,7 @@ class JsBaseEngineHelper extends AppHelper {
* @return string Completed slider script * @return string Completed slider script
*/ */
public function slider() { public function slider() {
trigger_error(sprintf(__('%s does not have slider() implemented', true), get_class($this)), E_USER_WARNING); trigger_error(sprintf(__('%s does not have slider() implemented'), get_class($this)), E_USER_WARNING);
} }
/** /**
@ -957,7 +957,7 @@ class JsBaseEngineHelper extends AppHelper {
*/ */
public function serializeForm() { public function serializeForm() {
trigger_error( trigger_error(
sprintf(__('%s does not have serializeForm() implemented', true), get_class($this)), E_USER_WARNING sprintf(__('%s does not have serializeForm() implemented'), get_class($this)), 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(
__('MootoolsEngine::drop() requires a "drag" option to properly function', true), E_USER_WARNING __('MootoolsEngine::drop() requires a "drag" option to properly function'), E_USER_WARNING
); );
return false; return false;
} }

View file

@ -88,15 +88,15 @@ class NumberHelper extends AppHelper {
public function toReadableSize($size) { public function toReadableSize($size) {
switch (true) { switch (true) {
case $size < 1024: case $size < 1024:
return sprintf(__n('%d Byte', '%d Bytes', $size, true), $size); return sprintf(__n('%d Byte', '%d Bytes', $size), $size);
case round($size / 1024) < 1024: case round($size / 1024) < 1024:
return sprintf(__('%d KB', true), $this->precision($size / 1024, 0)); return sprintf(__('%d KB'), $this->precision($size / 1024, 0));
case round($size / 1024 / 1024, 2) < 1024: case round($size / 1024 / 1024, 2) < 1024:
return sprintf(__('%.2f MB', true), $this->precision($size / 1024 / 1024, 2)); return sprintf(__('%.2f MB'), $this->precision($size / 1024 / 1024, 2));
case round($size / 1024 / 1024 / 1024, 2) < 1024: case round($size / 1024 / 1024 / 1024, 2) < 1024:
return sprintf(__('%.2f GB', true), $this->precision($size / 1024 / 1024 / 1024, 2)); return sprintf(__('%.2f GB'), $this->precision($size / 1024 / 1024 / 1024, 2));
default: default:
return sprintf(__('%.2f TB', true), $this->precision($size / 1024 / 1024 / 1024 / 1024, 2)); return sprintf(__('%.2f TB'), $this->precision($size / 1024 / 1024 / 1024 / 1024, 2));
} }
} }

View file

@ -95,7 +95,7 @@ class PaginatorHelper extends AppHelper {
App::import('Helper', $ajaxProvider); App::import('Helper', $ajaxProvider);
$classname = $ajaxProvider . 'Helper'; $classname = $ajaxProvider . 'Helper';
if (!is_callable(array($classname, 'link'))) { if (!is_callable(array($classname, 'link'))) {
trigger_error(sprintf(__('%s does not implement a link() method, it is incompatible with PaginatorHelper', true), $classname), E_USER_WARNING); trigger_error(sprintf(__('%s does not implement a link() method, it is incompatible with PaginatorHelper'), $classname), E_USER_WARNING);
} }
} }
@ -295,7 +295,7 @@ class PaginatorHelper extends AppHelper {
if (empty($key)) { if (empty($key)) {
$key = $title; $key = $title;
$title = __(Inflector::humanize(preg_replace('/_id$/', '', $title)), true); $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']);
@ -515,7 +515,7 @@ class PaginatorHelper extends AppHelper {
array( array(
'model' => $this->defaultModel(), 'model' => $this->defaultModel(),
'format' => 'pages', 'format' => 'pages',
'separator' => __(' of ', true) 'separator' => __(' of ')
), ),
$options); $options);

View file

@ -178,7 +178,7 @@ class SessionHelper extends CakeSession {
* @return boolean * @return boolean
*/ */
public function write() { public function write() {
trigger_error(__('You can not write to a Session from the view', true), E_USER_WARNING); trigger_error(__('You can not write to a Session from the view'), E_USER_WARNING);
} }
/** /**

View file

@ -57,19 +57,19 @@ class TimeHelper extends AppHelper {
function __translateSpecifier($specifier) { function __translateSpecifier($specifier) {
switch ($specifier[1]) { switch ($specifier[1]) {
case 'a': case 'a':
$abday = __c('abday', 5, true); $abday = __c('abday', 5);
if (is_array($abday)) { if (is_array($abday)) {
return $abday[date('w', $this->__time)]; return $abday[date('w', $this->__time)];
} }
break; break;
case 'A': case 'A':
$day = __c('day',5,true); $day = __c('day', 5);
if (is_array($day)) { if (is_array($day)) {
return $day[date('w', $this->__time)]; return $day[date('w', $this->__time)];
} }
break; break;
case 'c': case 'c':
$format = __c('d_t_fmt',5,true); $format = __c('d_t_fmt', 5);
if ($format != 'd_t_fmt') { if ($format != 'd_t_fmt') {
return $this->convertSpecifiers($format, $this->__time); return $this->convertSpecifiers($format, $this->__time);
} }
@ -82,13 +82,13 @@ class TimeHelper extends AppHelper {
return date('jS', $this->__time); return date('jS', $this->__time);
case 'b': case 'b':
case 'h': case 'h':
$months = __c('abmon', 5, true); $months = __c('abmon', 5);
if (is_array($months)) { if (is_array($months)) {
return $months[date('n', $this->__time) -1]; return $months[date('n', $this->__time) -1];
} }
return '%b'; return '%b';
case 'B': case 'B':
$months = __c('mon',5,true); $months = __c('mon', 5);
if (is_array($months)) { if (is_array($months)) {
return $months[date('n', $this->__time) -1]; return $months[date('n', $this->__time) -1];
} }
@ -99,14 +99,14 @@ class TimeHelper extends AppHelper {
case 'P': case 'P':
$default = array('am' => 0, 'pm' => 1); $default = array('am' => 0, 'pm' => 1);
$meridiem = $default[date('a',$this->__time)]; $meridiem = $default[date('a',$this->__time)];
$format = __c('am_pm', 5, true); $format = __c('am_pm', 5);
if (is_array($format)) { if (is_array($format)) {
$meridiem = $format[$meridiem]; $meridiem = $format[$meridiem];
return ($specifier[1] == 'P') ? strtolower($meridiem) : strtoupper($meridiem); return ($specifier[1] == 'P') ? strtolower($meridiem) : strtoupper($meridiem);
} }
break; break;
case 'r': case 'r':
$complete = __c('t_fmt_ampm', 5, true); $complete = __c('t_fmt_ampm', 5);
if ($complete != 't_fmt_ampm') { if ($complete != 't_fmt_ampm') {
return str_replace('%p',$this->__translateSpecifier(array('%p', 'p')),$complete); return str_replace('%p',$this->__translateSpecifier(array('%p', 'p')),$complete);
} }
@ -120,13 +120,13 @@ class TimeHelper extends AppHelper {
case 'u': case 'u':
return ($weekDay = date('w', $this->__time)) ? $weekDay : 7; return ($weekDay = date('w', $this->__time)) ? $weekDay : 7;
case 'x': case 'x':
$format = __c('d_fmt', 5, true); $format = __c('d_fmt', 5);
if ($format != 'd_fmt') { if ($format != 'd_fmt') {
return $this->convertSpecifiers($format, $this->__time); return $this->convertSpecifiers($format, $this->__time);
} }
break; break;
case 'X': case 'X':
$format = __c('t_fmt',5,true); $format = __c('t_fmt', 5);
if ($format != 't_fmt') { if ($format != 't_fmt') {
return $this->convertSpecifiers($format, $this->__time); return $this->convertSpecifiers($format, $this->__time);
} }
@ -224,9 +224,9 @@ class TimeHelper extends AppHelper {
$y = $this->isThisYear($date) ? '' : ' %Y'; $y = $this->isThisYear($date) ? '' : ' %Y';
if ($this->isToday($date)) { if ($this->isToday($date)) {
$ret = sprintf(__('Today, %s',true), strftime("%H:%M", $date)); $ret = sprintf(__('Today, %s'), strftime("%H:%M", $date));
} elseif ($this->wasYesterday($date)) { } elseif ($this->wasYesterday($date)) {
$ret = sprintf(__('Yesterday, %s',true), strftime("%H:%M", $date)); $ret = sprintf(__('Yesterday, %s'), strftime("%H:%M", $date));
} else { } else {
$format = $this->convertSpecifiers("%b %eS{$y}, %H:%M", $date); $format = $this->convertSpecifiers("%b %eS{$y}, %H:%M", $date);
$ret = strftime($format, $date); $ret = strftime($format, $date);
@ -572,41 +572,41 @@ class TimeHelper extends AppHelper {
$diff = $futureTime - $pastTime; $diff = $futureTime - $pastTime;
if ($diff > abs($now - $this->fromString($end))) { if ($diff > abs($now - $this->fromString($end))) {
$relativeDate = sprintf(__('on %s',true), date($format, $inSeconds)); $relativeDate = sprintf(__('on %s'), date($format, $inSeconds));
} else { } else {
if ($years > 0) { if ($years > 0) {
// years and months and days // years and months and days
$relativeDate .= ($relativeDate ? ', ' : '') . $years . ' ' . __n('year', 'years', $years, true); $relativeDate .= ($relativeDate ? ', ' : '') . $years . ' ' . __n('year', 'years', $years);
$relativeDate .= $months > 0 ? ($relativeDate ? ', ' : '') . $months . ' ' . __n('month', 'months', $months, true) : ''; $relativeDate .= $months > 0 ? ($relativeDate ? ', ' : '') . $months . ' ' . __n('month', 'months', $months) : '';
$relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks, true) : ''; $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks) : '';
$relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days, true) : ''; $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days) : '';
} elseif (abs($months) > 0) { } elseif (abs($months) > 0) {
// months, weeks and days // months, weeks and days
$relativeDate .= ($relativeDate ? ', ' : '') . $months . ' ' . __n('month', 'months', $months, true); $relativeDate .= ($relativeDate ? ', ' : '') . $months . ' ' . __n('month', 'months', $months);
$relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks, true) : ''; $relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks) : '';
$relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days, true) : ''; $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days) : '';
} elseif (abs($weeks) > 0) { } elseif (abs($weeks) > 0) {
// weeks and days // weeks and days
$relativeDate .= ($relativeDate ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks, true); $relativeDate .= ($relativeDate ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks);
$relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days, true) : ''; $relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days) : '';
} elseif (abs($days) > 0) { } elseif (abs($days) > 0) {
// days and hours // days and hours
$relativeDate .= ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days, true); $relativeDate .= ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days);
$relativeDate .= $hours > 0 ? ($relativeDate ? ', ' : '') . $hours . ' ' . __n('hour', 'hours', $hours, true) : ''; $relativeDate .= $hours > 0 ? ($relativeDate ? ', ' : '') . $hours . ' ' . __n('hour', 'hours', $hours) : '';
} elseif (abs($hours) > 0) { } elseif (abs($hours) > 0) {
// hours and minutes // hours and minutes
$relativeDate .= ($relativeDate ? ', ' : '') . $hours . ' ' . __n('hour', 'hours', $hours, true); $relativeDate .= ($relativeDate ? ', ' : '') . $hours . ' ' . __n('hour', 'hours', $hours);
$relativeDate .= $minutes > 0 ? ($relativeDate ? ', ' : '') . $minutes . ' ' . __n('minute', 'minutes', $minutes, true) : ''; $relativeDate .= $minutes > 0 ? ($relativeDate ? ', ' : '') . $minutes . ' ' . __n('minute', 'minutes', $minutes) : '';
} elseif (abs($minutes) > 0) { } elseif (abs($minutes) > 0) {
// minutes only // minutes only
$relativeDate .= ($relativeDate ? ', ' : '') . $minutes . ' ' . __n('minute', 'minutes', $minutes, true); $relativeDate .= ($relativeDate ? ', ' : '') . $minutes . ' ' . __n('minute', 'minutes', $minutes);
} else { } else {
// seconds only // seconds only
$relativeDate .= ($relativeDate ? ', ' : '') . $seconds . ' ' . __n('second', 'seconds', $seconds, true); $relativeDate .= ($relativeDate ? ', ' : '') . $seconds . ' ' . __n('second', 'seconds', $seconds);
} }
if (!$backwards) { if (!$backwards) {
$relativeDate = sprintf(__('%s ago', true), $relativeDate); $relativeDate = sprintf(__('%s ago'), $relativeDate);
} }
} }
return $relativeDate; return $relativeDate;
@ -642,7 +642,7 @@ class TimeHelper extends AppHelper {
public function wasWithinLast($timeInterval, $dateString, $userOffset = null) { public function wasWithinLast($timeInterval, $dateString, $userOffset = null) {
$tmp = str_replace(' ', '', $timeInterval); $tmp = str_replace(' ', '', $timeInterval);
if (is_numeric($tmp)) { if (is_numeric($tmp)) {
$timeInterval = $tmp . ' ' . __('days', true); $timeInterval = $tmp . ' ' . __('days');
} }
$date = $this->fromString($dateString, $userOffset); $date = $this->fromString($dateString, $userOffset);

View file

@ -22,7 +22,7 @@
<head> <head>
<?php echo $this->Html->charset(); ?> <?php echo $this->Html->charset(); ?>
<title> <title>
<?php __('CakePHP: the rapid development php framework:'); ?> <?php echo __('CakePHP: the rapid development php framework:'); ?>
<?php echo $title_for_layout; ?> <?php echo $title_for_layout; ?>
</title> </title>
<?php <?php
@ -47,7 +47,7 @@
</div> </div>
<div id="footer"> <div id="footer">
<?php echo $this->Html->link( <?php echo $this->Html->link(
$this->Html->image('cake.power.gif', array('alt'=> __('CakePHP: the rapid development php framework', true), 'border' => '0')), $this->Html->image('cake.power.gif', array('alt'=> __('CakePHP: the rapid development php framework'), 'border' => '0')),
'http://www.cakephp.org/', 'http://www.cakephp.org/',
array('target' => '_blank', 'escape' => false) array('target' => '_blank', 'escape' => false)
); );

View file

@ -20,8 +20,8 @@ if (Configure::read() == 0):
$this->cakeError('error404'); $this->cakeError('error404');
endif; endif;
?> ?>
<h2><?php echo sprintf(__('Release Notes for CakePHP %s.', true), Configure::version()); ?></h2> <h2><?php echo sprintf(__('Release Notes for CakePHP %s.'), Configure::version()); ?></h2>
<a href="http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-0-RC3"><?php __('Read the changelog'); ?> </a> <a href="http://cakephp.lighthouseapp.com/projects/42648/changelog-1-3-0-RC3"><?php echo __('Read the changelog'); ?> </a>
<?php <?php
if (Configure::read() > 0): if (Configure::read() > 0):
Debugger::checkSecurityKeys(); Debugger::checkSecurityKeys();
@ -31,11 +31,11 @@ endif;
<?php <?php
if (is_writable(TMP)): if (is_writable(TMP)):
echo '<span class="notice success">'; echo '<span class="notice success">';
__('Your tmp directory is writable.'); echo __('Your tmp directory is writable.');
echo '</span>'; echo '</span>';
else: else:
echo '<span class="notice">'; echo '<span class="notice">';
__('Your tmp directory is NOT writable.'); echo __('Your tmp directory is NOT writable.');
echo '</span>'; echo '</span>';
endif; endif;
?> ?>
@ -45,11 +45,11 @@ endif;
$settings = Cache::settings(); $settings = Cache::settings();
if (!empty($settings)): if (!empty($settings)):
echo '<span class="notice success">'; echo '<span class="notice success">';
printf(__('The %s is being used for caching. To change the config edit APP/config/core.php ', true), '<em>'. $settings['engine'] . 'Engine</em>'); printf(__('The %s is being used for caching. To change the config edit APP/config/core.php '), '<em>'. $settings['engine'] . 'Engine</em>');
echo '</span>'; echo '</span>';
else: else:
echo '<span class="notice">'; echo '<span class="notice">';
__('Your cache is NOT working. Please check the settings in APP/config/core.php'); echo __('Your cache is NOT working. Please check the settings in APP/config/core.php');
echo '</span>'; echo '</span>';
endif; endif;
?> ?>
@ -59,14 +59,14 @@ endif;
$filePresent = null; $filePresent = null;
if (file_exists(CONFIGS.'database.php')): if (file_exists(CONFIGS.'database.php')):
echo '<span class="notice success">'; echo '<span class="notice success">';
__('Your database configuration file is present.'); echo __('Your database configuration file is present.');
$filePresent = true; $filePresent = true;
echo '</span>'; echo '</span>';
else: else:
echo '<span class="notice">'; echo '<span class="notice">';
__('Your database configuration file is NOT present.'); echo __('Your database configuration file is NOT present.');
echo '<br/>'; echo '<br/>';
__('Rename config/database.php.default to config/database.php'); echo __('Rename config/database.php.default to config/database.php');
echo '</span>'; echo '</span>';
endif; endif;
?> ?>
@ -83,30 +83,30 @@ if (isset($filePresent)):
<?php <?php
if ($connected->isConnected()): if ($connected->isConnected()):
echo '<span class="notice success">'; echo '<span class="notice success">';
__('Cake is able to connect to the database.'); echo __('Cake is able to connect to the database.');
echo '</span>'; echo '</span>';
else: else:
echo '<span class="notice">'; echo '<span class="notice">';
__('Cake is NOT able to connect to the database.'); echo __('Cake is NOT able to connect to the database.');
echo '</span>'; echo '</span>';
endif; endif;
?> ?>
</p> </p>
<?php endif;?> <?php endif;?>
<h3><?php __('Editing this Page'); ?></h3> <h3><?php echo __('Editing this Page'); ?></h3>
<p> <p>
<?php <?php
__('To change the content of this page, create: APP/views/pages/home.ctp.<br /> echo __('To change the content of this page, create: APP/views/pages/home.ctp.<br />
To change its layout, create: APP/views/layouts/default.ctp.<br /> To change its layout, create: APP/views/layouts/default.ctp.<br />
You can also add some CSS styles for your pages at: APP/webroot/css.'); You can also add some CSS styles for your pages at: APP/webroot/css.');
?> ?>
</p> </p>
<h3><?php __('Getting Started'); ?></h3> <h3><?php echo __('Getting Started'); ?></h3>
<p> <p>
<?php <?php
echo $this->Html->link( echo $this->Html->link(
sprintf('<strong>%s</strong>%s', __('new', true ), __('CakePHP 1.2 Docs', true )), sprintf('<strong>%s</strong>%s', __('new'), __('CakePHP 1.2 Docs')),
'http://book.cakephp.org', 'http://book.cakephp.org',
array('target' => '_blank', 'escape' => false) array('target' => '_blank', 'escape' => false)
); );
@ -115,46 +115,46 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
<p> <p>
<?php <?php
echo $this->Html->link( echo $this->Html->link(
__('The 15 min Blog Tutorial', true), __('The 15 min Blog Tutorial'),
'http://book.cakephp.org/view/219/the-cakephp-blog-tutorial', 'http://book.cakephp.org/view/219/the-cakephp-blog-tutorial',
array('target' => '_blank', 'escape' => false) array('target' => '_blank', 'escape' => false)
); );
?> ?>
</p> </p>
<h3><?php __('More about Cake'); ?></h3> <h3><?php echo __('More about Cake'); ?></h3>
<p> <p>
<?php __('CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.'); ?> <?php echo __('CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.'); ?>
</p> </p>
<p> <p>
<?php __('Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.'); ?> <?php echo __('Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.'); ?>
</p> </p>
<ul> <ul>
<li><a href="http://cakefoundation.org/"><?php __('Cake Software Foundation'); ?> </a> <li><a href="http://cakefoundation.org/"><?php echo __('Cake Software Foundation'); ?> </a>
<ul><li><?php __('Promoting development related to CakePHP'); ?></li></ul></li> <ul><li><?php echo __('Promoting development related to CakePHP'); ?></li></ul></li>
<li><a href="http://www.cakephp.org"><?php __('CakePHP'); ?> </a> <li><a href="http://www.cakephp.org"><?php echo __('CakePHP'); ?> </a>
<ul><li><?php __('The Rapid Development Framework'); ?></li></ul></li> <ul><li><?php echo __('The Rapid Development Framework'); ?></li></ul></li>
<li><a href="http://book.cakephp.org"><?php __('CakePHP Documentation'); ?> </a> <li><a href="http://book.cakephp.org"><?php echo __('CakePHP Documentation'); ?> </a>
<ul><li><?php __('Your Rapid Development Cookbook'); ?></li></ul></li> <ul><li><?php echo __('Your Rapid Development Cookbook'); ?></li></ul></li>
<li><a href="http://api.cakephp.org"><?php __('CakePHP API'); ?> </a> <li><a href="http://api.cakephp.org"><?php echo __('CakePHP API'); ?> </a>
<ul><li><?php __('Quick Reference'); ?></li></ul></li> <ul><li><?php echo __('Quick Reference'); ?></li></ul></li>
<li><a href="http://bakery.cakephp.org"><?php __('The Bakery'); ?> </a> <li><a href="http://bakery.cakephp.org"><?php echo __('The Bakery'); ?> </a>
<ul><li><?php __('Everything CakePHP'); ?></li></ul></li> <ul><li><?php echo __('Everything CakePHP'); ?></li></ul></li>
<li><a href="http://live.cakephp.org"><?php __('The Show'); ?> </a> <li><a href="http://live.cakephp.org"><?php echo __('The Show'); ?> </a>
<ul><li><?php __('The Show is a live and archived internet radio broadcast CakePHP-related topics and answer questions live via IRC, Skype, and telephone.'); ?></li></ul></li> <ul><li><?php echo __('The Show is a live and archived internet radio broadcast CakePHP-related topics and answer questions live via IRC, Skype, and telephone.'); ?></li></ul></li>
<li><a href="http://groups.google.com/group/cake-php"><?php __('CakePHP Google Group'); ?> </a> <li><a href="http://groups.google.com/group/cake-php"><?php echo __('CakePHP Google Group'); ?> </a>
<ul><li><?php __('Community mailing list'); ?></li></ul></li> <ul><li><?php echo __('Community mailing list'); ?></li></ul></li>
<li><a href="irc://irc.freenode.net/cakephp">irc.freenode.net #cakephp</a> <li><a href="irc://irc.freenode.net/cakephp">irc.freenode.net #cakephp</a>
<ul><li><?php __('Live chat about CakePHP'); ?></li></ul></li> <ul><li><?php echo __('Live chat about CakePHP'); ?></li></ul></li>
<li><a href="http://github.com/cakephp/"><?php __('CakePHP Code'); ?> </a> <li><a href="http://github.com/cakephp/"><?php echo __('CakePHP Code'); ?> </a>
<ul><li><?php __('For the Development of CakePHP Git repository, Downloads'); ?></li></ul></li> <ul><li><?php echo __('For the Development of CakePHP Git repository, Downloads'); ?></li></ul></li>
<li><a href="http://cakephp.lighthouseapp.com/"><?php __('CakePHP Lighthouse'); ?> </a> <li><a href="http://cakephp.lighthouseapp.com/"><?php echo __('CakePHP Lighthouse'); ?> </a>
<ul><li><?php __('CakePHP Tickets, Wiki pages, Roadmap'); ?></li></ul></li> <ul><li><?php echo __('CakePHP Tickets, Wiki pages, Roadmap'); ?></li></ul></li>
<li><a href="http://www.cakeforge.org"><?php __('CakeForge'); ?> </a> <li><a href="http://www.cakeforge.org"><?php echo __('CakeForge'); ?> </a>
<ul><li><?php __('Open Development for CakePHP'); ?></li></ul></li> <ul><li><?php echo __('Open Development for CakePHP'); ?></li></ul></li>
<li><a href="http://astore.amazon.com/cakesoftwaref-20/"><?php __('Book Store'); ?> </a> <li><a href="http://astore.amazon.com/cakesoftwaref-20/"><?php echo __('Book Store'); ?> </a>
<ul><li><?php __('Recommended Software Books'); ?></li></ul></li> <ul><li><?php echo __('Recommended Software Books'); ?></li></ul></li>
<li><a href="http://www.cafepress.com/cakefoundation"><?php __('CakePHP gear'); ?> </a> <li><a href="http://www.cafepress.com/cakefoundation"><?php echo __('CakePHP gear'); ?> </a>
<ul><li><?php __('Get your own CakePHP gear - Doughnate to Cake'); ?></li></ul></li> <ul><li><?php echo __('Get your own CakePHP gear - Doughnate to Cake'); ?></li></ul></li>
</ul> </ul>

View file

@ -21,23 +21,23 @@
<?php <?php
echo $this->Form->create(); echo $this->Form->create();
echo $this->Form->inputs($scaffoldFields, array('created', 'modified', 'updated')); echo $this->Form->inputs($scaffoldFields, array('created', 'modified', 'updated'));
echo $this->Form->end(__('Submit', true)); echo $this->Form->end(__('Submit'));
?> ?>
</div> </div>
<div class="actions"> <div class="actions">
<h3><?php __('Actions'); ?></h3> <h3><?php echo __('Actions'); ?></h3>
<ul> <ul>
<?php if ($this->action != 'add'):?> <?php if ($this->action != 'add'):?>
<li><?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $this->Form->value($modelClass.'.'.$primaryKey)), null, __('Are you sure you want to delete', true).' #' . $this->Form->value($modelClass.'.'.$primaryKey)); ?></li> <li><?php echo $this->Html->link(__('Delete'), array('action' => 'delete', $this->Form->value($modelClass.'.'.$primaryKey)), null, __('Are you sure you want to delete').' #' . $this->Form->value($modelClass.'.'.$primaryKey)); ?></li>
<?php endif;?> <?php endif;?>
<li><?php echo $this->Html->link(__('List', true).' '.$pluralHumanName, array('action' => 'index'));?></li> <li><?php echo $this->Html->link(__('List').' '.$pluralHumanName, array('action' => 'index'));?></li>
<?php <?php
$done = array(); $done = array();
foreach ($associations as $_type => $_data) { foreach ($associations as $_type => $_data) {
foreach ($_data as $_alias => $_details) { foreach ($_data as $_alias => $_details) {
if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) { if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) {
echo "\t\t<li>" . $this->Html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index')) . "</li>\n"; echo "\t\t<li>" . $this->Html->link(sprintf(__('List %s'), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' =>'index')) . "</li>\n";
echo "\t\t<li>" . $this->Html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "</li>\n"; echo "\t\t<li>" . $this->Html->link(sprintf(__('New %s'), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' =>'add')) . "</li>\n";
$done[] = $_details['controller']; $done[] = $_details['controller'];
} }
} }

View file

@ -24,7 +24,7 @@
<?php foreach ($scaffoldFields as $_field):?> <?php foreach ($scaffoldFields as $_field):?>
<th><?php echo $this->Paginator->sort($_field);?></th> <th><?php echo $this->Paginator->sort($_field);?></th>
<?php endforeach;?> <?php endforeach;?>
<th><?php __('Actions');?></th> <th><?php echo __('Actions');?></th>
</tr> </tr>
<?php <?php
$i = 0; $i = 0;
@ -52,9 +52,9 @@ echo "\n";
} }
echo "\t\t<td class=\"actions\">\n"; echo "\t\t<td class=\"actions\">\n";
echo "\t\t\t" . $this->Html->link(__('View', true), array('action' => 'view', ${$singularVar}[$modelClass][$primaryKey])) . "\n"; echo "\t\t\t" . $this->Html->link(__('View'), array('action' => 'view', ${$singularVar}[$modelClass][$primaryKey])) . "\n";
echo "\t\t\t" . $this->Html->link(__('Edit', true), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])) . "\n"; echo "\t\t\t" . $this->Html->link(__('Edit'), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])) . "\n";
echo "\t\t\t" . $this->Html->link(__('Delete', true), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __('Are you sure you want to delete', true).' #' . ${$singularVar}[$modelClass][$primaryKey]) . "\n"; echo "\t\t\t" . $this->Html->link(__('Delete'), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __('Are you sure you want to delete').' #' . ${$singularVar}[$modelClass][$primaryKey]) . "\n";
echo "\t\t</td>\n"; echo "\t\t</td>\n";
echo "\t</tr>\n"; echo "\t</tr>\n";
@ -64,26 +64,26 @@ echo "\n";
</table> </table>
<p><?php <p><?php
echo $this->Paginator->counter(array( echo $this->Paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true) 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%')
)); ));
?></p> ?></p>
<div class="paging"> <div class="paging">
<?php echo "\t" . $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class' => 'disabled')) . "\n";?> <?php echo "\t" . $this->Paginator->prev('<< ' . __('previous'), array(), null, array('class' => 'disabled')) . "\n";?>
| <?php echo $this->Paginator->numbers() . "\n"?> | <?php echo $this->Paginator->numbers() . "\n"?>
<?php echo "\t ". $this->Paginator->next(__('next', true) .' >>', array(), null, array('class' => 'disabled')) . "\n";?> <?php echo "\t ". $this->Paginator->next(__('next') .' >>', array(), null, array('class' => 'disabled')) . "\n";?>
</div> </div>
</div> </div>
<div class="actions"> <div class="actions">
<h3><?php __('Actions'); ?></h3> <h3><?php echo __('Actions'); ?></h3>
<ul> <ul>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), $singularHumanName), array('action' => 'add')); ?></li> <li><?php echo $this->Html->link(sprintf(__('New %s'), $singularHumanName), array('action' => 'add')); ?></li>
<?php <?php
$done = array(); $done = array();
foreach ($associations as $_type => $_data) { foreach ($associations as $_type => $_data) {
foreach ($_data as $_alias => $_details) { foreach ($_data as $_alias => $_details) {
if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) { if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) {
echo "\t\t<li>" . $this->Html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>\n"; echo "\t\t<li>" . $this->Html->link(sprintf(__('List %s'), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>\n";
echo "\t\t<li>" . $this->Html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n"; echo "\t\t<li>" . $this->Html->link(sprintf(__('New %s'), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n";
$done[] = $_details['controller']; $done[] = $_details['controller'];
} }
} }

View file

@ -18,7 +18,7 @@
*/ */
?> ?>
<div class="<?php echo $pluralVar;?> view"> <div class="<?php echo $pluralVar;?> view">
<h2><?php printf(__("View %s", true), $singularHumanName); ?></h2> <h2><?php printf(__('View %s'), $singularHumanName); ?></h2>
<dl> <dl>
<?php <?php
$i = 0; $i = 0;
@ -47,20 +47,20 @@ foreach ($scaffoldFields as $_field) {
</dl> </dl>
</div> </div>
<div class="actions"> <div class="actions">
<h3><?php __('Actions'); ?></h3> <h3><?php echo __('Actions'); ?></h3>
<ul> <ul>
<?php <?php
echo "\t\t<li>" .$this->Html->link(sprintf(__('Edit %s', true), $singularHumanName), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])). " </li>\n"; echo "\t\t<li>" .$this->Html->link(sprintf(__('Edit %s'), $singularHumanName), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])). " </li>\n";
echo "\t\t<li>" .$this->Html->link(sprintf(__('Delete %s', true), $singularHumanName), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __('Are you sure you want to delete', true).' #' . ${$singularVar}[$modelClass][$primaryKey] . '?'). " </li>\n"; echo "\t\t<li>" .$this->Html->link(sprintf(__('Delete %s'), $singularHumanName), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __('Are you sure you want to delete').' #' . ${$singularVar}[$modelClass][$primaryKey] . '?'). " </li>\n";
echo "\t\t<li>" .$this->Html->link(sprintf(__('List %s', true), $pluralHumanName), array('action' => 'index')). " </li>\n"; echo "\t\t<li>" .$this->Html->link(sprintf(__('List %s'), $pluralHumanName), array('action' => 'index')). " </li>\n";
echo "\t\t<li>" .$this->Html->link(sprintf(__('New %s', true), $singularHumanName), array('action' => 'add')). " </li>\n"; echo "\t\t<li>" .$this->Html->link(sprintf(__('New %s'), $singularHumanName), array('action' => 'add')). " </li>\n";
$done = array(); $done = array();
foreach ($associations as $_type => $_data) { foreach ($associations as $_type => $_data) {
foreach ($_data as $_alias => $_details) { foreach ($_data as $_alias => $_details) {
if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) { if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) {
echo "\t\t<li>" . $this->Html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>\n"; echo "\t\t<li>" . $this->Html->link(sprintf(__('List %s'), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>\n";
echo "\t\t<li>" . $this->Html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n"; echo "\t\t<li>" . $this->Html->link(sprintf(__('New %s'), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n";
$done[] = $_details['controller']; $done[] = $_details['controller'];
} }
} }

View file

@ -437,7 +437,7 @@ class View extends Object {
$this->hasRendered = true; $this->hasRendered = true;
} else { } else {
$out = $this->_render($viewFileName, $this->viewVars); $out = $this->_render($viewFileName, $this->viewVars);
trigger_error(sprintf(__("Error in view %s, got: <blockquote>%s</blockquote>", true), $viewFileName, $out), E_USER_ERROR); trigger_error(sprintf(__("Error in view %s, got: <blockquote>%s</blockquote>"), $viewFileName, $out), E_USER_ERROR);
} }
return $out; return $out;
} }
@ -480,7 +480,7 @@ class View extends Object {
if ($this->output === false) { if ($this->output === false) {
$this->output = $this->_render($layoutFileName, $data_for_layout); $this->output = $this->_render($layoutFileName, $data_for_layout);
trigger_error(sprintf(__("Error in layout %s, got: <blockquote>%s</blockquote>", true), $layoutFileName, $this->output), E_USER_ERROR); trigger_error(sprintf(__("Error in layout %s, got: <blockquote>%s</blockquote>"), $layoutFileName, $this->output), E_USER_ERROR);
return false; return false;
} }

View file

@ -396,7 +396,7 @@ class XmlNode extends Object {
if (is_object($child)) { if (is_object($child)) {
if ($this->compare($child)) { if ($this->compare($child)) {
trigger_error(__('Cannot append a node to itself.', true)); trigger_error(__('Cannot append a node to itself.'));
$return = false; $return = false;
return $return; return $return;
} }
@ -890,7 +890,7 @@ class Xml extends XmlNode {
} elseif (file_exists($input)) { } elseif (file_exists($input)) {
$this->__rawData = file_get_contents($input); $this->__rawData = file_get_contents($input);
} else { } else {
trigger_error(__('XML cannot be read', true)); trigger_error(__('XML cannot be read'));
return false; return false;
} }
return $this->parse(); return $this->parse();