Permalink
Browse files

use default.pot for core components/plugins

  • Loading branch information...
rchavik committed Apr 13, 2012
1 parent 31dee56 commit 5947c99d9ae70b484b9a0aa0ba2d27fa635f6b0d
@@ -94,7 +94,7 @@ public function main() {
$extensions = $this->_CroogoPlugin->getPlugins();
}
if (!in_array($ext, $extensions)) {
- $this->err(__d('croogo', '%s "%s" not found.', ucfirst($type), $ext));
+ $this->err(__('%s "%s" not found.', ucfirst($type), $ext));
return false;
}
return $this->{'_' . $activate . ucfirst($type)}($ext);
@@ -105,20 +105,20 @@ public function main() {
*/
public function getOptionParser() {
return parent::getOptionParser()
- ->description(__d('croogo', 'Activate Plugins & Themes'))
+ ->description(__('Activate Plugins & Themes'))
->addArguments(array(
'method' => array(
- 'help' => __d('croogo', 'Method to perform'),
+ 'help' => __('Method to perform'),
'required' => true,
'choices' => array('activate', 'deactivate'),
),
'type' => array(
- 'help' => __d('croogo', 'Extension type'),
+ 'help' => __('Extension type'),
'required' => true,
'choices' => array('plugin', 'theme'),
),
'extension' => array(
- 'help' => __d('croogo', 'Name of extension'),
+ 'help' => __('Name of extension'),
),
));
}
@@ -132,11 +132,11 @@ public function getOptionParser() {
protected function _activatePlugin($plugin = null) {
$result = $this->_CroogoPlugin->activate($plugin);
if ($result === true) {
- $this->out(__d('croogo', 'Plugin "%s" activated successfully.', $plugin));
+ $this->out(__('Plugin "%s" activated successfully.', $plugin));
} elseif (is_string($result)) {
$this->err($result);
} else {
- $this->err(__d('croogo', 'Plugin "%s" could not be activated. Please, try again.', $plugin));
+ $this->err(__('Plugin "%s" could not be activated. Please, try again.', $plugin));
}
return false;
}
@@ -169,12 +169,12 @@ protected function _deactivatePlugin($plugin = null) {
protected function _activateTheme($theme = null) {
if ($r = $this->_CroogoTheme->activate($theme)) {
if (is_null($theme)) {
- $this->out(__d('croogo', 'Theme deactivated successfully.'));
+ $this->out(__('Theme deactivated successfully.'));
} else {
- $this->out(__d('croogo', 'Theme "%s" activated successfully.', $theme));
+ $this->out(__('Theme "%s" activated successfully.', $theme));
}
} else {
- $this->err(__d('croogo', 'Theme "%s" activation failed.', $theme));
+ $this->err(__('Theme "%s" activation failed.', $theme));
}
return true;
}
@@ -60,7 +60,7 @@ public function main() {
if ($zip = $this->_download($url)) {
if ($this->_install($type, $zip)) {
if ($this->_activate($type, $zip)) {
- $this->out(__d('croogo', 'Extension installed and activated.'));
+ $this->out(__('Extension installed and activated.'));
}
}
}
@@ -71,19 +71,19 @@ public function main() {
*/
public function getOptionParser() {
return parent::getOptionParser()
- ->description(__d('croogo', 'Download, Install & Activate Plugins & Themes'))
+ ->description(__('Download, Install & Activate Plugins & Themes'))
->addArguments(array(
'type' => array(
- 'help' => __d('croogo', 'Extension type'),
+ 'help' => __('Extension type'),
'required' => true,
'choices' => array('plugin', 'theme'),
),
'zip_url' => array(
- 'help' => __d('croogo', 'URL to zip file OR github user name'),
+ 'help' => __('URL to zip file OR github user name'),
'required' => true,
),
'github_package' => array(
- 'help' => __d('croogo', 'Github repo name'),
+ 'help' => __('Github repo name'),
),
));
}
@@ -114,7 +114,7 @@ protected function _activate($type = null, $zip = null) {
* @return boolean
*/
protected function _install($type = null, $zip = null) {
- $this->out(__d('croogo', 'Installing extension...'));
+ $this->out(__('Installing extension...'));
try {
$this->_ExtensionsInstaller->{'extract' . ucfirst($type)}($zip);
return true;
@@ -135,7 +135,7 @@ protected function _download($url = null) {
if (empty($url)) {
throw new ConsoleException(__('Please specify a URL to a zipball extension'));
}
- $this->out(__d('croogo', 'Downloading extension...'));
+ $this->out(__('Downloading extension...'));
$url = $this->_githubUrl($url);
$filename = uniqid('croogo_') . '.zip';
$zip = $this->tmpPath . $filename;
@@ -306,9 +306,9 @@ public function activate($plugin) {
}
return true;
} else {
- return __d('croogo', 'Plugin "%s" depends on "%s" plugin.', $plugin, $missingPlugin);
+ return __('Plugin "%s" depends on "%s" plugin.', $plugin, $missingPlugin);
}
- return __d('croogo', 'Plugin "%s" could not be activated. Please, try again.', $plugin);
+ return __('Plugin "%s" could not be activated. Please, try again.', $plugin);
}
}
@@ -41,7 +41,7 @@ class ExtensionsInstaller {
*/
public function getPluginName($path = null) {
if (empty($path)) {
- throw new CakeException(__d('extensions', 'Invalid plugin path'));
+ throw new CakeException(__('Invalid plugin path'));
return false;
}
if (isset($this->_pluginName[$path])) {
@@ -68,13 +68,13 @@ public function getPluginName($path = null) {
}
$Zip->close();
if (!$plugin) {
- throw new CakeException(__d('extensions', 'Invalid plugin'));
+ throw new CakeException(__('Invalid plugin'));
return false;
}
$this->_pluginName[$path] = $plugin;
return $plugin;
} else {
- throw new CakeException(__d('extensions', 'Invalid zip archive'));
+ throw new CakeException(__('Invalid zip archive'));
}
return false;
}
@@ -88,7 +88,7 @@ public function getPluginName($path = null) {
*/
public function extractPlugin($path = null, $plugin = null) {
if (!file_exists($path)) {
- throw new CakeException(__d('extensions', 'Invalid plugin file path'));
+ throw new CakeException(__('Invalid plugin file path'));
return false;
}
@@ -99,7 +99,7 @@ public function extractPlugin($path = null, $plugin = null) {
$pluginHome = current(App::path('Plugin'));
$pluginPath = $pluginHome . $plugin . DS;
if (is_dir($pluginPath)) {
- throw new CakeException(__d('extensions', 'Plugin already exists'));
+ throw new CakeException(__('Plugin already exists'));
return false;
}
@@ -116,7 +116,7 @@ public function extractPlugin($path = null, $plugin = null) {
$Zip->close();
return true;
} else {
- throw new CakeException(__d('extensions', 'Failed to extract plugin'));
+ throw new CakeException(__('Failed to extract plugin'));
}
return false;
}
@@ -128,7 +128,7 @@ public function extractPlugin($path = null, $plugin = null) {
*/
public function getThemeName($path = null) {
if (empty($path)) {
- throw new CakeException(__d('extensions', 'Invalid theme path'));
+ throw new CakeException(__('Invalid theme path'));
return false;
}
if (isset($this->_themeName[$path])) {
@@ -144,7 +144,7 @@ public function getThemeName($path = null) {
$yml = $Zip->getFromIndex($i);
preg_match('/name: (.+)/', $yml, $matches);
if (empty($matches[1])) {
- throw new CakeException(__d('extensions', 'Invalid YML file'));
+ throw new CakeException(__('Invalid YML file'));
} else {
$theme = trim($matches[1]);
}
@@ -153,13 +153,13 @@ public function getThemeName($path = null) {
}
$Zip->close();
if (!$theme) {
- throw new CakeException(__d('extensions', 'Invalid theme'));
+ throw new CakeException(__('Invalid theme'));
return false;
}
$this->_themeName[$path] = $theme;
return $theme;
} else {
- throw new CakeException(__d('extensions', 'Invalid zip archive'));
+ throw new CakeException(__('Invalid zip archive'));
}
return false;
}
@@ -173,7 +173,7 @@ public function getThemeName($path = null) {
*/
public function extractTheme($path = null, $theme = null) {
if (!file_exists($path)) {
- throw new CakeException(__d('extensions', 'Invalid theme file path'));
+ throw new CakeException(__('Invalid theme file path'));
return false;
}
@@ -184,7 +184,7 @@ public function extractTheme($path = null, $theme = null) {
$themeHome = current(App::path('View')) . 'Themed' . DS;
$themePath = $themeHome . $theme . DS;
if (is_dir($themePath)) {
- throw new CakeException(__d('extensions', 'Theme already exists'));
+ throw new CakeException(__('Theme already exists'));
return false;
}
@@ -201,7 +201,7 @@ public function extractTheme($path = null, $theme = null) {
$Zip->close();
return true;
} else {
- throw new CakeException(__d('extensions', 'Failed to extract theme'));
+ throw new CakeException(__('Failed to extract theme'));
}
return false;
}
@@ -18,7 +18,7 @@ class InstallShell extends AppShell {
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
- $parser->description(__d('croogo', 'Install Utilities')
+ $parser->description(__('Install Utilities')
)->addSubcommand('data', array(
'help' => 'Generate data files',
'parser' => array(

0 comments on commit 5947c99

Please sign in to comment.