Author: chabotc
Date: Sun Jan 18 01:49:49 2009
New Revision: 735414

URL: http://svn.apache.org/viewvc?rev=735414&view=rev
Log:
SHINDIG-853 by Shogo Kawahara - Apply message translations on the user prefs too

Modified:
    incubator/shindig/trunk/php/src/gadgets/GadgetServer.php

Modified: incubator/shindig/trunk/php/src/gadgets/GadgetServer.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/gadgets/GadgetServer.php?rev=735414&r1=735413&r2=735414&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/gadgets/GadgetServer.php (original)
+++ incubator/shindig/trunk/php/src/gadgets/GadgetServer.php Sun Jan 18 
01:49:49 2009
@@ -81,7 +81,7 @@
         // relative path's in the locale spec uri
         $gadgetUrl = $context->getUrl();
         $gadgetUrl = substr($gadgetUrl, 0, strrpos($gadgetUrl, '/') + 1);
-        $uri = $gadgetUrl.$uri;
+        $uri = $gadgetUrl . $uri;
       }
       $requestArray[] = new RemoteContentRequest($uri);
       $contextArray[] = $context;
@@ -137,6 +137,16 @@
     $substitutor->addSubstitution('BIDI', "END_EDGE", $rtl ? "left" : "right");
     $substitutor->addSubstitution('BIDI', "DIR", $rtl ? "rtl" : "ltr");
     $substitutor->addSubstitution('BIDI', "REVERSE_DIR", $rtl ? "ltr" : "rtl");
+    foreach ($gadget->userPrefs as $pref) {
+      if (!empty($pref->displayName)) {
+        $pref->displayName = 
$gadget->getSubstitutions()->substitute($pref->displayName);
+      }
+      if (is_array($pref->enumValues) && count($pref->enumValues)) {
+        foreach ($pref->enumValues as &$enum) {
+          $enum = $gadget->getSubstitutions()->substitute($enum);
+        }
+      }
+    }
     // userPref's
     $upValues = $gadget->getUserPrefValues();
     foreach ($gadget->getUserPrefs() as $pref) {


Reply via email to