Merge branch '2.0-translations' of github.com:AD7six/cakephp into 2.0-class-loading

This commit is contained in:
AD7six 2011-03-16 17:08:15 +01:00
commit e492bce64f
128 changed files with 923 additions and 923 deletions

0
app/console/cake.php Executable file → Normal file
View file

0
app/tmp/cache/models/empty vendored Executable file → Normal file
View file

0
app/tmp/cache/views/empty vendored Executable file → Normal file
View file

0
app/tmp/logs/empty Executable file → Normal file
View file

0
app/tmp/sessions/empty Executable file → Normal file
View file

0
app/tmp/tests/empty Executable file → Normal file
View file

View file

@ -72,7 +72,7 @@ if (!include(CORE_PATH . 'Cake' . DS . 'bootstrap.php')) {
}
if (Configure::read('debug') < 1) {
die(__('Debug setting does not allow access to this url.'));
die(__d('cake', 'Debug setting does not allow access to this url.'));
}
require_once CAKE_TESTS_LIB . 'CakeTestSuiteDispatcher.php';

View file

@ -143,7 +143,7 @@ class Cache {
}
$cacheClass = $class . 'Engine';
if (!is_subclass_of($cacheClass, 'CacheEngine')) {
throw new CacheException(__('Cache engines must use CacheEngine as a base class.'));
throw new CacheException(__d('cake', 'Cache engines must use CacheEngine as a base class.'));
}
self::$_engines[$name] = new $cacheClass();
if (self::$_engines[$name]->init($config)) {
@ -283,7 +283,7 @@ class Cache {
self::set(null, $config);
if ($success === false && $value !== '') {
trigger_error(
__("%s cache was unable to write '%s' to cache", $config, $key),
__d('cake', "%s cache was unable to write '%s' to cache", $config, $key),
E_USER_WARNING
);
}

View file

@ -251,7 +251,7 @@ class FileEngine extends CacheEngine {
* @throws CacheException
*/
public function decrement($key, $offset = 1) {
throw new CacheException(__('Files cannot be atomically decremented.'));
throw new CacheException(__d('cake', 'Files cannot be atomically decremented.'));
}
/**
@ -261,7 +261,7 @@ class FileEngine extends CacheEngine {
* @throws CacheException
*/
public function increment($key, $offset = 1) {
throw new CacheException(__('Files cannot be atomically incremented.'));
throw new CacheException(__d('cake', 'Files cannot be atomically incremented.'));
}
/**
@ -297,7 +297,7 @@ class FileEngine extends CacheEngine {
$dir = new SplFileInfo($this->settings['path']);
if ($this->_init && !($dir->isDir() && $dir->isWritable())) {
$this->_init = false;
trigger_error(__('%s is not writable', $this->settings['path']), E_USER_WARNING);
trigger_error(__d('cake', '%s is not writable', $this->settings['path']), E_USER_WARNING);
return false;
}
return true;

View file

@ -153,7 +153,7 @@ class MemcacheEngine extends CacheEngine {
public function increment($key, $offset = 1) {
if ($this->settings['compress']) {
throw new CacheException(
__('Method increment() not implemented for compressed cache in %s', __CLASS__)
__d('cake', 'Method increment() not implemented for compressed cache in %s', __CLASS__)
);
}
return $this->_Memcache->increment($key, $offset);
@ -171,7 +171,7 @@ class MemcacheEngine extends CacheEngine {
public function decrement($key, $offset = 1) {
if ($this->settings['compress']) {
throw new CacheException(
__('Method decrement() not implemented for compressed cache in %s', __CLASS__)
__d('cake', 'Method decrement() not implemented for compressed cache in %s', __CLASS__)
);
}
return $this->_Memcache->decrement($key, $offset);

View file

@ -74,7 +74,7 @@ class IniReader implements ConfigReaderInterface {
if (!file_exists($filename)) {
$filename .= '.ini';
if (!file_exists($filename)) {
throw new ConfigureException(__('Could not load configuration files: %s or %s', substr($filename, 0, -4), $filename));
throw new ConfigureException(__d('cake', 'Could not load configuration files: %s or %s', substr($filename, 0, -4), $filename));
}
}
$contents = parse_ini_file($filename, true);

View file

@ -55,7 +55,7 @@ class PhpReader implements ConfigReaderInterface {
*/
public function read($key) {
if (strpos($key, '..') !== false) {
throw new ConfigureException(__('Cannot load configuration files with ../ in them.'));
throw new ConfigureException(__d('cake', 'Cannot load configuration files with ../ in them.'));
}
if (substr($key, -4) === '.php') {
$key = substr($key, 0, -4);
@ -70,13 +70,13 @@ class PhpReader implements ConfigReaderInterface {
if (!file_exists($file)) {
$file .= '.php';
if (!file_exists($file)) {
throw new ConfigureException(__('Could not load configuration files: %s or %s', substr($file, 0, -4), $file));
throw new ConfigureException(__d('cake', 'Could not load configuration files: %s or %s', substr($file, 0, -4), $file));
}
}
include $file;
if (!isset($config)) {
throw new ConfigureException(
sprintf(__('No variable $config found in %s.php'), $file)
sprintf(__d('cake', 'No variable $config found in %s.php'), $file)
);
}
return $config;

View file

@ -71,12 +71,12 @@ class AclShell extends Shell {
if (!in_array(Configure::read('Acl.classname'), array('DbAcl', 'DB_ACL'))) {
$out = "--------------------------------------------------\n";
$out .= __('Error: Your current Cake configuration is set to') . "\n";
$out .= __('an ACL implementation other than DB. Please change') . "\n";
$out .= __('your core config to reflect your decision to use') . "\n";
$out .= __('DbAcl before attempting to use this script') . ".\n";
$out .= __d('cake', 'Error: Your current Cake configuration is set to') . "\n";
$out .= __d('cake', 'an ACL implementation other than DB. Please change') . "\n";
$out .= __d('cake', 'your core config to reflect your decision to use') . "\n";
$out .= __d('cake', 'DbAcl before attempting to use this script') . ".\n";
$out .= "--------------------------------------------------\n";
$out .= __('Current ACL Classname: %s', Configure::read('Acl.classname')) . "\n";
$out .= __d('cake', 'Current ACL Classname: %s', Configure::read('Acl.classname')) . "\n";
$out .= "--------------------------------------------------\n";
$this->err($out);
$this->_stop();
@ -84,7 +84,7 @@ class AclShell extends Shell {
if ($this->command) {
if (!config('database')) {
$this->out(__('Your database configuration was not found. Take a moment to create one.'), true);
$this->out(__d('cake', 'Your database configuration was not found. Take a moment to create one.'), true);
$this->args = null;
return $this->DbConfig->execute();
}
@ -127,15 +127,15 @@ class AclShell extends Shell {
if (is_string($data) && $data != '/') {
$data = array('alias' => $data);
} elseif (is_string($data)) {
$this->error(__('/ can not be used as an alias!') . __(" / is the root, please supply a sub alias"));
$this->error(__d('cake', '/ can not be used as an alias!') . __d('cake', " / is the root, please supply a sub alias"));
}
$data['parent_id'] = $parent;
$this->Acl->{$class}->create();
if ($this->Acl->{$class}->save($data)) {
$this->out(__("<success>New %s</success> '%s' created.", $class, $this->args[2]), 2);
$this->out(__d('cake', "<success>New %s</success> '%s' created.", $class, $this->args[2]), 2);
} else {
$this->err(__("There was a problem creating a new %s '%s'.", $class, $this->args[2]));
$this->err(__d('cake', "There was a problem creating a new %s '%s'.", $class, $this->args[2]));
}
}
@ -150,9 +150,9 @@ class AclShell extends Shell {
$nodeId = $this->_getNodeId($class, $identifier);
if (!$this->Acl->{$class}->delete($nodeId)) {
$this->error(__('Node Not Deleted') . __('There was an error deleting the %s. Check that the node exists', $class) . ".\n");
$this->error(__d('cake', 'Node Not Deleted') . __d('cake', 'There was an error deleting the %s. Check that the node exists', $class) . ".\n");
}
$this->out(__('<success>%s deleted.</success>', $class), 2);
$this->out(__d('cake', '<success>%s deleted.</success>', $class), 2);
}
/**
@ -172,9 +172,9 @@ class AclShell extends Shell {
);
$this->Acl->{$class}->create();
if (!$this->Acl->{$class}->save($data)) {
$this->out(__('Error in setting new parent. Please make sure the parent node exists, and is not a descendant of the node specified.'), true);
$this->out(__d('cake', 'Error in setting new parent. Please make sure the parent node exists, and is not a descendant of the node specified.'), true);
} else {
$this->out(__('Node parent set to %s', $this->args[2]) . "\n", true);
$this->out(__d('cake', 'Node parent set to %s', $this->args[2]) . "\n", true);
}
}
@ -191,11 +191,11 @@ class AclShell extends Shell {
if (empty($nodes)) {
$this->error(
__("Supplied Node '%s' not found", $this->args[1]),
__('No tree returned.')
__d('cake', "Supplied Node '%s' not found", $this->args[1]),
__d('cake', 'No tree returned.')
);
}
$this->out(__('Path:'));
$this->out(__d('cake', 'Path:'));
$this->hr();
for ($i = 0; $i < count($nodes); $i++) {
$this->_outputNode($class, $nodes[$i], $i);
@ -228,9 +228,9 @@ class AclShell extends Shell {
extract($this->__getParams());
if ($this->Acl->check($aro, $aco, $action)) {
$this->out(__('%s is <success>allowed</success>.', $aroName), true);
$this->out(__d('cake', '%s is <success>allowed</success>.', $aroName), true);
} else {
$this->out(__('%s is <error>not allowed</error>.', $aroName), true);
$this->out(__d('cake', '%s is <error>not allowed</error>.', $aroName), true);
}
}
@ -242,9 +242,9 @@ class AclShell extends Shell {
extract($this->__getParams());
if ($this->Acl->allow($aro, $aco, $action)) {
$this->out(__('Permission <success>granted</success>.'), true);
$this->out(__d('cake', 'Permission <success>granted</success>.'), true);
} else {
$this->out(__('Permission was <error>not granted</error>.'), true);
$this->out(__d('cake', 'Permission was <error>not granted</error>.'), true);
}
}
@ -256,9 +256,9 @@ class AclShell extends Shell {
extract($this->__getParams());
if ($this->Acl->deny($aro, $aco, $action)) {
$this->out(__('Permission denied.'), true);
$this->out(__d('cake', 'Permission denied.'), true);
} else {
$this->out(__('Permission was not denied.'), true);
$this->out(__d('cake', 'Permission was not denied.'), true);
}
}
@ -270,9 +270,9 @@ class AclShell extends Shell {
extract($this->__getParams());
if ($this->Acl->inherit($aro, $aco, $action)) {
$this->out(__('Permission inherited.'), true);
$this->out(__d('cake', 'Permission inherited.'), true);
} else {
$this->out(__('Permission was not inherited.'), true);
$this->out(__d('cake', 'Permission was not inherited.'), true);
}
}
@ -303,9 +303,9 @@ class AclShell extends Shell {
if (empty($nodes)) {
if (isset($this->args[1])) {
$this->error(__('%s not found', $this->args[1]), __('No tree returned.'));
$this->error(__d('cake', '%s not found', $this->args[1]), __d('cake', 'No tree returned.'));
} elseif (isset($this->args[0])) {
$this->error(__('%s not found', $this->args[0]), __('No tree returned.'));
$this->error(__d('cake', '%s not found', $this->args[0]), __d('cake', 'No tree returned.'));
}
}
$this->out($class . " tree:");
@ -354,140 +354,140 @@ class AclShell extends Shell {
$type = array(
'choices' => array('aro', 'aco'),
'required' => true,
'help' => __('Type of node to create.')
'help' => __d('cake', 'Type of node to create.')
);
$parser->description('A console tool for managing the DbAcl')
->addSubcommand('create', array(
'help' => __('Create a new ACL node'),
'help' => __d('cake', 'Create a new ACL node'),
'parser' => array(
'description' => __('Creates a new ACL object <node> under the parent'),
'description' => __d('cake', 'Creates a new ACL object <node> under the parent'),
'arguments' => array(
'type' => $type,
'parent' => array(
'help' => __('The node selector for the parent.'),
'help' => __d('cake', 'The node selector for the parent.'),
'required' => true
),
'alias' => array(
'help' => __('The alias to use for the newly created node.'),
'help' => __d('cake', 'The alias to use for the newly created node.'),
'required' => true
)
)
)
))->addSubcommand('delete', array(
'help' => __('Deletes the ACL object with the given <node> reference'),
'help' => __d('cake', 'Deletes the ACL object with the given <node> reference'),
'parser' => array(
'description' => __('Delete an ACL node.'),
'description' => __d('cake', 'Delete an ACL node.'),
'arguments' => array(
'type' => $type,
'node' => array(
'help' => __('The node identifier to delete.'),
'help' => __d('cake', 'The node identifier to delete.'),
'required' => true,
)
)
)
))->addSubcommand('setparent', array(
'help' => __('Moves the ACL node under a new parent.'),
'help' => __d('cake', 'Moves the ACL node under a new parent.'),
'parser' => array(
'description' => __('Moves the ACL object specified by <node> beneath <parent>'),
'description' => __d('cake', 'Moves the ACL object specified by <node> beneath <parent>'),
'arguments' => array(
'type' => $type,
'node' => array(
'help' => __('The node to move'),
'help' => __d('cake', 'The node to move'),
'required' => true,
),
'parent' => array(
'help' => __('The new parent for <node>.'),
'help' => __d('cake', 'The new parent for <node>.'),
'required' => true
)
)
)
))->addSubcommand('getpath', array(
'help' => __('Print out the path to an ACL node.'),
'help' => __d('cake', 'Print out the path to an ACL node.'),
'parser' => array(
'description' => array(
__("Returns the path to the ACL object specified by <node>."),
__("This command is useful in determining the inhertiance of permissions"),
__("for a certain object in the tree.")
__d('cake', "Returns the path to the ACL object specified by <node>."),
__d('cake', "This command is useful in determining the inhertiance of permissions"),
__d('cake', "for a certain object in the tree.")
),
'arguments' => array(
'type' => $type,
'node' => array(
'help' => __('The node to get the path of'),
'help' => __d('cake', 'The node to get the path of'),
'required' => true,
)
)
)
))->addSubcommand('check', array(
'help' => __('Check the permissions between an ACO and ARO.'),
'help' => __d('cake', 'Check the permissions between an ACO and ARO.'),
'parser' => array(
'description' => array(
__("Use this command to grant ACL permissions. Once executed, the ARO "),
__("specified (and its children, if any) will have ALLOW access to the"),
__("specified ACO action (and the ACO's children, if any).")
__d('cake', "Use this command to grant ACL permissions. Once executed, the ARO "),
__d('cake', "specified (and its children, if any) will have ALLOW access to the"),
__d('cake', "specified ACO action (and the ACO's children, if any).")
),
'arguments' => array(
'aro' => array('help' => __('ARO to check.'), 'required' => true),
'aco' => array('help' => __('ACO to check.'), 'required' => true),
'action' => array('help' => __('Action to check'), 'default' => 'all')
'aro' => array('help' => __d('cake', 'ARO to check.'), 'required' => true),
'aco' => array('help' => __d('cake', 'ACO to check.'), 'required' => true),
'action' => array('help' => __d('cake', 'Action to check'), 'default' => 'all')
)
)
))->addSubcommand('grant', array(
'help' => __('Grant an ARO permissions to an ACO.'),
'help' => __d('cake', 'Grant an ARO permissions to an ACO.'),
'parser' => array(
'description' => array(
__("Use this command to grant ACL permissions. Once executed, the ARO"),
__("specified (and its children, if any) will have ALLOW access to the"),
__("specified ACO action (and the ACO's children, if any).")
__d('cake', "Use this command to grant ACL permissions. Once executed, the ARO"),
__d('cake', "specified (and its children, if any) will have ALLOW access to the"),
__d('cake', "specified ACO action (and the ACO's children, if any).")
),
'arguments' => array(
'aro' => array('help' => __('ARO to grant permission to.'), 'required' => true),
'aco' => array('help' => __('ACO to grant access to.'), 'required' => true),
'action' => array('help' => __('Action to grant'), 'default' => 'all')
'aro' => array('help' => __d('cake', 'ARO to grant permission to.'), 'required' => true),
'aco' => array('help' => __d('cake', 'ACO to grant access to.'), 'required' => true),
'action' => array('help' => __d('cake', 'Action to grant'), 'default' => 'all')
)
)
))->addSubcommand('deny', array(
'help' => __('Deny an ARO permissions to an ACO.'),
'help' => __d('cake', 'Deny an ARO permissions to an ACO.'),
'parser' => array(
'description' => array(
__("Use this command to deny ACL permissions. Once executed, the ARO"),
__("specified (and its children, if any) will have DENY access to the"),
__("specified ACO action (and the ACO's children, if any).")
__d('cake', "Use this command to deny ACL permissions. Once executed, the ARO"),
__d('cake', "specified (and its children, if any) will have DENY access to the"),
__d('cake', "specified ACO action (and the ACO's children, if any).")
),
'arguments' => array(
'aro' => array('help' => __('ARO to deny.'), 'required' => true),
'aco' => array('help' => __('ACO to deny.'), 'required' => true),
'action' => array('help' => __('Action to deny'), 'default' => 'all')
'aro' => array('help' => __d('cake', 'ARO to deny.'), 'required' => true),
'aco' => array('help' => __d('cake', 'ACO to deny.'), 'required' => true),
'action' => array('help' => __d('cake', 'Action to deny'), 'default' => 'all')
)
)
))->addSubcommand('inherit', array(
'help' => __('Inherit an ARO\'s parent permissions.'),
'help' => __d('cake', 'Inherit an ARO\'s parent permissions.'),
'parser' => array(
'description' => array(
__("Use this command to force a child ARO object to inherit its"),
__("permissions settings from its parent.")
__d('cake', "Use this command to force a child ARO object to inherit its"),
__d('cake', "permissions settings from its parent.")
),
'arguments' => array(
'aro' => array('help' => __('ARO to have permisssions inherit.'), 'required' => true),
'aco' => array('help' => __('ACO to inherit permissions on.'), 'required' => true),
'action' => array('help' => __('Action to inherit'), 'default' => 'all')
'aro' => array('help' => __d('cake', 'ARO to have permisssions inherit.'), 'required' => true),
'aco' => array('help' => __d('cake', 'ACO to inherit permissions on.'), 'required' => true),
'action' => array('help' => __d('cake', 'Action to inherit'), 'default' => 'all')
)
)
))->addSubcommand('view', array(
'help' => __('View a tree or a single node\'s subtree.'),
'help' => __d('cake', 'View a tree or a single node\'s subtree.'),
'parser' => array(
'description' => array(
__("The view command will return the ARO or ACO tree."),
__("The optional node parameter allows you to return"),
__("only a portion of the requested tree.")
__d('cake', "The view command will return the ARO or ACO tree."),
__d('cake', "The optional node parameter allows you to return"),
__d('cake', "only a portion of the requested tree.")
),
'arguments' => array(
'type' => $type,
'node' => array('help' => __('The optional node to view the subtree of.'))
'node' => array('help' => __d('cake', 'The optional node to view the subtree of.'))
)
)
))->addSubcommand('initdb', array(
'help' => __('Initialize the DbAcl tables. Uses this command : cake schema run create DbAcl')
'help' => __d('cake', 'Initialize the DbAcl tables. Uses this command : cake schema run create DbAcl')
))->epilog(
array(
'Node and parent arguments can be in one of the following formats:',
@ -520,7 +520,7 @@ class AclShell extends Shell {
$conditions = array($class . '.' . $key => $this->args[1]);
$possibility = $this->Acl->{$class}->find('all', compact('conditions'));
if (empty($possibility)) {
$this->error(__('%s not found', $this->args[1]), __('No tree returned.'));
$this->error(__d('cake', '%s not found', $this->args[1]), __d('cake', 'No tree returned.'));
}
return $possibility;
}
@ -556,7 +556,7 @@ class AclShell extends Shell {
if (is_array($identifier)) {
$identifier = var_export($identifier, true);
}
$this->error(__('Could not find node using reference "%s"', $identifier));
$this->error(__d('cake', 'Could not find node using reference "%s"', $identifier));
}
return Set::extract($node, "0.{$class}.id");
}

View file

@ -85,7 +85,7 @@ class ApiShell extends Shell {
}
} else {
$this->error(__('%s not found', $class));
$this->error(__d('cake', '%s not found', $class));
}
$parsed = $this->__parseClass($path . $class .'.php', $class);
@ -93,7 +93,7 @@ class ApiShell extends Shell {
if (!empty($parsed)) {
if (isset($this->params['method'])) {
if (!isset($parsed[$this->params['method']])) {
$this->err(__('%s::%s() could not be found', $class, $this->params['method']));
$this->err(__d('cake', '%s::%s() could not be found', $class, $this->params['method']));
$this->_stop();
}
$method = $parsed[$this->params['method']];
@ -110,9 +110,9 @@ class ApiShell extends Shell {
$this->out($list);
$methods = array_keys($parsed);
while ($number = strtolower($this->in(__('Select a number to see the more information about a specific method. q to quit. l to list.'), null, 'q'))) {
while ($number = strtolower($this->in(__d('cake', 'Select a number to see the more information about a specific method. q to quit. l to list.'), null, 'q'))) {
if ($number === 'q') {
$this->out(__('Done'));
$this->out(__d('cake', 'Done'));
return $this->_stop();
}
@ -145,8 +145,8 @@ class ApiShell extends Shell {
'help' => 'A CakePHP core class name (e.g: Component, HtmlHelper).'
))->addOption('method', array(
'short' => 'm',
'help' => __('The specific method you want help on.')
))->description(__('Lookup doc block comments for classes in CakePHP.'));
'help' => __d('cake', 'The specific method you want help on.')
))->description(__d('cake', 'Lookup doc block comments for classes in CakePHP.'));
return $parser;
}
/**
@ -199,7 +199,7 @@ class ApiShell extends Shell {
if (!class_exists($class)) {
if (!include_once($path)) {
$this->err(__('%s could not be found', $path));
$this->err(__d('cake', '%s could not be found', $path));
}
}

View file

@ -75,7 +75,7 @@ class BakeShell extends Shell {
}
if (!config('database')) {
$this->out(__('Your database configuration was not found. Take a moment to create one.'));
$this->out(__d('cake', 'Your database configuration was not found. Take a moment to create one.'));
$this->args = null;
return $this->DbConfig->execute();
}
@ -90,7 +90,7 @@ class BakeShell extends Shell {
$this->out('[T]est case');
$this->out('[Q]uit');
$classToBake = strtoupper($this->in(__('What would you like to Bake?'), array('D', 'M', 'V', 'C', 'P', 'F', 'T', 'Q')));
$classToBake = strtoupper($this->in(__d('cake', 'What would you like to Bake?'), array('D', 'M', 'V', 'C', 'P', 'F', 'T', 'Q')));
switch ($classToBake) {
case 'D':
$this->DbConfig->execute();
@ -117,7 +117,7 @@ class BakeShell extends Shell {
exit(0);
break;
default:
$this->out(__('You have made an invalid selection. Please choose a type of class to Bake by entering D, M, V, F, T, or C.'));
$this->out(__d('cake', 'You have made an invalid selection. Please choose a type of class to Bake by entering D, M, V, F, T, or C.'));
}
$this->hr();
$this->main();
@ -182,10 +182,10 @@ class BakeShell extends Shell {
$this->View->execute();
}
$this->out('', 1, Shell::QUIET);
$this->out(__('<success>Bake All complete</success>'), 1, Shell::QUIET);
$this->out(__d('cake', '<success>Bake All complete</success>'), 1, Shell::QUIET);
array_shift($this->args);
} else {
$this->error(__('Bake All could not continue without a valid model'));
$this->error(__d('cake', 'Bake All could not continue without a valid model'));
}
return $this->_stop();
}
@ -203,33 +203,33 @@ class BakeShell extends Shell {
'creation process. You can customize the generation process by telling Bake' .
'where different parts of your application are using command line arguments.'
)->addSubcommand('all', array(
'help' => __('Bake a complete MVC. optional <name> of a Model'),
'help' => __d('cake', 'Bake a complete MVC. optional <name> of a Model'),
))->addSubcommand('project', array(
'help' => __('Bake a new app folder in the path supplied or in current directory if no path is specified'),
'help' => __d('cake', 'Bake a new app folder in the path supplied or in current directory if no path is specified'),
'parser' => $this->Project->getOptionParser()
))->addSubcommand('plugin', array(
'help' => __('Bake a new plugin folder in the path supplied or in current directory if no path is specified.'),
'help' => __d('cake', 'Bake a new plugin folder in the path supplied or in current directory if no path is specified.'),
'parser' => $this->Plugin->getOptionParser()
))->addSubcommand('db_config', array(
'help' => __('Bake a database.php file in config directory.'),
'help' => __d('cake', 'Bake a database.php file in config directory.'),
'parser' => $this->DbConfig->getOptionParser()
))->addSubcommand('model', array(
'help' => __('Bake a model.'),
'help' => __d('cake', 'Bake a model.'),
'parser' => $this->Model->getOptionParser()
))->addSubcommand('view', array(
'help' => __('Bake views for controllers.'),
'help' => __d('cake', 'Bake views for controllers.'),
'parser' => $this->View->getOptionParser()
))->addSubcommand('controller', array(
'help' => __('Bake a controller.'),
'help' => __d('cake', 'Bake a controller.'),
'parser' => $this->Controller->getOptionParser()
))->addSubcommand('fixture', array(
'help' => __('Bake a fixture.'),
'help' => __d('cake', 'Bake a fixture.'),
'parser' => $this->Fixture->getOptionParser()
))->addSubcommand('test', array(
'help' => __('Bake a unit test.'),
'help' => __d('cake', 'Bake a unit test.'),
'parser' => $this->Test->getOptionParser()
))->addOption('connection', array(
'help' => __('Database connection to use in conjunction with `bake all`.'),
'help' => __d('cake', 'Database connection to use in conjunction with `bake all`.'),
'short' => 'c',
'default' => 'default'
));

View file

@ -214,10 +214,10 @@ class CommandListShell extends Shell {
$parser = parent::getOptionParser();
return $parser->description('Get the list of available shells for this CakePHP application.')
->addOption('xml', array(
'help' => __('Get the listing as XML.'),
'help' => __d('cake', 'Get the listing as XML.'),
'boolean' => true
))->addOption('sort', array(
'help' => __('Sorts the commands by where they are located.'),
'help' => __d('cake', 'Sorts the commands by where they are located.'),
'boolean' => true
));
}

View file

@ -52,7 +52,7 @@ class I18nShell extends Shell {
if ($this->command && !in_array($this->command, array('help'))) {
if (!config('database')) {
$this->out(__('Your database configuration was not found. Take a moment to create one.'), true);
$this->out(__d('cake', 'Your database configuration was not found. Take a moment to create one.'), true);
return $this->DbConfig->execute();
}
}
@ -63,14 +63,14 @@ class I18nShell extends Shell {
*
*/
public function main() {
$this->out(__('<info>I18n Shell</info>'));
$this->out(__d('cake', '<info>I18n Shell</info>'));
$this->hr();
$this->out(__('[E]xtract POT file from sources'));
$this->out(__('[I]nitialize i18n database table'));
$this->out(__('[H]elp'));
$this->out(__('[Q]uit'));
$this->out(__d('cake', '[E]xtract POT file from sources'));
$this->out(__d('cake', '[I]nitialize i18n database table'));
$this->out(__d('cake', '[H]elp'));
$this->out(__d('cake', '[Q]uit'));
$choice = strtolower($this->in(__('What would you like to do?'), array('E', 'I', 'H', 'Q')));
$choice = strtolower($this->in(__d('cake', 'What would you like to do?'), array('E', 'I', 'H', 'Q')));
switch ($choice) {
case 'e':
$this->Extract->execute();
@ -85,7 +85,7 @@ class I18nShell extends Shell {
exit(0);
break;
default:
$this->out(__('You have made an invalid selection. Please choose a command to execute by entering E, I, H, or Q.'));
$this->out(__d('cake', 'You have made an invalid selection. Please choose a command to execute by entering E, I, H, or Q.'));
}
$this->hr();
$this->main();
@ -107,11 +107,11 @@ class I18nShell extends Shell {
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(
__('I18n Shell initializes i18n database table for your application and generates .pot files(s) with translations.')
__d('cake', 'I18n Shell initializes i18n database table for your application and generates .pot files(s) with translations.')
)->addSubcommand('initdb', array(
'help' => __('Initialize the i18n table.')
'help' => __d('cake', 'Initialize the i18n table.')
))->addSubcommand('extract', array(
'help' => __('Extract the po translations from your application'),
'help' => __d('cake', 'Extract the po translations from your application'),
'parser' => $this->Extract->getOptionParser()
));
}

View file

@ -112,7 +112,7 @@ class SchemaShell extends Shell {
$this->_stop();
} else {
$file = $this->Schema->path . DS . $this->params['file'];
$this->err(__('Schema file (%s) could not be found.', $file));
$this->err(__d('cake', 'Schema file (%s) could not be found.', $file));
$this->_stop();
}
}
@ -123,7 +123,7 @@ class SchemaShell extends Shell {
*
*/
public function generate() {
$this->out(__('Generating Schema...'));
$this->out(__d('cake', 'Generating Schema...'));
$options = array();
if (isset($this->params['force'])) {
$options = array('models' => false);
@ -182,10 +182,10 @@ class SchemaShell extends Shell {
}
if ($this->Schema->write($content)) {
$this->out(__('Schema file: %s generated', $content['file']));
$this->out(__d('cake', 'Schema file: %s generated', $content['file']));
$this->_stop();
} else {
$this->err(__('Schema file: %s generated'));
$this->err(__d('cake', 'Schema file: %s generated'));
$this->_stop();
}
}
@ -202,7 +202,7 @@ class SchemaShell extends Shell {
$write = false;
$Schema = $this->Schema->load();
if (!$Schema) {
$this->err(__('Schema could not be loaded'));
$this->err(__d('cake', 'Schema could not be loaded'));
$this->_stop();
}
if (!empty($this->params['write'])) {
@ -227,10 +227,10 @@ class SchemaShell extends Shell {
}
if ($File->write($contents)) {
$this->out(__('SQL dump file created in %s', $File->pwd()));
$this->out(__d('cake', 'SQL dump file created in %s', $File->pwd()));
$this->_stop();
} else {
$this->err(__('SQL dump could not be created'));
$this->err(__d('cake', 'SQL dump could not be created'));
$this->_stop();
}
}
@ -274,7 +274,7 @@ class SchemaShell extends Shell {
if (!empty($this->params['dry'])) {
$this->__dry = true;
$this->out(__('Performing a dry run.'));
$this->out(__d('cake', 'Performing a dry run.'));
}
$options = array('name' => $name, 'plugin' => $plugin);
@ -286,7 +286,7 @@ class SchemaShell extends Shell {
$Schema = $this->Schema->load($options);
if (!$Schema) {
$this->err(__('%s could not be loaded', $this->Schema->path . DS . $this->Schema->file));
$this->err(__d('cake', '%s could not be loaded', $this->Schema->path . DS . $this->Schema->file));
$this->_stop();
}
$table = null;
@ -317,26 +317,26 @@ class SchemaShell extends Shell {
$create[$table] = $db->createSchema($Schema, $table);
}
if (empty($drop) || empty($create)) {
$this->out(__('Schema is up to date.'));
$this->out(__d('cake', 'Schema is up to date.'));
$this->_stop();
}
$this->out("\n" . __('The following table(s) will be dropped.'));
$this->out("\n" . __d('cake', 'The following table(s) will be dropped.'));
$this->out(array_keys($drop));
if ('y' == $this->in(__('Are you sure you want to drop the table(s)?'), array('y', 'n'), 'n')) {
$this->out(__('Dropping table(s).'));
if ('y' == $this->in(__d('cake', 'Are you sure you want to drop the table(s)?'), array('y', 'n'), 'n')) {
$this->out(__d('cake', 'Dropping table(s).'));
$this->__run($drop, 'drop', $Schema);
}
$this->out("\n" . __('The following table(s) will be created.'));
$this->out("\n" . __d('cake', 'The following table(s) will be created.'));
$this->out(array_keys($create));
if ('y' == $this->in(__('Are you sure you want to create the table(s)?'), array('y', 'n'), 'y')) {
$this->out(__('Creating table(s).'));
if ('y' == $this->in(__d('cake', 'Are you sure you want to create the table(s)?'), array('y', 'n'), 'y')) {
$this->out(__d('cake', 'Creating table(s).'));
$this->__run($create, 'create', $Schema);
}
$this->out(__('End create.'));
$this->out(__d('cake', 'End create.'));
}
/**
@ -348,7 +348,7 @@ class SchemaShell extends Shell {
function __update(&$Schema, $table = null) {
$db = ConnectionManager::getDataSource($this->Schema->connection);
$this->out(__('Comparing Database to Schema...'));
$this->out(__d('cake', 'Comparing Database to Schema...'));
$options = array();
if (isset($this->params['force'])) {
$options['models'] = false;
@ -367,19 +367,19 @@ class SchemaShell extends Shell {
}
if (empty($contents)) {
$this->out(__('Schema is up to date.'));
$this->out(__d('cake', 'Schema is up to date.'));
$this->_stop();
}
$this->out("\n" . __('The following statements will run.'));
$this->out("\n" . __d('cake', 'The following statements will run.'));
$this->out(array_map('trim', $contents));
if ('y' == $this->in(__('Are you sure you want to alter the tables?'), array('y', 'n'), 'n')) {
if ('y' == $this->in(__d('cake', 'Are you sure you want to alter the tables?'), array('y', 'n'), 'n')) {
$this->out();
$this->out(__('Updating Database...'));
$this->out(__d('cake', 'Updating Database...'));
$this->__run($contents, 'update', $Schema);
}
$this->out(__('End update.'));
$this->out(__d('cake', 'End update.'));
}
/**
@ -389,7 +389,7 @@ class SchemaShell extends Shell {
*/
function __run($contents, $event, &$Schema) {
if (empty($contents)) {
$this->err(__('Sql could not be run'));
$this->err(__d('cake', 'Sql could not be run'));
return;
}
Configure::write('debug', 2);
@ -397,10 +397,10 @@ class SchemaShell extends Shell {
foreach ($contents as $table => $sql) {
if (empty($sql)) {
$this->out(__('%s is up to date.', $table));
$this->out(__d('cake', '%s is up to date.', $table));
} else {
if ($this->__dry === true) {
$this->out(__('Dry run for %s :', $table));
$this->out(__d('cake', 'Dry run for %s :', $table));
$this->out($sql);
} else {
if (!$Schema->before(array($event => $table))) {
@ -416,7 +416,7 @@ class SchemaShell extends Shell {
if (!empty($error)) {
$this->out($error);
} else {
$this->out(__('%s updated.', $table));
$this->out(__d('cake', '%s updated.', $table));
}
}
}
@ -430,26 +430,26 @@ class SchemaShell extends Shell {
*/
public function getOptionParser() {
$plugin = array(
'help' => __('The plugin to use.'),
'help' => __d('cake', 'The plugin to use.'),
);
$connection = array(
'help' => __('Set the db config to use.'),
'help' => __d('cake', 'Set the db config to use.'),
'default' => 'default'
);
$path = array(
'help' => __('Path to read and write schema.php'),
'help' => __d('cake', 'Path to read and write schema.php'),
'default' => CONFIGS . 'schema'
);
$file = array(
'help' => __('File name to read and write.'),
'help' => __d('cake', 'File name to read and write.'),
'default' => 'schema.php'
);
$name = array(
'help' => __('Classname to use. If its Plugin.class, both name and plugin options will be set.')
'help' => __d('cake', 'Classname to use. If its Plugin.class, both name and plugin options will be set.')
);
$snapshot = array(
'short' => 's',
'help' => __('Snapshot number to use/make.')
'help' => __d('cake', 'Snapshot number to use/make.')
);
$dry = array(
'help' => 'Perform a dry run on create and update commands. Queries will be output instead of run.',
@ -457,11 +457,11 @@ class SchemaShell extends Shell {
);
$force = array(
'short' => 'f',
'help' => __('Force "generate" to create a new schema'),
'help' => __d('cake', 'Force "generate" to create a new schema'),
'boolean' => true
);
$write = array(
'help' => __('Write the dumped SQL to a file.')
'help' => __d('cake', 'Write the dumped SQL to a file.')
);
$parser = parent::getOptionParser();
@ -475,42 +475,42 @@ class SchemaShell extends Shell {
'arguments' => compact('name')
)
))->addSubcommand('generate', array(
'help' => __('Reads from --connection and writes to --path. Generate snapshots with -s'),
'help' => __d('cake', 'Reads from --connection and writes to --path. Generate snapshots with -s'),
'parser' => array(
'options' => compact('plugin', 'path', 'file', 'name', 'connection', 'snapshot', 'force'),
'arguments' => array(
'snapshot' => array('help' => __('Generate a snapshot.'))
'snapshot' => array('help' => __d('cake', 'Generate a snapshot.'))
)
)
))->addSubcommand('dump', array(
'help' => __('Dump database SQL based on a schema file to stdout.'),
'help' => __d('cake', 'Dump database SQL based on a schema file to stdout.'),
'parser' => array(
'options' => compact('plugin', 'path', 'file', 'name', 'connection'),
'arguments' => compact('name')
)
))->addSubcommand('create', array(
'help' => __('Drop and create tables based on the schema file.'),
'help' => __d('cake', 'Drop and create tables based on the schema file.'),
'parser' => array(
'options' => compact('plugin', 'path', 'file', 'name', 'connection', 'dry', 'snapshot'),
'args' => array(
'name' => array(
'help' => __('Name of schema to use.')
'help' => __d('cake', 'Name of schema to use.')
),
'table' => array(
'help' => __('Only create the specified table.')
'help' => __d('cake', 'Only create the specified table.')
)
)
)
))->addSubcommand('update', array(
'help' => __('Alter the tables based on the schema file.'),
'help' => __d('cake', 'Alter the tables based on the schema file.'),
'parser' => array(
'options' => compact('plugin', 'path', 'file', 'name', 'connection', 'dry', 'snapshot'),
'args' => array(
'name' => array(
'help' => __('Name of schema to use.')
'help' => __d('cake', 'Name of schema to use.')
),
'table' => array(
'help' => __('Only create the specified table.')
'help' => __d('cake', 'Only create the specified table.')
)
)
)

View file

@ -71,13 +71,13 @@ class ControllerTask extends BakeTask {
$actions = '';
if (!empty($this->params['public'])) {
$this->out(__('Baking basic crud methods for ') . $controller);
$this->out(__d('cake', 'Baking basic crud methods for ') . $controller);
$actions .= $this->bakeActions($controller);
}
if (!empty($this->params['admin'])) {
$admin = $this->Project->getPrefix();
if ($admin) {
$this->out(__('Adding %s methods', $admin));
$this->out(__d('cake', 'Adding %s methods', $admin));
$actions .= "\n" . $this->bakeActions($controller, $admin);
}
}
@ -124,7 +124,7 @@ class ControllerTask extends BakeTask {
protected function _interactive() {
$this->interactive = true;
$this->hr();
$this->out(__("Bake Controller\nPath: %s", $this->path));
$this->out(__d('cake', "Bake Controller\nPath: %s", $this->path));
$this->hr();
if (empty($this->connection)) {
@ -133,7 +133,7 @@ class ControllerTask extends BakeTask {
$controllerName = $this->getName();
$this->hr();
$this->out(__('Baking %sController', $controllerName));
$this->out(__d('cake', 'Baking %sController', $controllerName));
$this->hr();
$helpers = $components = array();
@ -144,16 +144,16 @@ class ControllerTask extends BakeTask {
$wannaBakeCrud = 'y';
$question[] = __("Would you like to build your controller interactively?");
$question[] = __d('cake', "Would you like to build your controller interactively?");
if (file_exists($this->path . $controllerName .'Controller.php')) {
$question[] = __("Warning: Choosing no will overwrite the %sController.", $controllerName);
$question[] = __d('cake', "Warning: Choosing no will overwrite the %sController.", $controllerName);
}
$doItInteractive = $this->in(implode("\n", $question), array('y','n'), 'y');
if (strtolower($doItInteractive) == 'y') {
$this->interactive = true;
$useDynamicScaffold = $this->in(
__("Would you like to use dynamic scaffolding?"), array('y','n'), 'n'
__d('cake', "Would you like to use dynamic scaffolding?"), array('y','n'), 'n'
);
if (strtolower($useDynamicScaffold) == 'y') {
@ -166,7 +166,7 @@ class ControllerTask extends BakeTask {
$components = $this->doComponents();
$wannaUseSession = $this->in(
__("Would you like to use Session flash messages?"), array('y','n'), 'y'
__d('cake', "Would you like to use Session flash messages?"), array('y','n'), 'y'
);
}
} else {
@ -184,7 +184,7 @@ class ControllerTask extends BakeTask {
$baked = false;
if ($this->interactive === true) {
$this->confirmController($controllerName, $useDynamicScaffold, $helpers, $components);
$looksGood = $this->in(__('Look okay?'), array('y','n'), 'y');
$looksGood = $this->in(__d('cake', 'Look okay?'), array('y','n'), 'y');
if (strtolower($looksGood) == 'y') {
$baked = $this->bake($controllerName, $actions, $helpers, $components);
@ -209,17 +209,17 @@ class ControllerTask extends BakeTask {
public function confirmController($controllerName, $useDynamicScaffold, $helpers, $components) {
$this->out();
$this->hr();
$this->out(__('The following controller will be created:'));
$this->out(__d('cake', 'The following controller will be created:'));
$this->hr();
$this->out(__("Controller Name:\n\t%s", $controllerName));
$this->out(__d('cake', "Controller Name:\n\t%s", $controllerName));
if (strtolower($useDynamicScaffold) == 'y') {
$this->out("var \$scaffold;");
}
$properties = array(
'helpers' => __('Helpers:'),
'components' => __('Components:'),
'helpers' => __d('cake', 'Helpers:'),
'components' => __d('cake', 'Components:'),
);
foreach ($properties as $var => $title) {
@ -246,11 +246,11 @@ class ControllerTask extends BakeTask {
*/
protected function _askAboutMethods() {
$wannaBakeCrud = $this->in(
__("Would you like to create some basic class methods \n(index(), add(), view(), edit())?"),
__d('cake', "Would you like to create some basic class methods \n(index(), add(), view(), edit())?"),
array('y','n'), 'n'
);
$wannaBakeAdminCrud = $this->in(
__("Would you like to create the basic class methods for admin routing?"),
__d('cake', "Would you like to create the basic class methods for admin routing?"),
array('y','n'), 'n'
);
return array($wannaBakeCrud, $wannaBakeAdminCrud);
@ -273,7 +273,7 @@ class ControllerTask extends BakeTask {
}
App::uses($modelImport, $plugin . 'Model');
if (!class_exists($modelImport)) {
$this->err(__('You must have a model for this class to build basic methods. Please try again.'));
$this->err(__d('cake', 'You must have a model for this class to build basic methods. Please try again.'));
$this->_stop();
}
@ -287,7 +287,7 @@ class ControllerTask extends BakeTask {
$primaryKey = $modelObj->primaryKey;
$this->Template->set(compact('plugin', 'admin', 'controllerPath', 'pluralName', 'singularName',
'singularHumanName', 'pluralHumanName', 'modelObj', 'wannaUseSession', 'currentModelName',
'singularHumanName', 'pluralHumanName', 'modelObj', 'wannaUseSession', 'currentModelName',
'displayField', 'primaryKey'
));
$actions = $this->Template->generate('actions', 'controller_actions');
@ -341,8 +341,8 @@ class ControllerTask extends BakeTask {
*/
public function doHelpers() {
return $this->_doPropertyChoices(
__("Would you like this controller to use other helpers\nbesides HtmlHelper and FormHelper?"),
__("Please provide a comma separated list of the other\nhelper names you'd like to use.\nExample: 'Ajax, Javascript, Time'")
__d('cake', "Would you like this controller to use other helpers\nbesides HtmlHelper and FormHelper?"),
__d('cake', "Please provide a comma separated list of the other\nhelper names you'd like to use.\nExample: 'Ajax, Javascript, Time'")
);
}
@ -353,8 +353,8 @@ class ControllerTask extends BakeTask {
*/
public function doComponents() {
return $this->_doPropertyChoices(
__("Would you like this controller to use any components?"),
__("Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, Security, RequestHandler'")
__d('cake', "Would you like this controller to use any components?"),
__d('cake', "Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, Security, RequestHandler'")
);
}
@ -390,7 +390,7 @@ class ControllerTask extends BakeTask {
$this->__tables = $this->Model->getAllTables($useDbConfig);
if ($this->interactive == true) {
$this->out(__('Possible Controllers based on your current database:'));
$this->out(__d('cake', 'Possible Controllers based on your current database:'));
$this->_controllerNames = array();
$count = count($this->__tables);
for ($i = 0; $i < $count; $i++) {
@ -413,14 +413,14 @@ class ControllerTask extends BakeTask {
$enteredController = '';
while ($enteredController == '') {
$enteredController = $this->in(__("Enter a number from the list above,\ntype in the name of another controller, or 'q' to exit"), null, 'q');
$enteredController = $this->in(__d('cake', "Enter a number from the list above,\ntype in the name of another controller, or 'q' to exit"), null, 'q');
if ($enteredController === 'q') {
$this->out(__('Exit'));
$this->out(__d('cake', 'Exit'));
return $this->_stop();
}
if ($enteredController == '' || intval($enteredController) > count($controllers)) {
$this->err(__("The Controller name you supplied was empty,\nor the number you selected was not an option. Please try again."));
$this->err(__d('cake', "The Controller name you supplied was empty,\nor the number you selected was not an option. Please try again."));
$enteredController = '';
}
}
@ -441,24 +441,24 @@ class ControllerTask extends BakeTask {
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(
__('Bake a controller for a model. Using options you can bake public, admin or both.')
__d('cake', 'Bake a controller for a model. Using options you can bake public, admin or both.')
)->addArgument('name', array(
'help' => __('Name of the controller to bake. Can use Plugin.name to bake controllers into plugins.')
'help' => __d('cake', 'Name of the controller to bake. Can use Plugin.name to bake controllers into plugins.')
))->addOption('public', array(
'help' => __('Bake a controller with basic crud actions (index, view, add, edit, delete).'),
'help' => __d('cake', 'Bake a controller with basic crud actions (index, view, add, edit, delete).'),
'boolean' => true
))->addOption('admin', array(
'help' => __('Bake a controller with crud actions for one of the Routing.prefixes.'),
'help' => __d('cake', 'Bake a controller with crud actions for one of the Routing.prefixes.'),
'boolean' => true
))->addOption('plugin', array(
'short' => 'p',
'help' => __('Plugin to bake the controller into.')
'help' => __d('cake', 'Plugin to bake the controller into.')
))->addOption('connection', array(
'short' => 'c',
'help' => __('The connection the controller\'s model is on.')
'help' => __d('cake', 'The connection the controller\'s model is on.')
))->addSubcommand('all', array(
'help' => __('Bake all controllers with CRUD methods.')
))->epilog(__('Omitting all arguments and options will enter into an interactive mode.'));
'help' => __d('cake', 'Bake all controllers with CRUD methods.')
))->epilog(__d('cake', 'Omitting all arguments and options will enter into an interactive mode.'));
}
/**
@ -499,4 +499,4 @@ class ControllerTask extends BakeTask {
$this->out();
$this->_stop();
}
}
}

View file

@ -361,7 +361,7 @@ class DbConfigTask extends Shell {
$connections = array_keys($configs);
if (count($connections) > 1) {
$useDbConfig = $this->in(__('Use Database Config') .':', $connections, 'default');
$useDbConfig = $this->in(__d('cake', 'Use Database Config') .':', $connections, 'default');
}
return $useDbConfig;
}
@ -374,7 +374,7 @@ class DbConfigTask extends Shell {
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(
__('Bake new database configuration settings.')
__d('cake', 'Bake new database configuration settings.')
);
}
}

View file

@ -112,11 +112,11 @@ class ExtractTask extends Shell {
$this->__paths = explode(',', $this->params['paths']);
} else {
$defaultPath = APP_PATH;
$message = __("What is the full path you would like to extract?\nExample: %s\n[Q]uit [D]one", $defaultPath);
$message = __d('cake', "What is the full path you would like to extract?\nExample: %s\n[Q]uit [D]one", $defaultPath);
while (true) {
$response = $this->in($message, null, $defaultPath);
if (strtoupper($response) === 'Q') {
$this->out(__('Extract Aborted'));
$this->out(__d('cake', 'Extract Aborted'));
$this->_stop();
} elseif (strtoupper($response) === 'D') {
$this->out();
@ -125,7 +125,7 @@ class ExtractTask extends Shell {
$this->__paths[] = $response;
$defaultPath = 'D';
} else {
$this->err(__('The directory path you supplied was not found. Please try again.'));
$this->err(__d('cake', 'The directory path you supplied was not found. Please try again.'));
}
$this->out();
}
@ -134,17 +134,17 @@ class ExtractTask extends Shell {
if (isset($this->params['output'])) {
$this->__output = $this->params['output'];
} else {
$message = __("What is the full path you would like to output?\nExample: %s\n[Q]uit", $this->__paths[0] . DS . 'locale');
$message = __d('cake', "What is the full path you would like to output?\nExample: %s\n[Q]uit", $this->__paths[0] . DS . 'locale');
while (true) {
$response = $this->in($message, null, $this->__paths[0] . DS . 'locale');
if (strtoupper($response) === 'Q') {
$this->out(__('Extract Aborted'));
$this->out(__d('cake', 'Extract Aborted'));
$this->_stop();
} elseif (is_dir($response)) {
$this->__output = $response . DS;
break;
} else {
$this->err(__('The directory path you supplied was not found. Please try again.'));
$this->err(__d('cake', 'The directory path you supplied was not found. Please try again.'));
}
$this->out();
}
@ -154,7 +154,7 @@ class ExtractTask extends Shell {
$this->__merge = !(strtolower($this->params['merge']) === 'no');
} else {
$this->out();
$response = $this->in(__('Would you like to merge all domains strings into the default.pot file?'), array('y', 'n'), 'n');
$response = $this->in(__d('cake', 'Would you like to merge all domains strings into the default.pot file?'), array('y', 'n'), 'n');
$this->__merge = strtolower($response) === 'y';
}
@ -173,13 +173,13 @@ class ExtractTask extends Shell {
function __extract() {
$this->out();
$this->out();
$this->out(__('Extracting...'));
$this->out(__d('cake', 'Extracting...'));
$this->hr();
$this->out(__('Paths:'));
$this->out(__d('cake', 'Paths:'));
foreach ($this->__paths as $path) {
$this->out(' ' . $path);
}
$this->out(__('Output Directory: ') . $this->__output);
$this->out(__d('cake', 'Output Directory: ') . $this->__output);
$this->hr();
$this->__extractTokens();
$this->__buildFiles();
@ -187,7 +187,7 @@ class ExtractTask extends Shell {
$this->__paths = $this->__files = $this->__storage = array();
$this->__strings = $this->__tokens = array();
$this->out();
$this->out(__('Done.'));
$this->out(__d('cake', 'Done.'));
}
/**
@ -197,17 +197,17 @@ class ExtractTask extends Shell {
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(__('CakePHP Language String Extraction:'))
->addOption('app', array('help' => __('Directory where your application is located.')))
->addOption('paths', array('help' => __('Comma separted list of paths, full paths are needed.')))
return $parser->description(__d('cake', 'CakePHP Language String Extraction:'))
->addOption('app', array('help' => __d('cake', 'Directory where your application is located.')))
->addOption('paths', array('help' => __d('cake', 'Comma separted list of paths, full paths are needed.')))
->addOption('merge', array(
'help' => __('Merge all domain strings into the default.po file.'),
'help' => __d('cake', 'Merge all domain strings into the default.po file.'),
'choices' => array('yes', 'no')
))
->addOption('output', array('help' => __('Full path to output directory.')))
->addOption('files', array('help' => __('Comma separated list of files, full paths are needed.')))
->addOption('output', array('help' => __d('cake', 'Full path to output directory.')))
->addOption('files', array('help' => __d('cake', 'Comma separated list of files, full paths are needed.')))
->addOption('exclude', array(
'help' => __('Comma separated list of directories to exclude. Any path containing a path segment with the provided values will be skipped. E.g. test,vendors')
'help' => __d('cake', 'Comma separated list of directories to exclude. Any path containing a path segment with the provided values will be skipped. E.g. test,vendors')
));
}
@ -217,25 +217,25 @@ class ExtractTask extends Shell {
* @return void
*/
public function help() {
$this->out(__('CakePHP Language String Extraction:'));
$this->out(__d('cake', 'CakePHP Language String Extraction:'));
$this->hr();
$this->out(__('The Extract script generates .pot file(s) with translations'));
$this->out(__('By default the .pot file(s) will be place in the locale directory of -app'));
$this->out(__('By default -app is ROOT/app'));
$this->out(__d('cake', 'The Extract script generates .pot file(s) with translations'));
$this->out(__d('cake', 'By default the .pot file(s) will be place in the locale directory of -app'));
$this->out(__d('cake', 'By default -app is ROOT/app'));
$this->hr();
$this->out(__('Usage: cake i18n extract <command> <param1> <param2>...'));
$this->out(__d('cake', 'Usage: cake i18n extract <command> <param1> <param2>...'));
$this->out();
$this->out(__('Params:'));
$this->out(__(' -app [path...]: directory where your application is located'));
$this->out(__(' -root [path...]: path to install'));
$this->out(__(' -core [path...]: path to cake directory'));
$this->out(__(' -paths [comma separated list of paths, full path is needed]'));
$this->out(__(' -merge [yes|no]: Merge all domains strings into the default.pot file'));
$this->out(__(' -output [path...]: Full path to output directory'));
$this->out(__(' -files: [comma separated list of files, full path to file is needed]'));
$this->out(__d('cake', 'Params:'));
$this->out(__d('cake', ' -app [path...]: directory where your application is located'));
$this->out(__d('cake', ' -root [path...]: path to install'));
$this->out(__d('cake', ' -core [path...]: path to cake directory'));
$this->out(__d('cake', ' -paths [comma separated list of paths, full path is needed]'));
$this->out(__d('cake', ' -merge [yes|no]: Merge all domains strings into the default.pot file'));
$this->out(__d('cake', ' -output [path...]: Full path to output directory'));
$this->out(__d('cake', ' -files: [comma separated list of files, full path to file is needed]'));
$this->out();
$this->out(__('Commands:'));
$this->out(__(' cake i18n extract help: Shows this help message.'));
$this->out(__d('cake', 'Commands:'));
$this->out(__d('cake', ' cake i18n extract help: Shows this help message.'));
$this->out();
}
@ -248,7 +248,7 @@ class ExtractTask extends Shell {
function __extractTokens() {
foreach ($this->__files as $file) {
$this->__file = $file;
$this->out(__('Processing %s...', $file));
$this->out(__d('cake', 'Processing %s...', $file));
$code = file_get_contents($file);
$allTokens = token_get_all($code);
@ -411,11 +411,11 @@ class ExtractTask extends Shell {
$response = '';
while ($overwriteAll === false && $File->exists() && strtoupper($response) !== 'Y') {
$this->out();
$response = $this->in(__('Error: %s already exists in this location. Overwrite? [Y]es, [N]o, [A]ll', $filename), array('y', 'n', 'a'), 'y');
$response = $this->in(__d('cake', 'Error: %s already exists in this location. Overwrite? [Y]es, [N]o, [A]ll', $filename), array('y', 'n', 'a'), 'y');
if (strtoupper($response) === 'N') {
$response = '';
while ($response == '') {
$response = $this->in(__("What would you like to name this file?\nExample: %s", 'new_' . $filename), null, 'new_' . $filename);
$response = $this->in(__d('cake', "What would you like to name this file?\nExample: %s", 'new_' . $filename), null, 'new_' . $filename);
$File = new File($this->__output . $response);
$filename = $response;
}
@ -483,7 +483,7 @@ class ExtractTask extends Shell {
* @access private
*/
function __markerError($file, $line, $marker, $count) {
$this->out(__("Invalid marker content in %s:%s\n* %s(", $file, $line, $marker), true);
$this->out(__d('cake', "Invalid marker content in %s:%s\n* %s(", $file, $line, $marker), true);
$count += 2;
$tokenCount = count($this->__tokens);
$parenthesis = 1;

View file

@ -68,25 +68,25 @@ class FixtureTask extends BakeTask {
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(
__('Generate fixtures for use with the test suite. You can use `bake fixture all` to bake all fixtures.')
__d('cake', 'Generate fixtures for use with the test suite. You can use `bake fixture all` to bake all fixtures.')
)->addArgument('name', array(
'help' => __('Name of the fixture to bake. Can use Plugin.name to bake plugin fixtures.')
'help' => __d('cake', 'Name of the fixture to bake. Can use Plugin.name to bake plugin fixtures.')
))->addOption('count', array(
'help' => __('When using generated data, the number of records to include in the fixture(s).'),
'help' => __d('cake', 'When using generated data, the number of records to include in the fixture(s).'),
'short' => 'n',
'default' => 10
))->addOption('connection', array(
'help' => __('Which database configuration to use for baking.'),
'help' => __d('cake', 'Which database configuration to use for baking.'),
'short' => 'c',
'default' => 'default'
))->addOption('plugin', array(
'help' => __('CamelCased name of the plugin to bake fixtures for.'),
'help' => __d('cake', 'CamelCased name of the plugin to bake fixtures for.'),
'short' => 'p',
))->addOption('records', array(
'help' => 'Used with --count and <name>/all commands to pull [n] records from the live tables, where [n] is either --count or the default of 10',
'short' => 'r',
'boolean' => true
))->epilog(__('Omitting all arguments and options will enter into an interactive mode.'));;
))->epilog(__d('cake', 'Omitting all arguments and options will enter into an interactive mode.'));;
}
/**
@ -158,16 +158,16 @@ class FixtureTask extends BakeTask {
*/
public function importOptions($modelName) {
$options = array();
$doSchema = $this->in(__('Would you like to import schema for this fixture?'), array('y', 'n'), 'n');
$doSchema = $this->in(__d('cake', 'Would you like to import schema for this fixture?'), array('y', 'n'), 'n');
if ($doSchema == 'y') {
$options['schema'] = $modelName;
}
$doRecords = $this->in(__('Would you like to use record importing for this fixture?'), array('y', 'n'), 'n');
$doRecords = $this->in(__d('cake', 'Would you like to use record importing for this fixture?'), array('y', 'n'), 'n');
if ($doRecords == 'y') {
$options['records'] = true;
}
if ($doRecords == 'n') {
$prompt = __("Would you like to build this fixture with data from %s's table?", $modelName);
$prompt = __d('cake', "Would you like to build this fixture with data from %s's table?", $modelName);
$fromTable = $this->in($prompt, array('y', 'n'), 'n');
if (strtolower($fromTable) == 'y') {
$options['fromTable'] = true;
@ -387,7 +387,7 @@ class FixtureTask extends BakeTask {
protected function _getRecordsFromTable($modelName, $useTable = null) {
if ($this->interactive) {
$condition = null;
$prompt = __("Please provide a SQL fragment to use as conditions\nExample: WHERE 1=1 LIMIT 10");
$prompt = __d('cake', "Please provide a SQL fragment to use as conditions\nExample: WHERE 1=1 LIMIT 10");
while (!$condition) {
$condition = $this->in($prompt, null, 'WHERE 1=1 LIMIT 10');
}

View file

@ -112,7 +112,7 @@ class ModelTask extends BakeTask {
continue;
}
$modelClass = Inflector::classify($table);
$this->out(__('Baking %s', $modelClass));
$this->out(__d('cake', 'Baking %s', $modelClass));
$object = $this->_getModelObject($modelClass);
if ($this->bake($object, false) && $unitTestExists) {
$this->bakeFixture($modelClass);
@ -151,7 +151,7 @@ class ModelTask extends BakeTask {
$this->out($i + 1 .'. ' . $option);
}
if (empty($prompt)) {
$prompt = __('Make a selection from the choices above');
$prompt = __d('cake', 'Make a selection from the choices above');
}
$choice = $this->in($prompt, null, $default);
if (intval($choice) > 0 && intval($choice) <= $max) {
@ -190,7 +190,7 @@ class ModelTask extends BakeTask {
$primaryKey = $this->findPrimaryKey($fields);
}
} else {
$this->err(__('Table %s does not exist, cannot bake a model without a table.', $useTable));
$this->err(__d('cake', 'Table %s does not exist, cannot bake a model without a table.', $useTable));
$this->_stop();
return false;
}
@ -199,13 +199,13 @@ class ModelTask extends BakeTask {
$displayField = $this->findDisplayField($tempModel->schema());
}
$prompt = __("Would you like to supply validation criteria \nfor the fields in your model?");
$prompt = __d('cake', "Would you like to supply validation criteria \nfor the fields in your model?");
$wannaDoValidation = $this->in($prompt, array('y','n'), 'y');
if (array_search($useTable, $this->_tables) !== false && strtolower($wannaDoValidation) == 'y') {
$validate = $this->doValidation($tempModel);
}
$prompt = __("Would you like to define model associations\n(hasMany, hasOne, belongsTo, etc.)?");
$prompt = __d('cake', "Would you like to define model associations\n(hasMany, hasOne, belongsTo, etc.)?");
$wannaDoAssoc = $this->in($prompt, array('y','n'), 'y');
if (strtolower($wannaDoAssoc) == 'y') {
$associations = $this->doAssociations($tempModel);
@ -213,24 +213,24 @@ class ModelTask extends BakeTask {
$this->out();
$this->hr();
$this->out(__('The following Model will be created:'));
$this->out(__d('cake', 'The following Model will be created:'));
$this->hr();
$this->out("Name: " . $currentModelName);
if ($this->connection !== 'default') {
$this->out(__("DB Config: %s", $this->connection));
$this->out(__d('cake', "DB Config: %s", $this->connection));
}
if ($fullTableName !== Inflector::tableize($currentModelName)) {
$this->out(__('DB Table: %s', $fullTableName));
$this->out(__d('cake', 'DB Table: %s', $fullTableName));
}
if ($primaryKey != 'id') {
$this->out(__('Primary Key: %s', $primaryKey));
$this->out(__d('cake', 'Primary Key: %s', $primaryKey));
}
if (!empty($validate)) {
$this->out(__('Validation: %s', print_r($validate, true)));
$this->out(__d('cake', 'Validation: %s', print_r($validate, true)));
}
if (!empty($associations)) {
$this->out(__('Associations:'));
$this->out(__d('cake', 'Associations:'));
$assocKeys = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
foreach ($assocKeys as $assocKey) {
$this->_printAssociation($currentModelName, $assocKey, $associations);
@ -238,7 +238,7 @@ class ModelTask extends BakeTask {
}
$this->hr();
$looksGood = $this->in(__('Look okay?'), array('y','n'), 'y');
$looksGood = $this->in(__d('cake', 'Look okay?'), array('y','n'), 'y');
if (strtolower($looksGood) == 'y') {
$vars = compact('associations', 'validate', 'primaryKey', 'useTable', 'displayField');
@ -283,7 +283,7 @@ class ModelTask extends BakeTask {
break;
}
}
return $this->in(__('What is the primaryKey?'), null, $name);
return $this->in(__d('cake', 'What is the primaryKey?'), null, $name);
}
/**
@ -294,12 +294,12 @@ class ModelTask extends BakeTask {
*/
public function findDisplayField($fields) {
$fieldNames = array_keys($fields);
$prompt = __("A displayField could not be automatically detected\nwould you like to choose one?");
$prompt = __d('cake', "A displayField could not be automatically detected\nwould you like to choose one?");
$continue = $this->in($prompt, array('y', 'n'));
if (strtolower($continue) == 'n') {
return false;
}
$prompt = __('Choose a field from the options above:');
$prompt = __d('cake', 'Choose a field from the options above:');
$choice = $this->inOptions($fieldNames, $prompt);
return $fieldNames[$choice];
}
@ -367,10 +367,10 @@ class ModelTask extends BakeTask {
while ($anotherValidator == 'y') {
if ($this->interactive) {
$this->out();
$this->out(__('Field: %s', $fieldName));
$this->out(__('Type: %s', $metaData['type']));
$this->out(__d('cake', 'Field: %s', $fieldName));
$this->out(__d('cake', 'Type: %s', $metaData['type']));
$this->hr();
$this->out(__('Please select one of the following validation options:'));
$this->out(__d('cake', 'Please select one of the following validation options:'));
$this->hr();
}
@ -378,8 +378,8 @@ class ModelTask extends BakeTask {
for ($i = 1; $i < $defaultChoice; $i++) {
$prompt .= $i . ' - ' . $this->_validations[$i] . "\n";
}
$prompt .= __("%s - Do not do any validation on this field.\n", $defaultChoice);
$prompt .= __("... or enter in a valid regex validation string.\n");
$prompt .= __d('cake', "%s - Do not do any validation on this field.\n", $defaultChoice);
$prompt .= __d('cake', "... or enter in a valid regex validation string.\n");
$methods = array_flip($this->_validations);
$guess = $defaultChoice;
@ -402,11 +402,11 @@ class ModelTask extends BakeTask {
if ($this->interactive === true) {
$choice = $this->in($prompt, null, $guess);
if (in_array($choice, $alreadyChosen)) {
$this->out(__("You have already chosen that validation rule,\nplease choose again"));
$this->out(__d('cake', "You have already chosen that validation rule,\nplease choose again"));
continue;
}
if (!isset($this->_validations[$choice]) && is_numeric($choice)) {
$this->out(__('Please make a valid selection.'));
$this->out(__d('cake', 'Please make a valid selection.'));
continue;
}
$alreadyChosen[] = $choice;
@ -428,7 +428,7 @@ class ModelTask extends BakeTask {
}
}
if ($this->interactive == true && $choice != $defaultChoice) {
$anotherValidator = $this->in(__('Would you like to add another validation rule?'), array('y', 'n'), 'n');
$anotherValidator = $this->in(__d('cake', 'Would you like to add another validation rule?'), array('y', 'n'), 'n');
} else {
$anotherValidator = 'n';
}
@ -447,7 +447,7 @@ class ModelTask extends BakeTask {
return false;
}
if ($this->interactive === true) {
$this->out(__('One moment while the associations are detected.'));
$this->out(__d('cake', 'One moment while the associations are detected.'));
}
$fields = $model->schema(true);
@ -475,9 +475,9 @@ class ModelTask extends BakeTask {
if ($this->interactive === true) {
$this->hr();
if (empty($associations)) {
$this->out(__('None found.'));
$this->out(__d('cake', 'None found.'));
} else {
$this->out(__('Please confirm the following associations:'));
$this->out(__d('cake', 'Please confirm the following associations:'));
$this->hr();
$associations = $this->confirmAssociations($model, $associations);
}
@ -634,19 +634,19 @@ class ModelTask extends BakeTask {
* @return array Array of associations.
*/
public function doMoreAssociations($model, $associations) {
$prompt = __('Would you like to define some additional model associations?');
$prompt = __d('cake', 'Would you like to define some additional model associations?');
$wannaDoMoreAssoc = $this->in($prompt, array('y','n'), 'n');
$possibleKeys = $this->_generatePossibleKeys();
while (strtolower($wannaDoMoreAssoc) == 'y') {
$assocs = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
$this->out(__('What is the association type?'));
$assocType = intval($this->inOptions($assocs, __('Enter a number')));
$this->out(__d('cake', 'What is the association type?'));
$assocType = intval($this->inOptions($assocs, __d('cake', 'Enter a number')));
$this->out(__("For the following options be very careful to match your setup exactly.\nAny spelling mistakes will cause errors."));
$this->out(__d('cake', "For the following options be very careful to match your setup exactly.\nAny spelling mistakes will cause errors."));
$this->hr();
$alias = $this->in(__('What is the alias for this association?'));
$className = $this->in(__('What className will %s use?', $alias), null, $alias );
$alias = $this->in(__d('cake', 'What is the alias for this association?'));
$className = $this->in(__d('cake', 'What className will %s use?', $alias), null, $alias );
$suggestedForeignKey = null;
if ($assocType == 0) {
@ -661,22 +661,22 @@ class ModelTask extends BakeTask {
$showKeys = null;
}
} else {
$otherTable = $this->in(__('What is the table for this model?'));
$otherTable = $this->in(__d('cake', 'What is the table for this model?'));
$showKeys = $possibleKeys[$otherTable];
}
$suggestedForeignKey = $this->_modelKey($model->name);
}
if (!empty($showKeys)) {
$this->out(__('A helpful List of possible keys'));
$foreignKey = $this->inOptions($showKeys, __('What is the foreignKey?'));
$this->out(__d('cake', 'A helpful List of possible keys'));
$foreignKey = $this->inOptions($showKeys, __d('cake', 'What is the foreignKey?'));
$foreignKey = $showKeys[intval($foreignKey)];
}
if (!isset($foreignKey)) {
$foreignKey = $this->in(__('What is the foreignKey? Specify your own.'), null, $suggestedForeignKey);
$foreignKey = $this->in(__d('cake', 'What is the foreignKey? Specify your own.'), null, $suggestedForeignKey);
}
if ($assocType == 3) {
$associationForeignKey = $this->in(__('What is the associationForeignKey?'), null, $this->_modelKey($model->name));
$joinTable = $this->in(__('What is the joinTable?'));
$associationForeignKey = $this->in(__d('cake', 'What is the associationForeignKey?'), null, $this->_modelKey($model->name));
$joinTable = $this->in(__d('cake', 'What is the joinTable?'));
}
$associations[$assocs[$assocType]] = array_values((array)$associations[$assocs[$assocType]]);
$count = count($associations[$assocs[$assocType]]);
@ -688,7 +688,7 @@ class ModelTask extends BakeTask {
$associations[$assocs[$assocType]][$i]['associationForeignKey'] = $associationForeignKey;
$associations[$assocs[$assocType]][$i]['joinTable'] = $joinTable;
}
$wannaDoMoreAssoc = $this->in(__('Define another association?'), array('y','n'), 'y');
$wannaDoMoreAssoc = $this->in(__d('cake', 'Define another association?'), array('y','n'), 'y');
}
return $associations;
}
@ -769,7 +769,7 @@ class ModelTask extends BakeTask {
$this->_tables = $this->getAllTables($useDbConfig);
if ($this->interactive === true) {
$this->out(__('Possible Models based on your current database:'));
$this->out(__d('cake', 'Possible Models based on your current database:'));
$this->_modelNames = array();
$count = count($this->_tables);
for ($i = 0; $i < $count; $i++) {
@ -799,11 +799,11 @@ class ModelTask extends BakeTask {
if (array_search($useTable, $this->_tables) === false) {
$this->out();
$this->out(__("Given your model named '%s',\nCake would expect a database table named '%s'", $modelName, $fullTableName));
$tableIsGood = $this->in(__('Do you want to use this table?'), array('y','n'), 'y');
$this->out(__d('cake', "Given your model named '%s',\nCake would expect a database table named '%s'", $modelName, $fullTableName));
$tableIsGood = $this->in(__d('cake', 'Do you want to use this table?'), array('y','n'), 'y');
}
if (strtolower($tableIsGood) == 'n') {
$useTable = $this->in(__('What is the name of the table?'));
$useTable = $this->in(__d('cake', 'What is the name of the table?'));
}
return $useTable;
}
@ -834,7 +834,7 @@ class ModelTask extends BakeTask {
$tables = $db->listSources();
}
if (empty($tables)) {
$this->err(__('Your database does not have any tables.'));
$this->err(__d('cake', 'Your database does not have any tables.'));
$this->_stop();
}
return $tables;
@ -851,15 +851,15 @@ class ModelTask extends BakeTask {
$enteredModel = '';
while ($enteredModel == '') {
$enteredModel = $this->in(__("Enter a number from the list above,\ntype in the name of another model, or 'q' to exit"), null, 'q');
$enteredModel = $this->in(__d('cake', "Enter a number from the list above,\ntype in the name of another model, or 'q' to exit"), null, 'q');
if ($enteredModel === 'q') {
$this->out(__('Exit'));
$this->out(__d('cake', 'Exit'));
$this->_stop();
}
if ($enteredModel == '' || intval($enteredModel) > count($this->_modelNames)) {
$this->err(__("The model name you supplied was empty,\nor the number you selected was not an option. Please try again."));
$this->err(__d('cake', "The model name you supplied was empty,\nor the number you selected was not an option. Please try again."));
$enteredModel = '';
}
}
@ -879,18 +879,18 @@ class ModelTask extends BakeTask {
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(
__('Bake models.')
__d('cake', 'Bake models.')
)->addArgument('name', array(
'help' => __('Name of the model to bake. Can use Plugin.name to bake plugin models.')
'help' => __d('cake', 'Name of the model to bake. Can use Plugin.name to bake plugin models.')
))->addSubcommand('all', array(
'help' => __('Bake all model files with associations and validation.')
'help' => __d('cake', 'Bake all model files with associations and validation.')
))->addOption('plugin', array(
'short' => 'p',
'help' => __('Plugin to bake the model into.')
'help' => __d('cake', 'Plugin to bake the model into.')
))->addOption('connection', array(
'short' => 'c',
'help' => __('The connection the model table is on.')
))->epilog(__('Omitting all arguments and options will enter into an interactive mode.'));
'help' => __d('cake', 'The connection the model table is on.')
))->epilog(__d('cake', 'Omitting all arguments and options will enter into an interactive mode.'));
}
/**

View file

@ -56,8 +56,8 @@ class PluginTask extends Shell {
$plugin = Inflector::camelize($this->args[0]);
$pluginPath = $this->_pluginPath($plugin);
if (is_dir($pluginPath)) {
$this->out(__('Plugin: %s', $plugin));
$this->out(__('Path: %s', $pluginPath));
$this->out(__d('cake', 'Plugin: %s', $plugin));
$this->out(__d('cake', 'Path: %s', $pluginPath));
} else {
$this->_interactive($plugin);
}
@ -74,11 +74,11 @@ class PluginTask extends Shell {
*/
protected function _interactive($plugin = null) {
while ($plugin === null) {
$plugin = $this->in(__('Enter the name of the plugin in CamelCase format'));
$plugin = $this->in(__d('cake', 'Enter the name of the plugin in CamelCase format'));
}
if (!$this->bake($plugin)) {
$this->error(__("An error occured trying to bake: %s in %s", $plugin, $this->path . Inflector::underscore($pluginPath)));
$this->error(__d('cake', "An error occured trying to bake: %s in %s", $plugin, $this->path . Inflector::underscore($pluginPath)));
}
}
@ -97,11 +97,11 @@ class PluginTask extends Shell {
$this->findPath($pathOptions);
}
$this->hr();
$this->out(__("<info>Plugin Name:</info> %s", $plugin));
$this->out(__("<info>Plugin Directory:</info> %s", $this->path . $pluginPath));
$this->out(__d('cake', "<info>Plugin Name:</info> %s", $plugin));
$this->out(__d('cake', "<info>Plugin Directory:</info> %s", $this->path . $pluginPath));
$this->hr();
$looksGood = $this->in(__('Look okay?'), array('y', 'n', 'q'), 'y');
$looksGood = $this->in(__d('cake', 'Look okay?'), array('y', 'n', 'q'), 'y');
if (strtolower($looksGood) == 'y') {
$Folder = new Folder($this->path . $pluginPath);
@ -156,7 +156,7 @@ class PluginTask extends Shell {
$this->createFile($this->path . $pluginPath . DS . $modelFileName, $out);
$this->hr();
$this->out(__('<success>Created:</success> %s in %s', $plugin, $this->path . $pluginPath), 2);
$this->out(__d('cake', '<success>Created:</success> %s in %s', $plugin, $this->path . $pluginPath), 2);
}
return true;
@ -174,7 +174,7 @@ class PluginTask extends Shell {
foreach ($pathOptions as $i => $option) {
$this->out($i + 1 .'. ' . $option);
}
$prompt = __('Choose a plugin path from the paths above.');
$prompt = __d('cake', 'Choose a plugin path from the paths above.');
$choice = $this->in($prompt);
if (intval($choice) > 0 && intval($choice) <= $max) {
$valid = true;
@ -194,7 +194,7 @@ class PluginTask extends Shell {
'Create the directory structure, AppModel and AppController classes for a new plugin. ' .
'Can create plugins in any of your bootstrapped plugin paths.'
)->addArgument('name', array(
'help' => __('CamelCased name of the plugin to create.')
'help' => __d('cake', 'CamelCased name of the plugin to create.')
));
}

View file

@ -53,7 +53,7 @@ class ProjectTask extends Shell {
}
while (!$project) {
$prompt = __("What is the full path for this app including the app directory name?\n Example:");
$prompt = __d('cake', "What is the full path for this app including the app directory name?\n Example:");
$default = APP_PATH . 'myapp';
$project = $this->in($prompt . $default, null, $default);
}
@ -61,7 +61,7 @@ class ProjectTask extends Shell {
if ($project) {
$response = false;
while ($response == false && is_dir($project) === true && file_exists($project . 'config' . 'core.php')) {
$prompt = __('<warning>A project already exists in this location:</warning> %s Overwrite?', $project);
$prompt = __d('cake', '<warning>A project already exists in this location:</warning> %s Overwrite?', $project);
$response = $this->in($prompt, array('y','n'), 'n');
if (strtolower($response) === 'n') {
$response = $project = false;
@ -73,51 +73,51 @@ class ProjectTask extends Shell {
if ($this->bake($project)) {
$path = Folder::slashTerm($project);
if ($this->createHome($path)) {
$this->out(__(' * Welcome page created'));
$this->out(__d('cake', ' * Welcome page created'));
} else {
$this->err(__('The Welcome page was <error>NOT</error> created'));
$this->err(__d('cake', 'The Welcome page was <error>NOT</error> created'));
$success = false;
}
if ($this->securitySalt($path) === true) {
$this->out(__(' * Random hash key created for \'Security.salt\''));
$this->out(__d('cake', ' * Random hash key created for \'Security.salt\''));
} else {
$this->err(__('Unable to generate random hash for \'Security.salt\', you should change it in %s', CONFIGS . 'core.php'));
$this->err(__d('cake', 'Unable to generate random hash for \'Security.salt\', you should change it in %s', CONFIGS . 'core.php'));
$success = false;
}
if ($this->securityCipherSeed($path) === true) {
$this->out(__(' * Random seed created for \'Security.cipherSeed\''));
$this->out(__d('cake', ' * Random seed created for \'Security.cipherSeed\''));
} else {
$this->err(__('Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', CONFIGS . 'core.php'));
$this->err(__d('cake', 'Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', CONFIGS . 'core.php'));
$success = false;
}
if ($this->corePath($path) === true) {
$this->out(__(' * CAKE_CORE_INCLUDE_PATH set to %s in webroot/index.php', CAKE_CORE_INCLUDE_PATH));
$this->out(__(' * CAKE_CORE_INCLUDE_PATH set to %s in webroot/test.php', CAKE_CORE_INCLUDE_PATH));
$this->out(__(' * <warning>Remember to check these value after moving to production server</warning>'));
$this->out(__d('cake', ' * CAKE_CORE_INCLUDE_PATH set to %s in webroot/index.php', CAKE_CORE_INCLUDE_PATH));
$this->out(__d('cake', ' * CAKE_CORE_INCLUDE_PATH set to %s in webroot/test.php', CAKE_CORE_INCLUDE_PATH));
$this->out(__d('cake', ' * <warning>Remember to check these value after moving to production server</warning>'));
} else {
$this->err(__('Unable to set CAKE_CORE_INCLUDE_PATH, you should change it in %s', $path . 'webroot' .DS .'index.php'));
$this->err(__d('cake', 'Unable to set CAKE_CORE_INCLUDE_PATH, you should change it in %s', $path . 'webroot' .DS .'index.php'));
$success = false;
}
if ($this->consolePath($path) === true) {
$this->out(__(' * app/console/cake.php path set.'));
$this->out(__d('cake', ' * app/console/cake.php path set.'));
} else {
$this->err(__('Unable to set console path for app/console.'));
$this->err(__d('cake', 'Unable to set console path for app/console.'));
$success = false;
}
$Folder = new Folder($path);
if (!$Folder->chmod($path . 'tmp', 0777)) {
$this->err(__('Could not set permissions on %s', $path . DS .'tmp'));
$this->out(__('chmod -R 0777 %s', $path . DS .'tmp'));
$this->err(__d('cake', 'Could not set permissions on %s', $path . DS .'tmp'));
$this->out(__d('cake', 'chmod -R 0777 %s', $path . DS .'tmp'));
$success = false;
}
if ($success) {
$this->out(__('<success>Project baked successfully!</success>'));
$this->out(__d('cake', '<success>Project baked successfully!</success>'));
} else {
$this->out(__('Project baked but with <warning>some issues.</warning>.'));
$this->out(__d('cake', 'Project baked but with <warning>some issues.</warning>.'));
}
return $path;
}
@ -139,23 +139,23 @@ class ProjectTask extends Shell {
$skel = $this->params['skel'];
}
while (!$skel) {
$skel = $this->in(__("What is the path to the directory layout you wish to copy?\nExample: %s", APP, null, ROOT . DS . 'myapp' . DS));
$skel = $this->in(__d('cake', "What is the path to the directory layout you wish to copy?\nExample: %s", APP, null, ROOT . DS . 'myapp' . DS));
if ($skel == '') {
$this->err(__('The directory path you supplied was empty. Please try again.'));
$this->err(__d('cake', 'The directory path you supplied was empty. Please try again.'));
} else {
while (is_dir($skel) === false) {
$skel = $this->in(__('Directory path does not exist please choose another:'));
$skel = $this->in(__d('cake', 'Directory path does not exist please choose another:'));
}
}
}
$app = basename($path);
$this->out(__('<info>Skel Directory</info>: ') . $skel);
$this->out(__('<info>Will be copied to</info>: ') . $path);
$this->out(__d('cake', '<info>Skel Directory</info>: ') . $skel);
$this->out(__d('cake', '<info>Will be copied to</info>: ') . $path);
$this->hr();
$looksGood = $this->in(__('Look okay?'), array('y', 'n', 'q'), 'y');
$looksGood = $this->in(__d('cake', 'Look okay?'), array('y', 'n', 'q'), 'y');
if (strtolower($looksGood) == 'y') {
$Folder = new Folder($skel);
@ -165,10 +165,10 @@ class ProjectTask extends Shell {
if ($Folder->copy(array('to' => $path, 'skip' => $skip))) {
$this->hr();
$this->out(__('<success>Created:</success> %s in %s', $app, $path));
$this->out(__d('cake', '<success>Created:</success> %s in %s', $app, $path));
$this->hr();
} else {
$this->err(__("<error>Could not create</error> '%s' properly.", $app));
$this->err(__d('cake', "<error>Could not create</error> '%s' properly.", $app));
return false;
}
@ -178,7 +178,7 @@ class ProjectTask extends Shell {
return true;
} elseif (strtolower($looksGood) == 'q') {
$this->out(__('Bake Aborted.'));
$this->out(__d('cake', 'Bake Aborted.'));
} else {
$this->execute(false);
return false;
@ -335,7 +335,7 @@ class ProjectTask extends Shell {
}
if ($this->interactive) {
$this->out();
$this->out(__('You have more than one routing prefix configured'));
$this->out(__d('cake', 'You have more than one routing prefix configured'));
}
$options = array();
foreach ($prefixes as $i => $prefix) {
@ -344,19 +344,19 @@ class ProjectTask extends Shell {
$this->out($i + 1 . '. ' . $prefix);
}
}
$selection = $this->in(__('Please choose a prefix to bake with.'), $options, 1);
$selection = $this->in(__d('cake', 'Please choose a prefix to bake with.'), $options, 1);
return $prefixes[$selection - 1] . '_';
}
if ($this->interactive) {
$this->hr();
$this->out('You need to enable Configure::write(\'Routing.prefixes\',array(\'admin\')) in /app/config/core.php to use prefix routing.');
$this->out(__('What would you like the prefix route to be?'));
$this->out(__('Example: www.example.com/admin/controller'));
$this->out(__d('cake', 'What would you like the prefix route to be?'));
$this->out(__d('cake', 'Example: www.example.com/admin/controller'));
while ($admin == '') {
$admin = $this->in(__('Enter a routing prefix:'), null, 'admin');
$admin = $this->in(__d('cake', 'Enter a routing prefix:'), null, 'admin');
}
if ($this->cakeAdmin($admin) !== true) {
$this->out(__('<error>Unable to write to</error> /app/config/core.php.'));
$this->out(__d('cake', '<error>Unable to write to</error> /app/config/core.php.'));
$this->out('You need to enable Configure::write(\'Routing.prefixes\',array(\'admin\')) in /app/config/core.php to use prefix routing.');
$this->_stop();
}
@ -373,15 +373,15 @@ class ProjectTask extends Shell {
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(
__('Generate a new CakePHP project skeleton.')
__d('cake', 'Generate a new CakePHP project skeleton.')
)->addArgument('name', array(
'help' => __('Application directory to make, if it starts with "/" the path is absolute.')
'help' => __d('cake', 'Application directory to make, if it starts with "/" the path is absolute.')
))->addOption('empty', array(
'help' => __('Create empty files in each of the directories. Good if you are using git')
'help' => __d('cake', 'Create empty files in each of the directories. Good if you are using git')
))->addOption('skel', array(
'default' => current(App::core('Console')) . DS . 'templates' . DS . 'skel',
'help' => __('The directory layout to use for the new application skeleton. Defaults to cake/console/templates/skel of CakePHP used to create the project.')
'help' => __d('cake', 'The directory layout to use for the new application skeleton. Defaults to cake/console/templates/skel of CakePHP used to create the project.')
));
}
}
}

View file

@ -170,8 +170,8 @@ class TemplateTask extends Shell {
}
$this->hr();
$this->out(__('You have more than one set of templates installed.'));
$this->out(__('Please choose the template set you wish to use:'));
$this->out(__d('cake', 'You have more than one set of templates installed.'));
$this->out(__d('cake', 'Please choose the template set you wish to use:'));
$this->hr();
$i = 1;
@ -181,7 +181,7 @@ class TemplateTask extends Shell {
$indexedPaths[$i] = $path;
$i++;
}
$index = $this->in(__('Which bake theme would you like to use?'), range(1, $i - 1), 1);
$index = $this->in(__d('cake', 'Which bake theme would you like to use?'), range(1, $i - 1), 1);
$themeNames = array_keys($this->templatePaths);
$this->params['theme'] = $themeNames[$index - 1];
return $indexedPaths[$index];
@ -208,7 +208,7 @@ class TemplateTask extends Shell {
return $templatePath;
}
}
$this->err(__('Could not find template for %s', $filename));
$this->err(__d('cake', 'Could not find template for %s', $filename));
return false;
}
}

View file

@ -89,14 +89,14 @@ class TestTask extends BakeTask {
protected function _interactive($type = null) {
$this->interactive = true;
$this->hr();
$this->out(__('Bake Tests'));
$this->out(__('Path: %s', $this->path));
$this->out(__d('cake', 'Bake Tests'));
$this->out(__d('cake', 'Path: %s', $this->path));
$this->hr();
if ($type) {
$type = Inflector::camelize($type);
if (!in_array($type, $this->classTypes)) {
$this->error(__('Incorrect type provided. Please choose one of %s', implode(', ', $this->classTypes)));
$this->error(__d('cake', 'Incorrect type provided. Please choose one of %s', implode(', ', $this->classTypes)));
}
} else {
$type = $this->getObjectType();
@ -113,7 +113,7 @@ class TestTask extends BakeTask {
*/
public function bake($type, $className) {
if ($this->typeCanDetectFixtures($type) && $this->isLoadableClass($type, $className)) {
$this->out(__('Bake is detecting possible fixtures...'));
$this->out(__d('cake', 'Bake is detecting possible fixtures...'));
$testSubject = $this->buildTestSubject($type, $className);
$this->generateFixtureList($testSubject);
} elseif ($this->interactive) {
@ -154,7 +154,7 @@ class TestTask extends BakeTask {
*/
public function getObjectType() {
$this->hr();
$this->out(__('Select an object type:'));
$this->out(__d('cake', 'Select an object type:'));
$this->hr();
$keys = array();
@ -163,7 +163,7 @@ class TestTask extends BakeTask {
$keys[] = $key;
}
$keys[] = 'q';
$selection = $this->in(__('Enter the type of object to bake a test for or (q)uit'), $keys, 'q');
$selection = $this->in(__d('cake', 'Enter the type of object to bake a test for or (q)uit'), $keys, 'q');
if ($selection == 'q') {
return $this->_stop();
}
@ -191,13 +191,13 @@ class TestTask extends BakeTask {
} else {
$options = App::objects($type);
}
$this->out(__('Choose a %s class', $objectType));
$this->out(__d('cake', 'Choose a %s class', $objectType));
$keys = array();
foreach ($options as $key => $option) {
$this->out(++$key . '. ' . $option);
$keys[] = $key;
}
$selection = $this->in(__('Choose an existing class, or enter the name of a class that does not exist'));
$selection = $this->in(__d('cake', 'Choose an existing class, or enter the name of a class that does not exist'));
if (isset($options[$selection - 1])) {
return $options[$selection - 1];
}
@ -365,10 +365,10 @@ class TestTask extends BakeTask {
* @return array Array of fixtures the user wants to add.
*/
public function getUserFixtures() {
$proceed = $this->in(__('Bake could not detect fixtures, would you like to add some?'), array('y','n'), 'n');
$proceed = $this->in(__d('cake', 'Bake could not detect fixtures, would you like to add some?'), array('y','n'), 'n');
$fixtures = array();
if (strtolower($proceed) == 'y') {
$fixtureList = $this->in(__("Please provide a comma separated list of the fixtures names you'd like to use.\nExample: 'app.comment, app.post, plugin.forums.post'"));
$fixtureList = $this->in(__d('cake', "Please provide a comma separated list of the fixtures names you'd like to use.\nExample: 'app.comment, app.post, plugin.forums.post'"));
$fixtureListTrimmed = str_replace(' ', '', $fixtureList);
$fixtures = explode(',', $fixtureListTrimmed);
}
@ -431,15 +431,15 @@ class TestTask extends BakeTask {
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(__('Bake test case skeletons for classes.'))
return $parser->description(__d('cake', 'Bake test case skeletons for classes.'))
->addArgument('type', array(
'help' => __('Type of class to bake, can be any of the following: controller, model, helper, component or behavior.'),
'help' => __d('cake', 'Type of class to bake, can be any of the following: controller, model, helper, component or behavior.'),
'choices' => array('controller', 'model', 'helper', 'component', 'behavior')
))->addArgument('name', array(
'help' => __('An existing class to bake tests for.')
'help' => __d('cake', 'An existing class to bake tests for.')
))->addOption('plugin', array(
'short' => 'p',
'help' => __('CamelCased name of the plugin to bake tests for.')
))->epilog(__('Omitting all arguments and options will enter into an interactive mode.'));
'help' => __d('cake', 'CamelCased name of the plugin to bake tests for.')
))->epilog(__d('cake', 'Omitting all arguments and options will enter into an interactive mode.'));
}
}

View file

@ -221,17 +221,17 @@ class ViewTask extends BakeTask {
$this->controllerPath = strtolower(Inflector::underscore($this->controllerName));
$prompt = __("Would you like bake to build your views interactively?\nWarning: Choosing no will overwrite %s views if it exist.", $this->controllerName);
$prompt = __d('cake', "Would you like bake to build your views interactively?\nWarning: Choosing no will overwrite %s views if it exist.", $this->controllerName);
$interactive = $this->in($prompt, array('y', 'n'), 'n');
if (strtolower($interactive) == 'n') {
$this->interactive = false;
}
$prompt = __("Would you like to create some CRUD views\n(index, add, view, edit) for this controller?\nNOTE: Before doing so, you'll need to create your controller\nand model classes (including associated models).");
$prompt = __d('cake', "Would you like to create some CRUD views\n(index, add, view, edit) for this controller?\nNOTE: Before doing so, you'll need to create your controller\nand model classes (including associated models).");
$wannaDoScaffold = $this->in($prompt, array('y','n'), 'y');
$wannaDoAdmin = $this->in(__("Would you like to create the views for admin routing?"), array('y','n'), 'n');
$wannaDoAdmin = $this->in(__d('cake', "Would you like to create the views for admin routing?"), array('y','n'), 'n');
if (strtolower($wannaDoScaffold) == 'y' || strtolower($wannaDoAdmin) == 'y') {
$vars = $this->__loadController();
@ -250,7 +250,7 @@ class ViewTask extends BakeTask {
}
$this->hr();
$this->out();
$this->out(__("View Scaffolding Complete.\n"));
$this->out(__d('cake', "View Scaffolding Complete.\n"));
} else {
$this->customAction();
}
@ -268,7 +268,7 @@ class ViewTask extends BakeTask {
*/
private function __loadController() {
if (!$this->controllerName) {
$this->err(__('Controller not found'));
$this->err(__d('cake', 'Controller not found'));
}
$plugin = null;
@ -280,7 +280,7 @@ class ViewTask extends BakeTask {
App::uses($controllerClassName, $plugin . 'Controller');
if (!class_exists($controllerClassName)) {
$file = $controllerClassName . '.php';
$this->err(__("The file '%s' could not be found.\nIn order to bake a view, you'll need to first create the controller.", $file));
$this->err(__d('cake', "The file '%s' could not be found.\nIn order to bake a view, you'll need to first create the controller.", $file));
$this->_stop();
}
$controllerObj = new $controllerClassName();
@ -331,25 +331,25 @@ class ViewTask extends BakeTask {
public function customAction() {
$action = '';
while ($action == '') {
$action = $this->in(__('Action Name? (use lowercase_underscored function name)'));
$action = $this->in(__d('cake', 'Action Name? (use lowercase_underscored function name)'));
if ($action == '') {
$this->out(__('The action name you supplied was empty. Please try again.'));
$this->out(__d('cake', 'The action name you supplied was empty. Please try again.'));
}
}
$this->out();
$this->hr();
$this->out(__('The following view will be created:'));
$this->out(__d('cake', 'The following view will be created:'));
$this->hr();
$this->out(__('Controller Name: %s', $this->controllerName));
$this->out(__('Action Name: %s', $action));
$this->out(__('Path: %s', $this->params['app'] . DS . $this->controllerPath . DS . Inflector::underscore($action) . ".ctp"));
$this->out(__d('cake', 'Controller Name: %s', $this->controllerName));
$this->out(__d('cake', 'Action Name: %s', $action));
$this->out(__d('cake', 'Path: %s', $this->params['app'] . DS . $this->controllerPath . DS . Inflector::underscore($action) . ".ctp"));
$this->hr();
$looksGood = $this->in(__('Look okay?'), array('y','n'), 'y');
$looksGood = $this->in(__d('cake', 'Look okay?'), array('y','n'), 'y');
if (strtolower($looksGood) == 'y') {
$this->bake($action, ' ');
$this->_stop();
} else {
$this->out(__('Bake Aborted.'));
$this->out(__d('cake', 'Bake Aborted.'));
}
}
@ -431,25 +431,25 @@ class ViewTask extends BakeTask {
public function getOptionParser() {
$parser = parent::getOptionParser();
return $parser->description(
__('Bake views for a controller, using built-in or custom templates.')
__d('cake', 'Bake views for a controller, using built-in or custom templates.')
)->addArgument('controller', array(
'help' => __('Name of the controller views to bake. Can be Plugin.name as a shortcut for plugin baking.')
'help' => __d('cake', 'Name of the controller views to bake. Can be Plugin.name as a shortcut for plugin baking.')
))->addArgument('action', array(
'help' => __("Will bake a single action's file. core templates are (index, add, edit, view)")
'help' => __d('cake', "Will bake a single action's file. core templates are (index, add, edit, view)")
))->addArgument('alias', array(
'help' => __('Will bake the template in <action> but create the filename after <alias>.')
'help' => __d('cake', 'Will bake the template in <action> but create the filename after <alias>.')
))->addOption('plugin', array(
'short' => 'p',
'help' => __('Plugin to bake the view into.')
'help' => __d('cake', 'Plugin to bake the view into.')
))->addOption('admin', array(
'help' => __('Set to only bake views for a prefix in Routing.prefixes'),
'help' => __d('cake', 'Set to only bake views for a prefix in Routing.prefixes'),
'boolean' => true
))->addOption('connection', array(
'short' => 'c',
'help' => __('The connection the connected model is on.')
'help' => __d('cake', 'The connection the connected model is on.')
))->addSubcommand('all', array(
'help' => __('Bake all CRUD action views for all controllers. Requires models and controllers to exist.')
))->epilog(__('Omitting all arguments and options will enter into an interactive mode.'));
'help' => __d('cake', 'Bake all CRUD action views for all controllers. Requires models and controllers to exist.')
))->epilog(__d('cake', 'Omitting all arguments and options will enter into an interactive mode.'));
}
/**

View file

@ -44,113 +44,113 @@ class TestsuiteShell extends Shell {
'The CakePHP Testsuite allows you to run test cases from the command line',
'If run with no command line arguments, a list of available core test cases will be shown'
))->addArgument('category', array(
'help' => __('app, core or name of a plugin.'),
'help' => __d('cake', 'app, core or name of a plugin.'),
'required' => true
))->addArgument('file', array(
'help' => __('file name with folder prefix and without the test.php suffix.'),
'help' => __d('cake', 'file name with folder prefix and without the test.php suffix.'),
'required' => false,
))->addOption('log-junit', array(
'help' => __('<file> Log test execution in JUnit XML format to file.'),
'help' => __d('cake', '<file> Log test execution in JUnit XML format to file.'),
'default' => false
))->addOption('log-json', array(
'help' => __('<file> Log test execution in TAP format to file.'),
'help' => __d('cake', '<file> Log test execution in TAP format to file.'),
'default' => false
))->addOption('log-tap', array(
'help' => __('<file> Log test execution in TAP format to file.'),
'help' => __d('cake', '<file> Log test execution in TAP format to file.'),
'default' => false
))->addOption('log-dbus', array(
'help' => __('Log test execution to DBUS.'),
'help' => __d('cake', 'Log test execution to DBUS.'),
'default' => false
))->addOption('coverage-html', array(
'help' => __('<dir> Generate code coverage report in HTML format.'),
'help' => __d('cake', '<dir> Generate code coverage report in HTML format.'),
'default' => false
))->addOption('coverage-clover', array(
'help' => __('<file> Write code coverage data in Clover XML format.'),
'help' => __d('cake', '<file> Write code coverage data in Clover XML format.'),
'default' => false
))->addOption('testdox-html', array(
'help' => __('<file> Write agile documentation in HTML format to file.'),
'help' => __d('cake', '<file> Write agile documentation in HTML format to file.'),
'default' => false
))->addOption('testdox-text', array(
'help' => __('<file> Write agile documentation in Text format to file.'),
'help' => __d('cake', '<file> Write agile documentation in Text format to file.'),
'default' => false
))->addOption('filter', array(
'help' => __('<pattern> Filter which tests to run.'),
'help' => __d('cake', '<pattern> Filter which tests to run.'),
'default' => false
))->addOption('group', array(
'help' => __('<name> Only runs tests from the specified group(s).'),
'help' => __d('cake', '<name> Only runs tests from the specified group(s).'),
'default' => false
))->addOption('exclude-group', array(
'help' => __('<name> Exclude tests from the specified group(s).'),
'help' => __d('cake', '<name> Exclude tests from the specified group(s).'),
'default' => false
))->addOption('list-groups', array(
'help' => __('List available test groups.'),
'help' => __d('cake', 'List available test groups.'),
'boolean' => true
))->addOption('loader', array(
'help' => __('TestSuiteLoader implementation to use.'),
'help' => __d('cake', 'TestSuiteLoader implementation to use.'),
'default' => false
))->addOption('repeat', array(
'help' => __('<times> Runs the test(s) repeatedly.'),
'help' => __d('cake', '<times> Runs the test(s) repeatedly.'),
'default' => false
))->addOption('tap', array(
'help' => __('Report test execution progress in TAP format.'),
'help' => __d('cake', 'Report test execution progress in TAP format.'),
'boolean' => true
))->addOption('testdox', array(
'help' => __('Report test execution progress in TestDox format.'),
'help' => __d('cake', 'Report test execution progress in TestDox format.'),
'default' => false,
'boolean' => true
))->addOption('no-colors', array(
'help' => __('Do not use colors in output.'),
'help' => __d('cake', 'Do not use colors in output.'),
'boolean' => true
))->addOption('stderr', array(
'help' => __('Write to STDERR instead of STDOUT.'),
'help' => __d('cake', 'Write to STDERR instead of STDOUT.'),
'boolean' => true
))->addOption('stop-on-error', array(
'help' => __('Stop execution upon first error or failure.'),
'help' => __d('cake', 'Stop execution upon first error or failure.'),
'boolean' => true
))->addOption('stop-on-failure', array(
'help' => __('Stop execution upon first failure.'),
'help' => __d('cake', 'Stop execution upon first failure.'),
'boolean' => true
))->addOption('stop-on-skipped ', array(
'help' => __('Stop execution upon first skipped test.'),
'help' => __d('cake', 'Stop execution upon first skipped test.'),
'boolean' => true
))->addOption('stop-on-incomplete', array(
'help' => __('Stop execution upon first incomplete test.'),
'help' => __d('cake', 'Stop execution upon first incomplete test.'),
'boolean' => true
))->addOption('strict', array(
'help' => __('Mark a test as incomplete if no assertions are made.'),
'help' => __d('cake', 'Mark a test as incomplete if no assertions are made.'),
'boolean' => true
))->addOption('wait', array(
'help' => __('Waits for a keystroke after each test.'),
'help' => __d('cake', 'Waits for a keystroke after each test.'),
'boolean' => true
))->addOption('process-isolation', array(
'help' => __('Run each test in a separate PHP process.'),
'help' => __d('cake', 'Run each test in a separate PHP process.'),
'boolean' => true
))->addOption('no-globals-backup', array(
'help' => __('Do not backup and restore $GLOBALS for each test.'),
'help' => __d('cake', 'Do not backup and restore $GLOBALS for each test.'),
'boolean' => true
))->addOption('static-backup ', array(
'help' => __('Backup and restore static attributes for each test.'),
'help' => __d('cake', 'Backup and restore static attributes for each test.'),
'boolean' => true
))->addOption('syntax-check', array(
'help' => __('Try to check source files for syntax errors.'),
'help' => __d('cake', 'Try to check source files for syntax errors.'),
'boolean' => true
))->addOption('bootstrap', array(
'help' => __('<file> A "bootstrap" PHP file that is run before the tests.'),
'help' => __d('cake', '<file> A "bootstrap" PHP file that is run before the tests.'),
'default' => false
))->addOption('configuration', array(
'help' => __('<file> Read configuration from XML file.'),
'help' => __d('cake', '<file> Read configuration from XML file.'),
'default' => false
))->addOption('no-configuration', array(
'help' => __('Ignore default configuration file (phpunit.xml).'),
'help' => __d('cake', 'Ignore default configuration file (phpunit.xml).'),
'boolean' => true
))->addOption('include-path', array(
'help' => __('<path(s)> Prepend PHP include_path with given path(s).'),
'help' => __d('cake', '<path(s)> Prepend PHP include_path with given path(s).'),
'default' => false
))->addOption('directive', array(
'help' => __('key[=value] Sets a php.ini value.'),
'help' => __d('cake', 'key[=value] Sets a php.ini value.'),
'default' => false
))->addOption('fixture', array(
'help' => __('Choose a custom fixture manager.'),
'help' => __d('cake', 'Choose a custom fixture manager.'),
));
return $parser;
@ -232,7 +232,7 @@ class TestsuiteShell extends Shell {
* @return void
*/
public function main() {
$this->out(__('CakePHP Test Shell'));
$this->out(__d('cake', 'CakePHP Test Shell'));
$this->hr();
$args = $this->parseArgs();
@ -281,7 +281,7 @@ class TestsuiteShell extends Shell {
}
if (empty($testCases)) {
$this->out(__("No test cases available \n\n"));
$this->out(__d('cake', "No test cases available \n\n"));
return $this->out($this->OptionParser->help());
}
@ -297,7 +297,7 @@ class TestsuiteShell extends Shell {
$i++;
}
while ($choice = $this->in(__('What test case would you like to run?'), null, 'q')) {
while ($choice = $this->in(__d('cake', 'What test case would you like to run?'), null, 'q')) {
if (is_numeric($choice) && isset($cases[$choice])) {
$this->args[0] = $category;
$this->args[1] = $cases[$choice];

View file

@ -58,7 +58,7 @@ class ConsoleErrorHandler extends ErrorHandler {
public static function handleException(Exception $exception) {
$stderr = self::getStderr();
$stderr->write(sprintf(
__("<error>Error:</error> %s\n%s"),
__d('cake', "<error>Error:</error> %s\n%s"),
$exception->getMessage(),
$exception->getTraceAsString()
));
@ -80,8 +80,8 @@ class ConsoleErrorHandler extends ErrorHandler {
}
$stderr = self::getStderr();
list($name, $log) = self::_mapErrorCode($code);
$message = __('%s in [%s, line %s]', $description, $file, $line);
$stderr->write(__("<error>%s Error:</error> %s\n", $name, $message));
$message = __d('cake', '%s in [%s, line %s]', $description, $file, $line);
$stderr->write(__d('cake', "<error>%s Error:</error> %s\n", $name, $message));
if (Configure::read('debug') == 0) {
CakeLog::write($log, $message);

View file

@ -95,10 +95,10 @@ class ConsoleInputArgument {
}
$optional = '';
if (!$this->isRequired()) {
$optional = __(' <comment>(optional)</comment>');
$optional = __d('cake', ' <comment>(optional)</comment>');
}
if (!empty($this->_choices)) {
$optional .= __(' <comment>(choices: %s)</comment>', implode('|', $this->_choices));
$optional .= __d('cake', ' <comment>(choices: %s)</comment>', implode('|', $this->_choices));
}
return sprintf('%s%s%s', $name, $this->_help, $optional);
}
@ -140,7 +140,7 @@ class ConsoleInputArgument {
}
if (!in_array($value, $this->_choices)) {
throw new ConsoleException(sprintf(
__('"%s" is not a valid value for %s. Please use one of "%s"'),
__d('cake', '"%s" is not a valid value for %s. Please use one of "%s"'),
$value, $this->_name, implode(', ', $this->_choices)
));
}

View file

@ -119,10 +119,10 @@ class ConsoleInputOption {
public function help($width = 0) {
$default = $short = '';
if (!empty($this->_default) && $this->_default !== true) {
$default = __(' <comment>(default: %s)</comment>', $this->_default);
$default = __d('cake', ' <comment>(default: %s)</comment>', $this->_default);
}
if (!empty($this->_choices)) {
$default .= __(' <comment>(choices: %s)</comment>', implode('|', $this->_choices));
$default .= __d('cake', ' <comment>(choices: %s)</comment>', implode('|', $this->_choices));
}
if (!empty($this->_short)) {
$short = ', -' . $this->_short;
@ -180,7 +180,7 @@ class ConsoleInputOption {
}
if (!in_array($value, $this->_choices)) {
throw new ConsoleException(sprintf(
__('"%s" is not a valid value for --%s. Please use one of "%s"'),
__d('cake', '"%s" is not a valid value for --%s. Please use one of "%s"'),
$value, $this->_name, implode(', ', $this->_choices)
));
}

View file

@ -134,11 +134,11 @@ class ConsoleOptionParser {
if ($defaultOptions) {
$this->addOption('verbose', array(
'short' => 'v',
'help' => __('Enable verbose output.'),
'help' => __d('cake', 'Enable verbose output.'),
'boolean' => true
))->addOption('quiet', array(
'short' => 'q',
'help' => __('Enable quiet output.'),
'help' => __d('cake', 'Enable quiet output.'),
'boolean' => true
));
}
@ -461,7 +461,7 @@ class ConsoleOptionParser {
foreach ($this->_args as $i => $arg) {
if ($arg->isRequired() && !isset($args[$i]) && empty($params['help'])) {
throw new ConsoleException(
__('Missing required arguments. %s is required.', $arg->name())
__d('cake', 'Missing required arguments. %s is required.', $arg->name())
);
}
}
@ -555,7 +555,7 @@ class ConsoleOptionParser {
*/
protected function _parseOption($name, $params) {
if (!isset($this->_options[$name])) {
throw new ConsoleException(__('Unknown option `%s`', $name));
throw new ConsoleException(__d('cake', 'Unknown option `%s`', $name));
}
$option = $this->_options[$name];
$isBoolean = $option->isBoolean();
@ -589,7 +589,7 @@ class ConsoleOptionParser {
}
$next = count($args);
if (!isset($this->_args[$next])) {
throw new ConsoleException(__('Too many arguments.'));
throw new ConsoleException(__d('cake', 'Too many arguments.'));
}
if ($this->_args[$next]->validChoice($argument)) {

View file

@ -69,7 +69,7 @@ class HelpFormatter {
}
$out[] = '';
$out[] = sprintf(
__('To see help on a subcommand use <info>`cake %s [subcommand] --help`</info>'),
__d('cake', 'To see help on a subcommand use <info>`cake %s [subcommand] --help`</info>'),
$parser->command()
);
$out[] = '';

View file

@ -560,7 +560,7 @@ class Shell extends Object {
* @param string $message An optional error message
*/
public function error($title, $message = null) {
$this->err(__('<error>Error:</error> %s', $title));
$this->err(__d('cake', '<error>Error:</error> %s', $title));
if (!empty($message)) {
$this->err($message);
@ -596,27 +596,27 @@ class Shell extends Object {
$this->out();
if (is_file($path) && $this->interactive === true) {
$this->out(__('<warning>File `%s` exists</warning>', $path));
$key = $this->in(__('Do you want to overwrite?'), array('y', 'n', 'q'), 'n');
$this->out(__d('cake', '<warning>File `%s` exists</warning>', $path));
$key = $this->in(__d('cake', 'Do you want to overwrite?'), array('y', 'n', 'q'), 'n');
if (strtolower($key) == 'q') {
$this->out(__('<error>Quitting</error>.'), 2);
$this->out(__d('cake', '<error>Quitting</error>.'), 2);
$this->_stop();
} elseif (strtolower($key) != 'y') {
$this->out(__('Skip `%s`', $path), 2);
$this->out(__d('cake', 'Skip `%s`', $path), 2);
return false;
}
} else {
$this->out(__('Creating file %s', $path));
$this->out(__d('cake', 'Creating file %s', $path));
}
if ($File = new File($path, true)) {
$data = $File->prepare($contents);
$File->write($data);
$this->out(__('<success>Wrote</success> `%s`', $path));
$this->out(__d('cake', '<success>Wrote</success> `%s`', $path));
return true;
} else {
$this->err(__('<error>Could not write to `%s`</error>.', $path), 2);
$this->err(__d('cake', '<error>Could not write to `%s`</error>.', $path), 2);
return false;
}
}

0
lib/Cake/Console/templates/skel/tmp/cache/models/empty vendored Executable file → Normal file
View file

0
lib/Cake/Console/templates/skel/tmp/cache/persistent/empty vendored Executable file → Normal file
View file

0
lib/Cake/Console/templates/skel/tmp/cache/views/empty vendored Executable file → Normal file
View file

View file

@ -68,7 +68,7 @@ class AclComponent extends Component {
list($plugin, $name) = pluginSplit($name);
$name .= 'Component';
} else {
throw new CakeException(__('Could not find %s.', $name));
throw new CakeException(__d('cake', 'Could not find %s.', $name));
}
}
$this->adapter($name);
@ -92,7 +92,7 @@ class AclComponent extends Component {
$adapter = new $adapter();
}
if (!$adapter instanceof AclInterface) {
throw new CakeException(__('AclComponent adapters must implement AclInterface'));
throw new CakeException(__d('cake', 'AclComponent adapters must implement AclInterface'));
}
$this->_Instance = $adapter;
$this->_Instance->initialize($this);
@ -163,7 +163,7 @@ class AclComponent extends Component {
* @deprecated
*/
public function grant($aro, $aco, $action = "*") {
trigger_error(__('AclComponent::grant() is deprecated, use allow() instead'), E_USER_WARNING);
trigger_error(__d('cake', 'AclComponent::grant() is deprecated, use allow() instead'), E_USER_WARNING);
return $this->_Instance->allow($aro, $aco, $action);
}
@ -177,7 +177,7 @@ class AclComponent extends Component {
* @deprecated
*/
public function revoke($aro, $aco, $action = "*") {
trigger_error(__('AclComponent::revoke() is deprecated, use deny() instead'), E_USER_WARNING);
trigger_error(__d('cake', 'AclComponent::revoke() is deprecated, use deny() instead'), E_USER_WARNING);
return $this->_Instance->deny($aro, $aco, $action);
}
}
@ -299,12 +299,12 @@ class DbAcl extends Object implements AclInterface {
$acoPath = $this->Aco->node($aco);
if (empty($aroPath) || empty($acoPath)) {
trigger_error(__("DbAcl::check() - Failed ARO/ACO node lookup in permissions check. Node references:\nAro: ") . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING);
trigger_error(__d('cake', "DbAcl::check() - Failed ARO/ACO node lookup in permissions check. Node references:\nAro: ") . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING);
return false;
}
if ($acoPath == null || $acoPath == array()) {
trigger_error(__("DbAcl::check() - Failed ACO node lookup in permissions check. Node references:\nAro: ") . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING);
trigger_error(__d('cake', "DbAcl::check() - Failed ACO node lookup in permissions check. Node references:\nAro: ") . print_r($aro, true) . "\nAco: " . print_r($aco, true), E_USER_WARNING);
return false;
}
@ -312,7 +312,7 @@ class DbAcl extends Object implements AclInterface {
$acoNode = $acoPath[0];
if ($action != '*' && !in_array('_' . $action, $permKeys)) {
trigger_error(__("ACO permissions key %s does not exist in DbAcl::check()", $action), E_USER_NOTICE);
trigger_error(__d('cake', "ACO permissions key %s does not exist in DbAcl::check()", $action), E_USER_NOTICE);
return false;
}
@ -386,7 +386,7 @@ class DbAcl extends Object implements AclInterface {
$save = array();
if ($perms == false) {
trigger_error(__('DbAcl::allow() - Invalid node'), E_USER_WARNING);
trigger_error(__d('cake', 'DbAcl::allow() - Invalid node'), E_USER_WARNING);
return false;
}
if (isset($perms[0])) {

View file

@ -87,7 +87,7 @@ abstract class BaseAuthorize {
public function controller($controller = null) {
if ($controller) {
if (!$controller instanceof Controller) {
throw new CakeException(__('$controller needs to be an instance of Controller'));
throw new CakeException(__d('cake', '$controller needs to be an instance of Controller'));
}
$this->_Controller = $controller;
return true;

View file

@ -46,7 +46,7 @@ class ControllerAuthorize extends BaseAuthorize {
public function controller($controller = null) {
if ($controller) {
if (!method_exists($controller, 'isAuthorized')) {
throw new CakeException(__('$controller does not implement an isAuthorized() method.'));
throw new CakeException(__d('cake', '$controller does not implement an isAuthorized() method.'));
}
}
return parent::controller($controller);

View file

@ -81,7 +81,7 @@ class CrudAuthorize extends BaseAuthorize {
*/
public function authorize($user, CakeRequest $request) {
if (!isset($this->settings['actionMap'][$request->params['action']])) {
trigger_error(__(
trigger_error(__d('cake',
'CrudAuthorize::authorize() - Attempted access of un-mapped action "%1$s" in controller "%2$s"',
$request->action,
$request->controller

View file

@ -351,7 +351,7 @@ class AuthComponent extends Component {
function __setDefaults() {
$defaults = array(
'logoutRedirect' => $this->loginAction,
'authError' => __('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})) {
@ -411,10 +411,10 @@ class AuthComponent extends Component {
$className = $class . 'Authorize';
App::uses($className, $plugin . 'Controller/Component/Auth');
if (!class_exists($className)) {
throw new CakeException(__('Authorization adapter "%s" was not found.', $class));
throw new CakeException(__d('cake', 'Authorization adapter "%s" was not found.', $class));
}
if (!method_exists($className, 'authorize')) {
throw new CakeException(__('Authorization objects must implement an authorize method.'));
throw new CakeException(__d('cake', 'Authorization objects must implement an authorize method.'));
}
$settings = array_merge($global, (array)$settings);
$this->_authorizeObjects[] = new $className($this->_Collection, $settings);
@ -651,10 +651,10 @@ class AuthComponent extends Component {
$className = $class . 'Authenticate';
App::uses($className, $plugin . 'Controller/Component/Auth');
if (!class_exists($className)) {
throw new CakeException(__('Authentication adapter "%s" was not found.', $class));
throw new CakeException(__d('cake', 'Authentication adapter "%s" was not found.', $class));
}
if (!method_exists($className, 'authenticate')) {
throw new CakeException(__('Authentication objects must implement an authenticate method.'));
throw new CakeException(__d('cake', 'Authentication objects must implement an authenticate method.'));
}
$settings = array_merge($global, (array)$settings);
$this->_authenticateObjects[] = new $className($this->_Collection, $settings);

2
lib/Cake/Controller/Component/EmailComponent.php Executable file → Normal file
View file

@ -725,7 +725,7 @@ class EmailComponent extends Component {
$formatted = array();
if ($this->_lineLength !== null) {
trigger_error(__('_lineLength cannot be accessed please use lineLength'), E_USER_WARNING);
trigger_error(__d('cake', '_lineLength cannot be accessed please use lineLength'), E_USER_WARNING);
$this->lineLength = $this->_lineLength;
}

View file

@ -127,7 +127,7 @@ class Scaffold {
$this->ScaffoldModel = $this->controller->{$this->modelClass};
$this->scaffoldTitle = Inflector::humanize($this->viewPath);
$this->scaffoldActions = $controller->scaffold;
$title_for_layout = __('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;
@ -174,7 +174,7 @@ class Scaffold {
$this->ScaffoldModel->id = $request->params['pass'][0];
}
if (!$this->ScaffoldModel->exists()) {
throw new NotFoundException(__('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();
@ -231,10 +231,10 @@ class Scaffold {
*/
protected function _scaffoldSave(CakeRequest $request, $action = 'edit') {
$formAction = 'edit';
$success = __('updated');
$success = __d('cake', 'updated');
if ($action === 'add') {
$formAction = 'add';
$success = __('saved');
$success = __d('cake', 'saved');
}
if ($this->controller->_beforeScaffold($action)) {
@ -243,7 +243,7 @@ class Scaffold {
$this->ScaffoldModel->id = $request['pass'][0];
}
if (!$this->ScaffoldModel->exists()) {
throw new NotFoundException(__('Invalid %s', Inflector::humanize($this->modelKey)));
throw new NotFoundException(__d('cake', 'Invalid %s', Inflector::humanize($this->modelKey)));
}
}
@ -254,7 +254,7 @@ class Scaffold {
if ($this->ScaffoldModel->save($request->data)) {
if ($this->controller->_afterScaffoldSave($action)) {
$message = __(
$message = __d('cake',
'The %1$s has been %2$s',
Inflector::humanize($this->modelKey),
$success
@ -265,7 +265,7 @@ class Scaffold {
}
} else {
if ($this->_validSession) {
$this->controller->Session->setFlash(__('Please correct errors below.'));
$this->controller->Session->setFlash(__d('cake', 'Please correct errors below.'));
}
}
}
@ -312,13 +312,13 @@ class Scaffold {
}
$this->ScaffoldModel->id = $id;
if (!$this->ScaffoldModel->exists()) {
throw new NotFoundException(__('Invalid %s', Inflector::humanize($this->modelClass)));
throw new NotFoundException(__d('cake', 'Invalid %s', Inflector::humanize($this->modelClass)));
}
if ($this->ScaffoldModel->delete()) {
$message = __('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 = __(
$message = __d('cake',
'There was an error deleting the %1$s with id: %2$d',
Inflector::humanize($this->modelClass),
$id

View file

@ -21,7 +21,7 @@
* Configuration class. Used for managing runtime configuration information.
*
* Provides features for reading and writing to the runtime configuration, as well
* as methods for loading additional configuration files or storing runtime configuration
* as methods for loading additional configuration files or storing runtime configuration
* for future use.
*
* @package cake.libs
@ -70,13 +70,13 @@ class Configure {
));
if (!include(CONFIGS . 'core.php')) {
trigger_error(__("Can't find application core file. Please create %score.php, and make sure it is readable by PHP.", CONFIGS), E_USER_ERROR);
trigger_error(__d('cake', "Can't find application core file. Please create %score.php, and make sure it is readable by PHP.", CONFIGS), E_USER_ERROR);
}
App::init();
App::build();
if (!include(CONFIGS . 'bootstrap.php')) {
trigger_error(__("Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP.", CONFIGS), E_USER_ERROR);
trigger_error(__d('cake', "Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP.", CONFIGS), E_USER_ERROR);
}
$level = -1;
if (isset(self::$_values['Error']['level'])) {
@ -224,7 +224,7 @@ class Configure {
}
/**
* Add a new reader to Configure. Readers allow you to read configuration
* Add a new reader to Configure. Readers allow you to read configuration
* files in various formats/storage locations. CakePHP comes with two built-in readers
* PhpReader and IniReader. You can also implement your own reader classes in your application.
*
@ -232,7 +232,7 @@ class Configure {
*
* `Configure::config('ini', new IniReader());`
*
* @param string $name The name of the reader being configured. This alias is used later to
* @param string $name The name of the reader being configured. This alias is used later to
* read values from a specific reader.
* @param ConfigReaderInterface $reader The reader to append.
* @return void
@ -254,7 +254,7 @@ class Configure {
}
/**
* Remove a configured reader. This will unset the reader
* Remove a configured reader. This will unset the reader
* and make any future attempts to use it cause an Exception.
*
* @param string $name Name of the reader to drop.
@ -276,7 +276,7 @@ class Configure {
* runtime configuration. You can load configuration files from plugins
* by preceeding the filename with the plugin name.
*
* `Configure::load('Users.user', 'default')`
* `Configure::load('Users.user', 'default')`
*
* Would load the 'user' config file using the default config reader. You can load
* app config files by giving the name of the resource you want loaded.
@ -358,7 +358,7 @@ interface ConfigReaderInterface {
* These sources can either be static resources like files, or dynamic ones like
* a database, or other datasource.
*
* @param string $key
* @param string $key
* @return array An array of data to merge into the runtime configuration
*/
function read($key);

View file

@ -194,7 +194,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());
@ -216,7 +216,7 @@ class ExceptionRenderer {
$code = ($error->getCode() > 500) ? $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,
));

View file

@ -184,7 +184,7 @@ class CakeException extends RuntimeException {
public function __construct($message, $code = 500) {
if (is_array($message)) {
$this->_attributes = $message;
$message = __($this->_messageTemplate, $message);
$message = __d('cake', $this->_messageTemplate, $message);
}
parent::__construct($message, $code);
}

View file

@ -82,7 +82,7 @@ class CakeLog {
*/
public static function config($key, $config) {
if (empty($config['engine'])) {
throw new CakeLogException(__('Missing logger classname'));
throw new CakeLogException(__d('cake', 'Missing logger classname'));
}
$loggerName = $config['engine'];
unset($config['engine']);
@ -90,7 +90,7 @@ class CakeLog {
$logger = new $className($config);
if (!$logger instanceof CakeLogInterface) {
throw new CakeLogException(sprintf(
__('logger class %s does not implement a write method.'), $loggerName
__d('cake', 'logger class %s does not implement a write method.'), $loggerName
));
}
self::$_streams[$key] = $logger;
@ -109,7 +109,7 @@ class CakeLog {
App::uses($loggerName, $plugin . 'Log/Engine');
if (!class_exists($loggerName)) {
throw new CakeLogException(__('Could not load class %s', $loggerName));
throw new CakeLogException(__d('cake', 'Could not load class %s', $loggerName));
}
return $loggerName;
}

View file

@ -133,7 +133,7 @@ class AclNode extends AppModel {
$model = ClassRegistry::init(array('class' => $name, 'alias' => $name));
if (empty($model)) {
trigger_error(__("Model class '%s' not found in AclNode::node() when trying to bind %s object", $type, $this->alias), E_USER_WARNING);
trigger_error(__d('cake', "Model class '%s' not found in AclNode::node() when trying to bind %s object", $type, $this->alias), E_USER_WARNING);
return null;
}
@ -178,7 +178,7 @@ class AclNode extends AppModel {
$result = $db->read($this, $queryData, -1);
if (!$result) {
trigger_error(__("AclNode::node() - Couldn't find %s node identified by \"%s\"", $type, print_r($ref, true)), E_USER_WARNING);
trigger_error(__d('cake', "AclNode::node() - Couldn't find %s node identified by \"%s\"", $type, print_r($ref, true)), E_USER_WARNING);
}
}
return $result;

View file

@ -54,7 +54,7 @@ class AclBehavior extends ModelBehavior {
}
$model->{$type} = ClassRegistry::init($type);
if (!method_exists($model, 'parentNode')) {
trigger_error(__('Callback parentNode() not defined in %s', $model->alias), E_USER_WARNING);
trigger_error(__d('cake', 'Callback parentNode() not defined in %s', $model->alias), E_USER_WARNING);
}
}

View file

@ -359,7 +359,7 @@ class ContainableBehavior extends ModelBehavior {
if (!isset($Model->{$name}) || !is_object($Model->{$name})) {
if ($throwErrors) {
trigger_error(__('Model "%s" is not associated with model "%s"', $Model->alias, $name), E_USER_WARNING);
trigger_error(__d('cake', 'Model "%s" is not associated with model "%s"', $Model->alias, $name), E_USER_WARNING);
}
continue;
}

View file

@ -55,7 +55,7 @@ class TranslateBehavior extends ModelBehavior {
$db = ConnectionManager::getDataSource($model->useDbConfig);
if (!$db->connected) {
trigger_error(
__('Datasource %s for TranslateBehavior of model %s is not connected', $model->useDbConfig, $model->alias),
__d('cake', 'Datasource %s for TranslateBehavior of model %s is not connected', $model->useDbConfig, $model->alias),
E_USER_ERROR
);
return false;
@ -426,7 +426,7 @@ class TranslateBehavior extends ModelBehavior {
foreach (array('hasOne', 'hasMany', 'belongsTo', 'hasAndBelongsToMany') as $type) {
if (isset($model->{$type}[$association]) || isset($model->__backAssociation[$type][$association])) {
trigger_error(
__('Association %s is already binded to model %s', $association, $model->alias),
__d('cake', 'Association %s is already binded to model %s', $association, $model->alias),
E_USER_ERROR
);
return false;

View file

@ -219,7 +219,7 @@ class BehaviorCollection extends ObjectCollection {
$method = $this->hasMethod($method, true);
if ($strict && empty($method)) {
trigger_error(__("BehaviorCollection::dispatchMethod() - Method %s not found in any attached behavior", $method), E_USER_WARNING);
trigger_error(__d('cake', "BehaviorCollection::dispatchMethod() - Method %s not found in any attached behavior", $method), E_USER_WARNING);
return null;
}
if (empty($method)) {

View file

@ -592,7 +592,7 @@ class CakeSchema extends Object {
$value['key'] = 'primary';
}
if (!isset($db->columns[$value['type']])) {
trigger_error(__('Schema generation error: invalid column type %s does not exist in DBO', $value['type']), E_USER_NOTICE);
trigger_error(__d('cake', 'Schema generation error: invalid column type %s does not exist in DBO', $value['type']), E_USER_NOTICE);
continue;
} else {
$defaultCol = $db->columns[$value['type']];

View file

@ -254,7 +254,7 @@ class CakeSession {
self::__overwrite($_SESSION, Set::remove($_SESSION, $name));
return (self::check($name) == false);
}
self::__setError(2, __("%s doesn't exist", $name));
self::__setError(2, __d('cake', "%s doesn't exist", $name));
return false;
}
@ -480,7 +480,7 @@ class CakeSession {
foreach ($sessionConfig['ini'] as $setting => $value) {
if (ini_set($setting, $value) === false) {
throw new CakeSessionException(sprintf(
__('Unable to configure the session, setting %s failed.'),
__d('cake', 'Unable to configure the session, setting %s failed.'),
$setting
));
}
@ -514,13 +514,13 @@ class CakeSession {
list($plugin, $class) = pluginSplit($handler, true);
App::uses($class, $plugin . 'Model/Datasource/Session');
if (!class_exists($class)) {
throw new CakeSessionException(__('Could not load %s to handle the session.', $class));
throw new CakeSessionException(__d('cake', 'Could not load %s to handle the session.', $class));
}
$handler = new $class();
if ($handler instanceof CakeSessionHandlerInterface) {
return $handler;
}
throw new CakeSessionException(__('Chosen SessionHandler does not implement CakeSessionHandlerInterface it cannot be used with an engine key.'));
throw new CakeSessionException(__d('cake', 'Chosen SessionHandler does not implement CakeSessionHandlerInterface it cannot be used with an engine key.'));
}
/**

View file

@ -116,7 +116,7 @@ class DboMssql extends DboSource {
function __construct($config, $autoConnect = true) {
if ($autoConnect) {
if (!function_exists('mssql_min_message_severity')) {
trigger_error(__("PHP SQL Server interface is not installed, cannot continue. For troubleshooting information, see http://php.net/mssql/"), E_USER_WARNING);
trigger_error(__d('cake', "PHP SQL Server interface is not installed, cannot continue. For troubleshooting information, see http://php.net/mssql/"), E_USER_WARNING);
}
mssql_min_message_severity(15);
mssql_min_error_severity(2);

View file

@ -298,7 +298,7 @@ class Mysql extends DboSource {
$fields = false;
$cols = $this->_execute('SHOW FULL COLUMNS FROM ' . $this->fullTableName($model));
if (!$cols) {
throw new CakeException(__('Could not describe table for %s', $model->name));
throw new CakeException(__d('cake', 'Could not describe table for %s', $model->name));
}
foreach ($cols as $column) {

View file

@ -571,7 +571,7 @@ class DboOracle extends DboSource {
*/
function constraint($action, $table) {
if (empty($table)) {
trigger_error(__('Must specify table to operate on constraints'));
trigger_error(__d('cake', 'Must specify table to operate on constraints'));
}
$table = strtoupper($table);
@ -629,7 +629,7 @@ class DboOracle extends DboSource {
return $constraints;
break;
default:
trigger_error(__('DboOracle::constraint() accepts only enable, disable, or list'));
trigger_error(__d('cake', 'DboOracle::constraint() accepts only enable, disable, or list'));
}
}
return true;
@ -976,7 +976,7 @@ class DboOracle extends DboSource {
if ($query = $this->generateAssociationQuery($model, $linkModel, $type, $association, $assocData, $queryData, $external, $resultSet)) {
if (!isset($resultSet) || !is_array($resultSet)) {
if (Configure::read('debug') > 0) {
echo '<div style = "font: Verdana bold 12px; color: #FF0000">' . __('SQL Error in model %s:', $model->alias) . ' ';
echo '<div style = "font: Verdana bold 12px; color: #FF0000">' . __d('cake', 'SQL Error in model %s:', $model->alias) . ' ';
if (isset($this->error) && $this->error != null) {
echo $this->error;
}

View file

@ -392,7 +392,7 @@ class Sqlite extends DboSource {
}
if (!isset($this->columns[$type])) {
trigger_error(__('Column type %s does not exist', $type), E_USER_WARNING);
trigger_error(__d('cake', 'Column type %s does not exist', $type), E_USER_WARNING);
return null;
}

16
lib/Cake/Model/Datasource/DboSource.php Executable file → Normal file
View file

@ -941,11 +941,11 @@ class DboSource extends DataSource {
if (Configure::read('debug') > 0) {
$out = null;
if ($error) {
trigger_error('<span style="color:Red;text-align:left"><b>' . __('SQL Error:') . "</b> {$this->error}</span>", E_USER_WARNING);
trigger_error('<span style="color:Red;text-align:left"><b>' . __d('cake', 'SQL Error:') . "</b> {$this->error}</span>", E_USER_WARNING);
} else {
$out = ('<small>[' . __('Aff:%s Num:%s Took:%sms', $this->affected, $this->numRows, $this->took) . ']</small>');
$out = ('<small>[' . __d('cake', 'Aff:%s Num:%s Took:%sms', $this->affected, $this->numRows, $this->took) . ']</small>');
}
pr(sprintf('<p style="text-align:left"><b>' . __('Query:') . '</b> %s %s</p>', $sql, $out));
pr(sprintf('<p style="text-align:left"><b>' . __d('cake', 'Query:') . '</b> %s %s</p>', $sql, $out));
}
}
@ -1169,7 +1169,7 @@ class DboSource extends DataSource {
if ($query = $this->generateAssociationQuery($model, $linkModel, $type, $association, $assocData, $queryData, $external, $resultSet)) {
if (!is_array($resultSet)) {
if (Configure::read('debug') > 0) {
echo '<div style = "font: Verdana bold 12px; color: #FF0000">' . __('SQL Error in model %s:', $model->alias) . ' ';
echo '<div style = "font: Verdana bold 12px; color: #FF0000">' . __d('cake', 'SQL Error in model %s:', $model->alias) . ' ';
if (isset($this->error) && $this->error != null) {
echo $this->error;
}
@ -2725,7 +2725,7 @@ class DboSource extends DataSource {
*/
public function length($real) {
if (!preg_match_all('/([\w\s]+)(?:\((\d+)(?:,(\d+))?\))?(\sunsigned)?(\szerofill)?/', $real, $result)) {
trigger_error(__("FIXME: Can't parse field: " . $real), E_USER_WARNING);
trigger_error(__d('cake', "FIXME: Can't parse field: " . $real), E_USER_WARNING);
$col = str_replace(array(')', 'unsigned'), '', $real);
$limit = null;
@ -2833,7 +2833,7 @@ class DboSource extends DataSource {
*/
public function createSchema($schema, $tableName = null) {
if (!is_a($schema, 'CakeSchema')) {
trigger_error(__('Invalid schema object'), E_USER_WARNING);
trigger_error(__d('cake', 'Invalid schema object'), E_USER_WARNING);
return null;
}
$out = '';
@ -2915,12 +2915,12 @@ class DboSource extends DataSource {
extract(array_merge(array('null' => true), $column));
if (empty($name) || empty($type)) {
trigger_error(__('Column name or type not defined in schema'), E_USER_WARNING);
trigger_error(__d('cake', 'Column name or type not defined in schema'), E_USER_WARNING);
return null;
}
if (!isset($this->columns[$type])) {
trigger_error(__('Column type %s does not exist', $type), E_USER_WARNING);
trigger_error(__d('cake', 'Column type %s does not exist', $type), E_USER_WARNING);
return null;
}

View file

@ -1005,7 +1005,7 @@ class Model extends Object {
public function getColumnTypes() {
$columns = $this->schema();
if (empty($columns)) {
trigger_error(__('(Model::getColumnTypes) Unable to build model field data. If you are using a model without a database table, try implementing schema()'), E_USER_WARNING);
trigger_error(__d('cake', '(Model::getColumnTypes) Unable to build model field data. If you are using a model without a database table, try implementing schema()'), E_USER_WARNING);
}
$cols = array();
foreach ($columns as $field => $values) {
@ -2602,7 +2602,7 @@ class Model extends Object {
if (isset($validator['message'])) {
$message = $validator['message'];
} else {
$message = __('This field cannot be left blank');
$message = __d('cake', 'This field cannot be left blank');
}
if (
@ -2650,7 +2650,7 @@ class Model extends Object {
} elseif (!is_array($validator['rule'])) {
$valid = preg_match($rule, $data[$fieldName]);
} elseif (Configure::read('debug') > 0) {
trigger_error(__('Could not find validation handler %s for %s', $rule, $fieldName), E_USER_WARNING);
trigger_error(__d('cake', 'Could not find validation handler %s for %s', $rule, $fieldName), E_USER_WARNING);
}
if (!$valid || (is_string($valid) && strlen($valid) > 0)) {
@ -2957,7 +2957,7 @@ class Model extends Object {
return array($with, array_unique(array_merge($assoc[$with], $keys)));
}
trigger_error(
__('Invalid join model settings in %s', $model->alias),
__d('cake', 'Invalid join model settings in %s', $model->alias),
E_USER_WARNING
);
}

View file

@ -380,7 +380,7 @@ class CakeRequest implements ArrayAccess {
$type = strtolower(substr($name, 2));
return $this->is($type);
}
throw new CakeException(__('Method %s does not exist', $name));
throw new CakeException(__d('cake', 'Method %s does not exist', $name));
}
/**

View file

@ -459,7 +459,7 @@ class CakeResponse {
return $this->_status;
}
if (!isset($this->_statusCodes[$code])) {
throw new CakeException(__('Unknown status code'));
throw new CakeException(__d('cake', 'Unknown status code'));
}
return $this->_status = $code;
}

View file

@ -221,7 +221,7 @@ class CakeSocket {
$buffer = fread($this->connection, $length);
$info = stream_get_meta_data($this->connection);
if ($info['timed_out']) {
$this->setLastError(E_WARNING, __('Connection timed out'));
$this->setLastError(E_WARNING, __d('cake', 'Connection timed out'));
return false;
}
return $buffer;

View file

@ -126,11 +126,11 @@ class HttpResponse implements ArrayAccess {
*/
public function parseResponse($message) {
if (!is_string($message)) {
throw new SocketException(__('Invalid response.'));
throw new SocketException(__d('cake', 'Invalid response.'));
}
if (!preg_match("/^(.+\r\n)(.*)(?<=\r\n)\r\n/Us", $message, $match)) {
throw new SocketException(__('Invalid HTTP response.'));
throw new SocketException(__d('cake', 'Invalid HTTP response.'));
}
list(, $statusLine, $header) = $match;
@ -198,7 +198,7 @@ class HttpResponse implements ArrayAccess {
while ($chunkLength !== 0) {
if (!preg_match("/^([0-9a-f]+) *(?:;(.+)=(.+))?\r\n/iU", $body, $match)) {
throw new SocketException(__('HttpSocket::_decodeChunkedBody - Could not parse malformed chunk.'));
throw new SocketException(__d('cake', 'HttpSocket::_decodeChunkedBody - Could not parse malformed chunk.'));
}
$chunkSize = 0;

View file

@ -211,7 +211,7 @@ class HttpSocket extends CakeSocket {
return;
}
if (!is_resource($resource)) {
throw new SocketException(__('Invalid resource.'));
throw new SocketException(__d('cake', 'Invalid resource.'));
}
$this->_contentResource = $resource;
}
@ -364,7 +364,7 @@ class HttpSocket extends CakeSocket {
}
if (!App::import('Lib', $this->responseClass)) {
throw new SocketException(__('Class %s not found.', $this->responseClass));
throw new SocketException(__d('cake', 'Class %s not found.', $this->responseClass));
}
$responseClass = $this->responseClass;
$this->response = new $responseClass($response);
@ -535,10 +535,10 @@ class HttpSocket extends CakeSocket {
App::uses($authClass, $plugin . 'Network/Http');
if (!class_exists($authClass)) {
throw new SocketException(__('Unknown authentication method.'));
throw new SocketException(__d('cake', 'Unknown authentication method.'));
}
if (!method_exists($authClass, 'authentication')) {
throw new SocketException(sprintf(__('The %s do not support authentication.'), $authClass));
throw new SocketException(sprintf(__d('cake', 'The %s do not support authentication.'), $authClass));
}
call_user_func_array("$authClass::authentication", array($this, &$this->_auth[$method]));
}
@ -564,10 +564,10 @@ class HttpSocket extends CakeSocket {
App::uses($authClass, $plugin. 'Network/Http');
if (!class_exists($authClass)) {
throw new SocketException(__('Unknown authentication method for proxy.'));
throw new SocketException(__d('cake', 'Unknown authentication method for proxy.'));
}
if (!method_exists($authClass, 'proxyAuthentication')) {
throw new SocketException(sprintf(__('The %s do not support proxy authentication.'), $authClass));
throw new SocketException(sprintf(__d('cake', 'The %s do not support proxy authentication.'), $authClass));
}
call_user_func_array("$authClass::proxyAuthentication", array($this, &$this->_proxy));
}
@ -785,7 +785,7 @@ class HttpSocket extends CakeSocket {
if (is_string($request)) {
$isValid = preg_match("/(.+) (.+) (.+)\r\n/U", $request, $match);
if (!$this->quirksMode && (!$isValid || ($match[2] == '*' && !in_array($match[3], $asteriskMethods)))) {
throw new SocketException(__('HttpSocket::_buildRequestLine - Passed an invalid request line string. Activate quirks mode to do this.'));
throw new SocketException(__d('cake', 'HttpSocket::_buildRequestLine - Passed an invalid request line string. Activate quirks mode to do this.'));
}
return $request;
} elseif (!is_array($request)) {
@ -803,7 +803,7 @@ class HttpSocket extends CakeSocket {
}
if (!$this->quirksMode && $request['uri'] === '*' && !in_array($request['method'], $asteriskMethods)) {
throw new SocketException(__('HttpSocket::_buildRequestLine - The "*" asterisk character is only allowed for the following methods: %s. Activate quirks mode to work outside of HTTP/1.1 specs.', implode(',', $asteriskMethods)));
throw new SocketException(__d('cake', 'HttpSocket::_buildRequestLine - The "*" asterisk character is only allowed for the following methods: %s. Activate quirks mode to work outside of HTTP/1.1 specs.', implode(',', $asteriskMethods)));
}
return $request['method'] . ' ' . $request['uri'] . ' ' . $versionToken . "\r\n";
}

View file

@ -263,7 +263,7 @@ class Router {
if (isset($options['routeClass'])) {
$routeClass = $options['routeClass'];
if (!is_subclass_of($routeClass, 'CakeRoute')) {
throw new RouterException(__('Route classes must extend CakeRoute'));
throw new RouterException(__d('cake', 'Route classes must extend CakeRoute'));
}
unset($options['routeClass']);
if ($routeClass == 'RedirectRoute' && isset($defaults['redirect'])) {

View file

@ -184,7 +184,7 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase {
*/
function loadFixtures() {
if (empty($this->fixtureManager)) {
throw new Exception(__('No fixture manager to load the test fixture'));
throw new Exception(__d('cake', 'No fixture manager to load the test fixture'));
}
$args = func_get_args();
foreach ($args as $class) {

View file

@ -84,7 +84,7 @@ class CakeTestRunner extends PHPUnit_TextUI_TestRunner {
if (class_exists($arguments['fixtureManager'])) {
return new $arguments['fixtureManager'];
}
throw new RuntimeException(__('Could not find fixture manager %s.', $arguments['fixtureManager']));
throw new RuntimeException(__d('cake', 'Could not find fixture manager %s.', $arguments['fixtureManager']));
}
App::uses('AppFixtureManager', 'TestSuite');
if (class_exists('AppFixtureManager')) {

View file

@ -239,7 +239,7 @@ class CakeFixtureManager {
$fixture->truncate($db);
$fixture->insert($db);
} else {
throw new UnexpectedValueException(__('Referenced fixture class %s not found', $name));
throw new UnexpectedValueException(__d('cake', 'Referenced fixture class %s not found', $name));
}
}

View file

@ -187,7 +187,7 @@ class CakeBaseReporter extends PHPUnit_TextUI_ResultPrinter {
if (!$this->_headerSent) {
echo $this->paintHeader();
}
echo __('Running %s', $suite->getName()) . "\n";
echo __d('cake', 'Running %s', $suite->getName()) . "\n";
}
/**

10
lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php Executable file → Normal file
View file

@ -234,8 +234,8 @@ class CakeHtmlReporter extends CakeBaseReporter {
echo "<li class='fail'>\n";
echo "<span>Failed</span>";
echo "<div class='msg'><pre>" . $this->_htmlEntities($message->toString()) . "</pre></div>\n";
echo "<div class='msg'>" . __('Test case: %s', $testName) . "</div>\n";
echo "<div class='msg'>" . __('Stack trace:') . '<br />' . $trace . "</div>\n";
echo "<div class='msg'>" . __d('cake', 'Test case: %s', $testName) . "</div>\n";
echo "<div class='msg'>" . __d('cake', 'Stack trace:') . '<br />' . $trace . "</div>\n";
echo "</li>\n";
}
@ -272,8 +272,8 @@ class CakeHtmlReporter extends CakeBaseReporter {
echo "<span>" . get_class($message) . "</span>";
echo "<div class='msg'>" . $this->_htmlEntities($message->getMessage()) . "</div>\n";
echo "<div class='msg'>" . __('Test case: %s', $testName) . "</div>\n";
echo "<div class='msg'>" . __('Stack trace:') . '<br />' . $trace . "</div>\n";
echo "<div class='msg'>" . __d('cake', 'Test case: %s', $testName) . "</div>\n";
echo "<div class='msg'>" . __d('cake', 'Stack trace:') . '<br />' . $trace . "</div>\n";
echo "</li>\n";
}
@ -341,6 +341,6 @@ class CakeHtmlReporter extends CakeBaseReporter {
if (!$this->_headerSent) {
echo $this->paintHeader();
}
echo '<h2>' . __('Running %s', $suite->getName()) . '</h2>';
echo '<h2>' . __d('cake', 'Running %s', $suite->getName()) . '</h2>';
}
}

View file

@ -149,7 +149,7 @@ class ClassRegistry {
}
if (!isset(${$class})) {
trigger_error(__('(ClassRegistry::init() could not create instance of %1$s class %2$s ', $class, $type), E_USER_WARNING);
trigger_error(__d('cake', '(ClassRegistry::init() could not create instance of %1$s class %2$s ', $class, $type), E_USER_WARNING);
return $false;
}
@ -159,7 +159,7 @@ class ClassRegistry {
$_this->map($alias, $class);
}
} elseif (is_numeric($settings)) {
trigger_error(__('(ClassRegistry::init() Attempted to create instance of a class with a numeric name'), E_USER_WARNING);
trigger_error(__d('cake', '(ClassRegistry::init() Attempted to create instance of a class with a numeric name'), E_USER_WARNING);
return $false;
}
}

View file

@ -647,11 +647,11 @@ class Debugger {
*/
public static function checkSecurityKeys() {
if (Configure::read('Security.salt') == 'DYhG93b0qyJfIxfs2guVoUubWwvniR2G0FgaC9mi') {
trigger_error(__('Please change the value of \'Security.salt\' in app/config/core.php to a salt value specific to your application'), E_USER_NOTICE);
trigger_error(__d('cake', 'Please change the value of \'Security.salt\' in app/config/core.php to a salt value specific to your application'), E_USER_NOTICE);
}
if (Configure::read('Security.cipherSeed') === '76859309657453542496749683645') {
trigger_error(__('Please change the value of \'Security.cipherSeed\' in app/config/core.php to a numeric (digits only) seed value specific to your application'), E_USER_NOTICE);
trigger_error(__d('cake', 'Please change the value of \'Security.cipherSeed\' in app/config/core.php to a numeric (digits only) seed value specific to your application'), E_USER_NOTICE);
}
}

View file

@ -345,11 +345,11 @@ class Folder {
if ($recursive === false && is_dir($path)) {
if (@chmod($path, intval($mode, 8))) {
$this->__messages[] = __('%s changed to %s', $path, $mode);
$this->__messages[] = __d('cake', '%s changed to %s', $path, $mode);
return true;
}
$this->__errors[] = __('%s NOT changed to %s', $path, $mode);
$this->__errors[] = __d('cake', '%s NOT changed to %s', $path, $mode);
return false;
}
@ -366,9 +366,9 @@ class Folder {
}
if (@chmod($fullpath, intval($mode, 8))) {
$this->__messages[] = __('%s changed to %s', $fullpath, $mode);
$this->__messages[] = __d('cake', '%s changed to %s', $fullpath, $mode);
} else {
$this->__errors[] = __('%s NOT changed to %s', $fullpath, $mode);
$this->__errors[] = __d('cake', '%s NOT changed to %s', $fullpath, $mode);
}
}
}
@ -453,7 +453,7 @@ class Folder {
}
if (is_file($pathname)) {
$this->__errors[] = __('%s is a file', $pathname);
$this->__errors[] = __d('cake', '%s is a file', $pathname);
return false;
}
$pathname = rtrim($pathname, DS);
@ -464,11 +464,11 @@ class Folder {
$old = umask(0);
if (mkdir($pathname, $mode)) {
umask($old);
$this->__messages[] = __('%s created', $pathname);
$this->__messages[] = __d('cake', '%s created', $pathname);
return true;
} else {
umask($old);
$this->__errors[] = __('%s NOT created', $pathname);
$this->__errors[] = __d('cake', '%s NOT created', $pathname);
return false;
}
}
@ -541,9 +541,9 @@ class Folder {
}
if (is_file($file) === true) {
if (@unlink($file)) {
$this->__messages[] = __('%s removed', $file);
$this->__messages[] = __d('cake', '%s removed', $file);
} else {
$this->__errors[] = __('%s NOT removed', $file);
$this->__errors[] = __d('cake', '%s NOT removed', $file);
}
} elseif (is_dir($file) === true && $this->delete($file) === false) {
return false;
@ -552,10 +552,10 @@ class Folder {
}
$path = substr($path, 0, strlen($path) - 1);
if (rmdir($path) === false) {
$this->__errors[] = __('%s NOT removed', $path);
$this->__errors[] = __d('cake', '%s NOT removed', $path);
return false;
} else {
$this->__messages[] = __('%s removed', $path);
$this->__messages[] = __d('cake', '%s removed', $path);
}
}
return true;
@ -590,7 +590,7 @@ class Folder {
$mode = $options['mode'];
if (!$this->cd($fromDir)) {
$this->__errors[] = __('%s not found', $fromDir);
$this->__errors[] = __d('cake', '%s not found', $fromDir);
return false;
}
@ -599,7 +599,7 @@ class Folder {
}
if (!is_writable($toDir)) {
$this->__errors[] = __('%s not writable', $toDir);
$this->__errors[] = __d('cake', '%s not writable', $toDir);
return false;
}
@ -613,9 +613,9 @@ class Folder {
if (copy($from, $to)) {
chmod($to, intval($mode, 8));
touch($to, filemtime($from));
$this->__messages[] = __('%s copied to %s', $from, $to);
$this->__messages[] = __d('cake', '%s copied to %s', $from, $to);
} else {
$this->__errors[] = __('%s NOT copied to %s', $from, $to);
$this->__errors[] = __d('cake', '%s NOT copied to %s', $from, $to);
}
}
@ -626,11 +626,11 @@ class Folder {
$old = umask(0);
chmod($to, $mode);
umask($old);
$this->__messages[] = __('%s created', $to);
$this->__messages[] = __d('cake', '%s created', $to);
$options = array_merge($options, array('to'=> $to, 'from'=> $from));
$this->copy($options);
} else {
$this->__errors[] = __('%s not created', $to);
$this->__errors[] = __d('cake', '%s not created', $to);
}
}
}

View file

@ -105,7 +105,7 @@ abstract class ObjectCollection {
$list = array_keys($this->_loaded);
}
if ($options['modParams'] !== false && !isset($params[$options['modParams']])) {
throw new CakeException(__('Cannot use modParams with indexes that do not exist.'));
throw new CakeException(__d('cake', 'Cannot use modParams with indexes that do not exist.'));
}
foreach ($list as $name) {
$result = call_user_func_array(array($this->_loaded[$name], $callback), $params);

View file

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

View file

@ -246,7 +246,7 @@ class Validation {
}
break;
default:
self::$errors[] = __('You must define the $operator parameter for Validation::comparison()');
self::$errors[] = __d('cake', 'You must define the $operator parameter for Validation::comparison()');
break;
}
return false;
@ -265,7 +265,7 @@ class Validation {
extract(self::_defaults($check));
}
if ($regex === null) {
self::$errors[] = __('You must define a regular expression for Validation::custom()');
self::$errors[] = __d('cake', 'You must define a regular expression for Validation::custom()');
return false;
}
return self::_check($check, $regex);
@ -724,11 +724,11 @@ class Validation {
protected static function _pass($method, $check, $classPrefix) {
$className = ucwords($classPrefix) . 'Validation';
if (!class_exists($className)) {
trigger_error(__('Could not find %s class, unable to complete validation.', $className), E_USER_WARNING);
trigger_error(__d('cake', 'Could not find %s class, unable to complete validation.', $className), E_USER_WARNING);
return false;
}
if (!method_exists($className, $method)) {
trigger_error(__('Method %s does not exist on %s unable to complete validation.', $method, $className), E_USER_WARNING);
trigger_error(__d('cake', 'Method %s does not exist on %s unable to complete validation.', $method, $className), E_USER_WARNING);
return false;
}
$check = (array)$check;

View file

@ -100,9 +100,9 @@ class Xml {
$dom->load($input);
return $dom;
} elseif (!is_string($input)) {
throw new XmlException(__('Invalid input.'));
throw new XmlException(__d('cake', 'Invalid input.'));
}
throw new XmlException(__('XML cannot be read.'));
throw new XmlException(__d('cake', 'XML cannot be read.'));
}
/**
@ -144,11 +144,11 @@ class Xml {
*/
public static function fromArray($input, $options = array()) {
if (!is_array($input) || count($input) !== 1) {
throw new XmlException(__('Invalid input.'));
throw new XmlException(__d('cake', 'Invalid input.'));
}
$key = key($input);
if (is_integer($key)) {
throw new XmlException(__('The key of input must be alphanumeric'));
throw new XmlException(__d('cake', 'The key of input must be alphanumeric'));
}
if (!is_array($options)) {
@ -212,7 +212,7 @@ class Xml {
}
} else {
if ($key[0] === '@') {
throw new XmlException(__('Invalid array'));
throw new XmlException(__d('cake', 'Invalid array'));
}
if (array_keys($value) === range(0, count($value) - 1)) { // List
foreach ($value as $item) {
@ -225,7 +225,7 @@ class Xml {
}
}
} else {
throw new XmlException(__('Invalid array'));
throw new XmlException(__d('cake', 'Invalid array'));
}
}
}
@ -277,7 +277,7 @@ class Xml {
$obj = simplexml_import_dom($obj);
}
if (!($obj instanceof SimpleXMLElement)) {
throw new XmlException(__('The input is not instance of SimpleXMLElement, DOMDocument or DOMNode.'));
throw new XmlException(__d('cake', 'The input is not instance of SimpleXMLElement, DOMDocument or DOMNode.'));
}
$result = array();
$namespaces = array_merge(array('' => ''), $obj->getNamespaces(true));

View file

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

View file

@ -368,7 +368,7 @@ class FormHelper extends AppHelper {
$submitOptions = $options;
if (!$submit) {
$submit = __('Submit');
$submit = __d('cake', 'Submit');
}
}
$out .= $this->submit($submit, $submitOptions);
@ -510,7 +510,7 @@ class FormHelper extends AppHelper {
if ($text != null) {
$error = $text;
} elseif (is_numeric($error)) {
$error = __('Error in field %s', Inflector::humanize($this->field()));
$error = __d('cake', 'Error in field %s', Inflector::humanize($this->field()));
}
if ($options['escape']) {
$error = h($error);
@ -553,7 +553,7 @@ class FormHelper extends AppHelper {
if (substr($text, -3) == '_id') {
$text = substr($text, 0, strlen($text) - 3);
}
$text = __(Inflector::humanize(Inflector::underscore($text)));
$text = __d('cake', Inflector::humanize(Inflector::underscore($text)));
}
if (is_string($options)) {
@ -622,16 +622,16 @@ 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));
$legend = sprintf($actionName, __d('cake', $modelName));
}
$out = null;
@ -1058,7 +1058,7 @@ class FormHelper extends AppHelper {
$legend = $attributes['legend'];
unset($attributes['legend']);
} elseif (count($options) > 1) {
$legend = __(Inflector::humanize($this->field()));
$legend = __d('cake', Inflector::humanize($this->field()));
}
$label = true;
@ -1151,7 +1151,7 @@ class FormHelper extends AppHelper {
public function __call($method, $params) {
$options = array();
if (empty($params)) {
throw new CakeException(__('Missing field name for FormHelper::%s', $method));
throw new CakeException(__d('cake', 'Missing field name for FormHelper::%s', $method));
}
if (isset($params[1])) {
$options = $params[1];
@ -1367,7 +1367,7 @@ class FormHelper extends AppHelper {
*/
public function submit($caption = null, $options = array()) {
if (!$caption) {
$caption = __('Submit');
$caption = __d('cake', 'Submit');
}
$out = null;
$div = true;
@ -2159,18 +2159,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 {

View file

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

View file

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

View file

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

View file

@ -88,15 +88,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));
}
}

6
lib/Cake/View/Helper/PaginatorHelper.php Executable file → Normal file
View file

@ -102,7 +102,7 @@ class PaginatorHelper extends AppHelper {
$classname = $ajaxProvider . 'Helper';
if (!method_exists($classname, 'link')) {
throw new CakeException(sprintf(
__('%s does not implement a link() method, it is incompatible with PaginatorHelper'), $classname
__d('cake', '%s does not implement a link() method, it is incompatible with PaginatorHelper'), $classname
));
}
parent::__construct($View, $settings);
@ -306,7 +306,7 @@ class PaginatorHelper extends AppHelper {
if (empty($title)) {
$title = $key;
$title = __(Inflector::humanize(preg_replace('/_id$/', '', $title)));
$title = __d('cake', Inflector::humanize(preg_replace('/_id$/', '', $title)));
}
$dir = isset($options['direction']) ? $options['direction'] : 'asc';
unset($options['direction']);
@ -553,7 +553,7 @@ class PaginatorHelper extends AppHelper {
array(
'model' => $this->defaultModel(),
'format' => 'pages',
'separator' => __(' of ')
'separator' => __d('cake', ' of ')
),
$options);

View file

@ -82,19 +82,19 @@ class TimeHelper extends AppHelper {
private function __translateSpecifier($specifier) {
switch ($specifier[1]) {
case 'a':
$abday = __c('abday', 5);
$abday = __cn('cake', 'abday', 5);
if (is_array($abday)) {
return $abday[date('w', $this->__time)];
}
break;
case 'A':
$day = __c('day', 5);
$day = __cn('cake', 'day', 5);
if (is_array($day)) {
return $day[date('w', $this->__time)];
}
break;
case 'c':
$format = __c('d_t_fmt', 5);
$format = __cn('cake', 'd_t_fmt', 5);
if ($format != 'd_t_fmt') {
return $this->convertSpecifiers($format, $this->__time);
}
@ -116,13 +116,13 @@ class TimeHelper extends AppHelper {
return date('jS', $this->__time);
case 'b':
case 'h':
$months = __c('abmon', 5);
$months = __cn('cake', 'abmon', 5);
if (is_array($months)) {
return $months[date('n', $this->__time) -1];
}
return '%b';
case 'B':
$months = __c('mon', 5);
$months = __cn('cake', 'mon', 5);
if (is_array($months)) {
return $months[date('n', $this->__time) -1];
}
@ -133,14 +133,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 = __cn('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 = __cn('cake', 't_fmt_ampm', 5);
if ($complete != 't_fmt_ampm') {
return str_replace('%p',$this->__translateSpecifier(array('%p', 'p')),$complete);
}
@ -154,13 +154,13 @@ class TimeHelper extends AppHelper {
case 'u':
return ($weekDay = date('w', $this->__time)) ? $weekDay : 7;
case 'x':
$format = __c('d_fmt', 5);
$format = __cn('cake', 'd_fmt', 5);
if ($format != 'd_fmt') {
return $this->convertSpecifiers($format, $this->__time);
}
break;
case 'X':
$format = __c('t_fmt', 5);
$format = __cn('cake', 't_fmt', 5);
if ($format != 't_fmt') {
return $this->convertSpecifiers($format, $this->__time);
}
@ -265,9 +265,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);
@ -614,41 +614,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 ? ', ' : '') . $years . ' ' . __n('year', 'years', $years);
$relativeDate .= $months > 0 ? ($relativeDate ? ', ' : '') . $months . ' ' . __n('month', 'months', $months) : '';
$relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks) : '';
$relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days) : '';
$relativeDate .= ($relativeDate ? ', ' : '') . $years . ' ' . __dn('cake', 'year', 'years', $years);
$relativeDate .= $months > 0 ? ($relativeDate ? ', ' : '') . $months . ' ' . __dn('cake', 'month', 'months', $months) : '';
$relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . $weeks . ' ' . __dn('cake', 'week', 'weeks', $weeks) : '';
$relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __dn('cake', 'day', 'days', $days) : '';
} elseif (abs($months) > 0) {
// months, weeks and days
$relativeDate .= ($relativeDate ? ', ' : '') . $months . ' ' . __n('month', 'months', $months);
$relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks) : '';
$relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days) : '';
$relativeDate .= ($relativeDate ? ', ' : '') . $months . ' ' . __dn('cake', 'month', 'months', $months);
$relativeDate .= $weeks > 0 ? ($relativeDate ? ', ' : '') . $weeks . ' ' . __dn('cake', 'week', 'weeks', $weeks) : '';
$relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __dn('cake', 'day', 'days', $days) : '';
} elseif (abs($weeks) > 0) {
// weeks and days
$relativeDate .= ($relativeDate ? ', ' : '') . $weeks . ' ' . __n('week', 'weeks', $weeks);
$relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days) : '';
$relativeDate .= ($relativeDate ? ', ' : '') . $weeks . ' ' . __dn('cake', 'week', 'weeks', $weeks);
$relativeDate .= $days > 0 ? ($relativeDate ? ', ' : '') . $days . ' ' . __dn('cake', 'day', 'days', $days) : '';
} elseif (abs($days) > 0) {
// days and hours
$relativeDate .= ($relativeDate ? ', ' : '') . $days . ' ' . __n('day', 'days', $days);
$relativeDate .= $hours > 0 ? ($relativeDate ? ', ' : '') . $hours . ' ' . __n('hour', 'hours', $hours) : '';
$relativeDate .= ($relativeDate ? ', ' : '') . $days . ' ' . __dn('cake', 'day', 'days', $days);
$relativeDate .= $hours > 0 ? ($relativeDate ? ', ' : '') . $hours . ' ' . __dn('cake', 'hour', 'hours', $hours) : '';
} elseif (abs($hours) > 0) {
// hours and minutes
$relativeDate .= ($relativeDate ? ', ' : '') . $hours . ' ' . __n('hour', 'hours', $hours);
$relativeDate .= $minutes > 0 ? ($relativeDate ? ', ' : '') . $minutes . ' ' . __n('minute', 'minutes', $minutes) : '';
$relativeDate .= ($relativeDate ? ', ' : '') . $hours . ' ' . __dn('cake', 'hour', 'hours', $hours);
$relativeDate .= $minutes > 0 ? ($relativeDate ? ', ' : '') . $minutes . ' ' . __dn('cake', 'minute', 'minutes', $minutes) : '';
} elseif (abs($minutes) > 0) {
// minutes only
$relativeDate .= ($relativeDate ? ', ' : '') . $minutes . ' ' . __n('minute', 'minutes', $minutes);
$relativeDate .= ($relativeDate ? ', ' : '') . $minutes . ' ' . __dn('cake', 'minute', 'minutes', $minutes);
} else {
// seconds only
$relativeDate .= ($relativeDate ? ', ' : '') . $seconds . ' ' . __n('second', 'seconds', $seconds);
$relativeDate .= ($relativeDate ? ', ' : '') . $seconds . ' ' . __dn('cake', 'second', 'seconds', $seconds);
}
if (!$backwards) {
$relativeDate = __('%s ago', $relativeDate);
$relativeDate = __d('cake', '%s ago', $relativeDate);
}
}
return $relativeDate;
@ -668,7 +668,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);

View file

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

View file

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

View file

@ -18,8 +18,8 @@
?>
<h2><?php echo $name; ?></h2>
<p class="error">
<strong><?php echo __('Error'); ?>: </strong>
<?php echo __('An Internal Error Has Occurred.'); ?>
<strong><?php echo __d('cake', 'Error'); ?>: </strong>
<?php echo __d('cake', 'An Internal Error Has Occurred.'); ?>
</p>
<?php
if (Configure::read('debug') > 0 ):

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

Some files were not shown because too many files have changed in this diff Show more