From e3e11a48e62661293ab50a66225953806c262893 Mon Sep 17 00:00:00 2001 From: euromark Date: Wed, 22 May 2013 11:15:01 +0200 Subject: [PATCH 1/2] fix some domain translations and remove leftover true param from 1.x --- lib/Cake/Console/Command/AclShell.php | 22 +++++++++---------- lib/Cake/Console/Command/CommandListShell.php | 2 +- lib/Cake/Console/Command/I18nShell.php | 2 +- lib/Cake/Console/Command/Task/ExtractTask.php | 2 +- lib/Cake/Console/Command/Task/ProjectTask.php | 2 +- lib/Cake/View/Scaffolds/view.ctp | 2 +- lib/Cake/View/ViewBlock.php | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lib/Cake/Console/Command/AclShell.php b/lib/Cake/Console/Command/AclShell.php index 18bcf77f5..f3ed33c4f 100644 --- a/lib/Cake/Console/Command/AclShell.php +++ b/lib/Cake/Console/Command/AclShell.php @@ -87,7 +87,7 @@ class AclShell extends AppShell { if ($this->command) { if (!config('database')) { - $this->out(__d('cake_console', 'Your database configuration was not found. Take a moment to create one.'), true); + $this->out(__d('cake_console', 'Your database configuration was not found. Take a moment to create one.')); $this->args = null; return $this->DbConfig->execute(); } @@ -179,9 +179,9 @@ class AclShell extends AppShell { ); $this->Acl->{$class}->create(); if (!$this->Acl->{$class}->save($data)) { - $this->out(__d('cake_console', '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_console', 'Error in setting new parent. Please make sure the parent node exists, and is not a descendant of the node specified.')); } else { - $this->out(__d('cake_console', 'Node parent set to %s', $this->args[2]) . "\n", true); + $this->out(__d('cake_console', 'Node parent set to %s', $this->args[2]) . "\n"); } } @@ -237,9 +237,9 @@ class AclShell extends AppShell { extract($this->_getParams()); if ($this->Acl->check($aro, $aco, $action)) { - $this->out(__d('cake_console', '%s is allowed.', $aroName), true); + $this->out(__d('cake_console', '%s is allowed.', $aroName)); } else { - $this->out(__d('cake_console', '%s is not allowed.', $aroName), true); + $this->out(__d('cake_console', '%s is not allowed.', $aroName)); } } @@ -252,9 +252,9 @@ class AclShell extends AppShell { extract($this->_getParams()); if ($this->Acl->allow($aro, $aco, $action)) { - $this->out(__d('cake_console', 'Permission granted.'), true); + $this->out(__d('cake_console', 'Permission granted.')); } else { - $this->out(__d('cake_console', 'Permission was not granted.'), true); + $this->out(__d('cake_console', 'Permission was not granted.')); } } @@ -267,9 +267,9 @@ class AclShell extends AppShell { extract($this->_getParams()); if ($this->Acl->deny($aro, $aco, $action)) { - $this->out(__d('cake_console', 'Permission denied.'), true); + $this->out(__d('cake_console', 'Permission denied.')); } else { - $this->out(__d('cake_console', 'Permission was not denied.'), true); + $this->out(__d('cake_console', 'Permission was not denied.')); } } @@ -282,9 +282,9 @@ class AclShell extends AppShell { extract($this->_getParams()); if ($this->Acl->inherit($aro, $aco, $action)) { - $this->out(__d('cake_console', 'Permission inherited.'), true); + $this->out(__d('cake_console', 'Permission inherited.')); } else { - $this->out(__d('cake_console', 'Permission was not inherited.'), true); + $this->out(__d('cake_console', 'Permission was not inherited.')); } } diff --git a/lib/Cake/Console/Command/CommandListShell.php b/lib/Cake/Console/Command/CommandListShell.php index cf85584c7..fcc9cd89e 100644 --- a/lib/Cake/Console/Command/CommandListShell.php +++ b/lib/Cake/Console/Command/CommandListShell.php @@ -50,7 +50,7 @@ class CommandListShell extends AppShell { $this->out(""); $this->out(__d('cake_console', "Changing Paths:"), 2); $this->out(__d('cake_console', "Your working path should be the same as your application path. To change your path use the '-app' param.")); - $this->out(__d('cake_console', "Example: -app relative/path/to/myapp or -app /absolute/path/to/myapp"), 2); + $this->out(__d('cake_console', "Example: %s or %s", '-app relative/path/to/myapp', '-app /absolute/path/to/myapp'), 2); $this->out(__d('cake_console', "Available Shells:"), 2); } diff --git a/lib/Cake/Console/Command/I18nShell.php b/lib/Cake/Console/Command/I18nShell.php index 1aadabc62..7f996ce17 100644 --- a/lib/Cake/Console/Command/I18nShell.php +++ b/lib/Cake/Console/Command/I18nShell.php @@ -53,7 +53,7 @@ class I18nShell extends AppShell { if ($this->command && !in_array($this->command, array('help'))) { if (!config('database')) { - $this->out(__d('cake_console', 'Your database configuration was not found. Take a moment to create one.'), true); + $this->out(__d('cake_console', 'Your database configuration was not found. Take a moment to create one.')); return $this->DbConfig->execute(); } } diff --git a/lib/Cake/Console/Command/Task/ExtractTask.php b/lib/Cake/Console/Command/Task/ExtractTask.php index b6e230341..db1ddbcaa 100644 --- a/lib/Cake/Console/Command/Task/ExtractTask.php +++ b/lib/Cake/Console/Command/Task/ExtractTask.php @@ -687,7 +687,7 @@ class ExtractTask extends AppShell { * @return void */ protected function _markerError($file, $line, $marker, $count) { - $this->out(__d('cake_console', "Invalid marker content in %s:%s\n* %s(", $file, $line, $marker), true); + $this->out(__d('cake_console', "Invalid marker content in %s:%s\n* %s(", $file, $line, $marker)); $count += 2; $tokenCount = count($this->_tokens); $parenthesis = 1; diff --git a/lib/Cake/Console/Command/Task/ProjectTask.php b/lib/Cake/Console/Command/Task/ProjectTask.php index 8a83cdf45..723ea2e19 100644 --- a/lib/Cake/Console/Command/Task/ProjectTask.php +++ b/lib/Cake/Console/Command/Task/ProjectTask.php @@ -130,7 +130,7 @@ class ProjectTask extends AppShell { $Folder = new Folder($path); if (!$Folder->chmod($path . 'tmp', 0777)) { $this->err(__d('cake_console', 'Could not set permissions on %s', $path . DS . 'tmp')); - $this->out(__d('cake_console', 'chmod -R 0777 %s', $path . DS . 'tmp')); + $this->out('chmod -R 0777 ' . $path . DS . 'tmp'); $success = false; } if ($success) { diff --git a/lib/Cake/View/Scaffolds/view.ctp b/lib/Cake/View/Scaffolds/view.ctp index fce444c35..320095af3 100644 --- a/lib/Cake/View/Scaffolds/view.ctp +++ b/lib/Cake/View/Scaffolds/view.ctp @@ -178,7 +178,7 @@ $otherSingularVar = Inflector::variable($_alias); __d('cake', 'Delete'), array('plugin' => $_details['plugin'], 'controller' => $_details['controller'], 'action' => 'delete', ${$otherSingularVar}[$_details['primaryKey']]), null, - __d('cake', 'Are you sure you want to delete', true) .' #' . ${$otherSingularVar}[$_details['primaryKey']] . '?' + __d('cake', 'Are you sure you want to delete') .' #' . ${$otherSingularVar}[$_details['primaryKey']] . '?' ); echo "\n"; echo "\t\t\t\n"; diff --git a/lib/Cake/View/ViewBlock.php b/lib/Cake/View/ViewBlock.php index 271d12e5b..39c36bfe7 100644 --- a/lib/Cake/View/ViewBlock.php +++ b/lib/Cake/View/ViewBlock.php @@ -139,7 +139,7 @@ class ViewBlock { public function concat($name, $value = null, $mode = ViewBlock::APPEND) { if (isset($value)) { if (!is_string($value)) { - throw new CakeException(__d('cake_dev', '$value must be a string.')); + throw new CakeException(__d('cake_dev', '%s must be a string.', '$value')); } if (!isset($this->_blocks[$name])) { $this->_blocks[$name] = ''; From fa02a2efc90b4ef3b48f7f3f0a3d21f78fd0a383 Mon Sep 17 00:00:00 2001 From: euromark Date: Wed, 22 May 2013 12:15:33 +0200 Subject: [PATCH 2/2] unify "Are you sure you want to delete" --- lib/Cake/View/Scaffolds/index.ctp | 2 +- lib/Cake/View/Scaffolds/view.ctp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Cake/View/Scaffolds/index.ctp b/lib/Cake/View/Scaffolds/index.ctp index 456eeb8c6..0549b70f9 100644 --- a/lib/Cake/View/Scaffolds/index.ctp +++ b/lib/Cake/View/Scaffolds/index.ctp @@ -52,7 +52,7 @@ foreach (${$pluralVar} as ${$singularVar}): __d('cake', 'Delete'), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, - __d('cake', 'Are you sure you want to delete').' #' . ${$singularVar}[$modelClass][$primaryKey] + __d('cake', 'Are you sure you want to delete # %s?', ${$singularVar}[$modelClass][$primaryKey]) ); echo ''; echo ''; diff --git a/lib/Cake/View/Scaffolds/view.ctp b/lib/Cake/View/Scaffolds/view.ctp index 320095af3..8a9102e3e 100644 --- a/lib/Cake/View/Scaffolds/view.ctp +++ b/lib/Cake/View/Scaffolds/view.ctp @@ -178,7 +178,7 @@ $otherSingularVar = Inflector::variable($_alias); __d('cake', 'Delete'), array('plugin' => $_details['plugin'], 'controller' => $_details['controller'], 'action' => 'delete', ${$otherSingularVar}[$_details['primaryKey']]), null, - __d('cake', 'Are you sure you want to delete') .' #' . ${$otherSingularVar}[$_details['primaryKey']] . '?' + __d('cake', 'Are you sure you want to delete # %s?', ${$otherSingularVar}[$_details['primaryKey']]) ); echo "\n"; echo "\t\t\t\n";