Skip to content

Commit

Permalink
Adding i18n to schema shell.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Aug 11, 2009
1 parent 98b04dc commit dd1075a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cake/console/libs/schema.php
Expand Up @@ -232,7 +232,7 @@ function dump() {
*/ */
function run() { function run() {
if (!isset($this->args[0])) { if (!isset($this->args[0])) {
$this->err('command not found'); $this->err(__('Command not found', true));
$this->_stop(); $this->_stop();
} }


Expand Down Expand Up @@ -279,7 +279,7 @@ function run() {
$this->__update($Schema, $table); $this->__update($Schema, $table);
break; break;
default: default:
$this->err(__('command not found', true)); $this->err(__('Command not found', true));
$this->_stop(); $this->_stop();
} }
} }
Expand Down Expand Up @@ -313,15 +313,15 @@ function __create($Schema, $table = null) {
$this->out(array_keys($drop)); $this->out(array_keys($drop));


if ('y' == $this->in(__('Are you sure you want to drop the table(s)?', true), array('y', 'n'), 'n')) { if ('y' == $this->in(__('Are you sure you want to drop the table(s)?', true), array('y', 'n'), 'n')) {
$this->out('Dropping table(s).'); $this->out(__('Dropping table(s).', true));
$this->__run($drop, 'drop', $Schema); $this->__run($drop, 'drop', $Schema);
} }


$this->out("\n" . __('The following table(s) will be created.', true)); $this->out("\n" . __('The following table(s) will be created.', true));
$this->out(array_keys($create)); $this->out(array_keys($create));


if ('y' == $this->in(__('Are you sure you want to create the table(s)?', true), array('y', 'n'), 'y')) { if ('y' == $this->in(__('Are you sure you want to create the table(s)?', true), array('y', 'n'), 'y')) {
$this->out('Creating table(s).'); $this->out(__('Creating table(s).', true));
$this->__run($create, 'create', $Schema); $this->__run($create, 'create', $Schema);
} }


Expand All @@ -337,7 +337,7 @@ function __create($Schema, $table = null) {
function __update($Schema, $table = null) { function __update($Schema, $table = null) {
$db =& ConnectionManager::getDataSource($this->Schema->connection); $db =& ConnectionManager::getDataSource($this->Schema->connection);


$this->out('Comparing Database to Schema...'); $this->out(__('Comparing Database to Schema...', true));
$Old = $this->Schema->read(); $Old = $this->Schema->read();
$compare = $this->Schema->compare($Old, $Schema); $compare = $this->Schema->compare($Old, $Schema);


Expand Down Expand Up @@ -415,7 +415,8 @@ function __run($contents, $event, $Schema) {
* @access public * @access public
*/ */
function help() { function help() {
$this->out("The Schema Shell generates a schema object from \n\t\tthe database and updates the database from the schema."); $this->out("The Schema Shell generates a schema object from");
$this->out("the database and updates the database from the schema.");
$this->hr(); $this->hr();
$this->out("Usage: cake schema <command> <arg1> <arg2>..."); $this->out("Usage: cake schema <command> <arg1> <arg2>...");
$this->hr(); $this->hr();
Expand Down

0 comments on commit dd1075a

Please sign in to comment.