From 9858bd526fce9016dc82d1f21b35e6ceb969c140 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 22 Sep 2011 21:32:49 -0400 Subject: Fixes #3808 not translating manifest fields through elgg_echo() --- engine/classes/ElggPluginManifest.php | 38 +++++++---------------------------- languages/en.php | 1 + views/default/admin/plugins.php | 8 +++++++- 3 files changed, 15 insertions(+), 32 deletions(-) diff --git a/engine/classes/ElggPluginManifest.php b/engine/classes/ElggPluginManifest.php index 0f3b1d7a8..0e47f388d 100644 --- a/engine/classes/ElggPluginManifest.php +++ b/engine/classes/ElggPluginManifest.php @@ -224,20 +224,15 @@ class ElggPluginManifest { /** * Returns the plugin name * - * @param bool $elgg_echo Run the name through elgg_echo. * @return string */ - public function getName($elgg_echo = true) { + public function getName() { $name = $this->parser->getAttribute('name'); if (!$name && $this->pluginID) { $name = ucwords(str_replace('_', ' ', $this->pluginID)); } - if ($elgg_echo) { - $name = elgg_echo($name); - } - return $name; } @@ -245,33 +240,21 @@ class ElggPluginManifest { /** * Return the description * - * @param bool $elgg_echo Run the description through elgg_echo. * @return string */ - public function getDescription($elgg_echo = true) { - $desc = $this->parser->getAttribute('description'); - - if ($elgg_echo) { - return elgg_echo($desc); - } else { - return $desc; - } + public function getDescription() { + return $this->parser->getAttribute('description'); } /** * Return the short description * - * @param bool $elgg_echo Run the blurb through elgg_echo. * @return string */ - public function getBlurb($elgg_echo = true) { + public function getBlurb() { $blurb = $this->parser->getAttribute('blurb'); - if ($blurb) { - if ($elgg_echo) { - $blurb = elgg_echo($blurb); - } - } else { + if (!$blurb) { $blurb = elgg_get_excerpt($this->getDescription()); } @@ -348,10 +331,9 @@ class ElggPluginManifest { /** * Return the screenshots listed. * - * @param bool $elgg_echo Run the screenshot's description through elgg_echo. * @return array */ - public function getScreenshots($elgg_echo = true) { + public function getScreenshots() { $ss = $this->parser->getAttribute('screenshot'); if (!$ss) { @@ -360,13 +342,7 @@ class ElggPluginManifest { $normalized = array(); foreach ($ss as $s) { - $normalized_s = $this->buildStruct($this->screenshotStruct, $s); - - if ($elgg_echo) { - $normalized_s['description'] = elgg_echo($normalized_s['description']); - } - - $normalized[] = $normalized_s; + $normalized[] = $this->buildStruct($this->screenshotStruct, $s); } return $normalized; diff --git a/languages/en.php b/languages/en.php index 6c3c041cd..d83d4773b 100644 --- a/languages/en.php +++ b/languages/en.php @@ -613,6 +613,7 @@ $english = array( 'admin:plugins:category:multimedia' => 'Multimedia', 'admin:plugins:category:theme' => 'Themes', 'admin:plugins:category:widget' => 'Widgets', + 'admin:plugins:category:utility' => 'Utilities', 'admin:plugins:sort:priority' => 'Priority', 'admin:plugins:sort:alpha' => 'Alphabetical', diff --git a/views/default/admin/plugins.php b/views/default/admin/plugins.php index 62e6f556a..451936335 100644 --- a/views/default/admin/plugins.php +++ b/views/default/admin/plugins.php @@ -60,7 +60,13 @@ foreach ($installed_plugins as $id => $plugin) { if (isset($plugin_categories)) { foreach ($plugin_categories as $category) { if (!array_key_exists($category, $categories)) { - $categories[$category] = elgg_echo("admin:plugins:category:$category"); + // if localization string not defined, fall back to original category string + $cat_raw_string = "admin:plugins:category:$category"; + $cat_display_string = elgg_echo($cat_raw_string); + if ($cat_display_string == $cat_raw_string) { + $cat_display_string = ucwords($category); + } + $categories[$category] = $cat_display_string; } } } -- cgit v1.2.3