]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #3808 not translating manifest fields through elgg_echo()
authorcash <cash.costello@gmail.com>
Fri, 23 Sep 2011 01:32:49 +0000 (21:32 -0400)
committercash <cash.costello@gmail.com>
Fri, 23 Sep 2011 01:32:49 +0000 (21:32 -0400)
engine/classes/ElggPluginManifest.php
languages/en.php
views/default/admin/plugins.php

index 0f3b1d7a862654102bb82163a49e3064c6b56cc6..0e47f388de850ed9df4fb71be7453e8478f27b06 100644 (file)
@@ -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;
index 6c3c041cd3f2872e653f1bef3bd2134489a27f9e..d83d4773b9339c1e3429f385ddd4b4ec13ed1a7f 100644 (file)
@@ -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',
index 62e6f556a5e208404fc03cc201d49c7846a0b773..451936335045173af92621325ceb56bf60beb3d0 100644 (file)
@@ -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;
                        }
                }
        }