Replaced the *printf with i18n aliases by i18n aliases with params.

This commit is contained in:
Juan Basso 2010-12-04 23:37:13 -02:00
parent 30661ed154
commit c52d5320c8
78 changed files with 239 additions and 240 deletions

View file

@ -75,8 +75,8 @@ class ConsoleErrorHandler extends ErrorHandler {
}
$stderr = self::getStderr();
list($name, $log) = self::_mapErrorCode($code);
$message = sprintf(__('%s in [%s, line %s]'), $description, $file, $line);
$stderr->write(sprintf(__("<error>%s Error:</error> %s\n"), $name, $message));
$message = __('%s in [%s, line %s]', $description, $file, $line);
$stderr->write(__("<error>%s Error:</error> %s\n", $name, $message));
if (Configure::read('debug') == 0) {
App::import('Core', 'CakeLog');

View file

@ -75,7 +75,7 @@ class ConsoleInputArgument {
$optional = __(' <comment>(optional)</comment>');
}
if (!empty($this->_choices)) {
$optional .= sprintf(__(' <comment>(choices: %s)</comment>'), implode('|', $this->_choices));
$optional .= __(' <comment>(choices: %s)</comment>', implode('|', $this->_choices));
}
return sprintf('%s%s%s', $name, $this->_help, $optional);
}

View file

@ -82,10 +82,10 @@ class ConsoleInputOption {
public function help($width = 0) {
$default = $short = '';
if (!empty($this->_default) && $this->_default !== true) {
$default = sprintf(__(' <comment>(default: %s)</comment>'), $this->_default);
$default = __(' <comment>(default: %s)</comment>', $this->_default);
}
if (!empty($this->_choices)) {
$default .= sprintf(__(' <comment>(choices: %s)</comment>'), implode('|', $this->_choices));
$default .= __(' <comment>(choices: %s)</comment>', implode('|', $this->_choices));
}
if (!empty($this->_short)) {
$short = ', -' . $this->_short;

View file

@ -458,7 +458,7 @@ class ConsoleOptionParser {
foreach ($this->_args as $i => $arg) {
if ($arg->isRequired() && !isset($args[$i]) && empty($params['help'])) {
throw new RuntimeException(
sprintf(__('Missing required arguments. %s is required.'), $arg->name())
__('Missing required arguments. %s is required.', $arg->name())
);
}
}
@ -552,7 +552,7 @@ class ConsoleOptionParser {
*/
protected function _parseOption($name, $params) {
if (!isset($this->_options[$name])) {
throw new InvalidArgumentException(sprintf(__('Unknown option `%s`'), $name));
throw new InvalidArgumentException(__('Unknown option `%s`', $name));
}
$option = $this->_options[$name];
$isBoolean = $option->isBoolean();